Commit 594941aa by 王军业

加入合同验收信息部分

1 parent c8847d85
Showing 18 changed files with 824 additions and 739 deletions
package com.vion.financial.controller; package com.vion.financial.controller;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.vion.financial.service.ContractService; import com.vion.financial.service.ContractService;
import com.vion.financial.vo.ContractVo; import com.vion.financial.vo.ContractVo;
@RestController @RestController
public class ContractController extends BaseController { public class ContractController extends BaseController {
@Resource @Resource
ContractService contractService; ContractService contractService;
@PostMapping @PostMapping
@ResponseBody @ResponseBody
public Object addContract(@RequestBody ContractVo vontractVo) { public Object addContract(@RequestBody ContractVo vontractVo) {
return contractService.addOne(vontractVo); return contractService.addOne(vontractVo);
} }
@GetMapping(value="/{contract_unid}") @GetMapping(value="/{contract_unid}")
@ResponseBody @ResponseBody
public Object queryOne(@PathVariable String contract_unid) { public Object queryOne(@PathVariable String contract_unid) {
return contractService.queryOne(contract_unid); return contractService.queryOne(contract_unid);
} }
@PutMapping(value="/{contract_unid}") @PutMapping(value="/{contract_unid}")
@ResponseBody @ResponseBody
public Object updateOne(@PathVariable String contract_unid , @RequestBody ContractVo vontractVo) { public Object updateOne(@PathVariable String contract_unid , @RequestBody ContractVo vontractVo) {
vontractVo.setContract_unid(contract_unid); vontractVo.setContract_unid(contract_unid);
return contractService.updateOne(vontractVo); return contractService.updateOne(vontractVo);
} }
@DeleteMapping(value="/{contract_unid}") @DeleteMapping(value="/{contract_unid}")
@ResponseBody @ResponseBody
public Object deleteOne(@PathVariable String contract_unid ) { public Object deleteOne(@PathVariable String contract_unid ) {
return contractService.deleteOne(contract_unid); return contractService.deleteOne(contract_unid);
} }
}
@GetMapping(value="codes")
@ResponseBody
public Object queryList() {
return contractService.queryList();
}
}
package com.vion.financial.controller; package com.vion.financial.controller;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.vion.financial.service.DeliverGoodsService;
import com.vion.financial.service.ReturnInfoService; import com.vion.financial.service.DeliverGoodsService;
import com.vion.financial.vo.DeliverGoodsVo; import com.vion.financial.service.ReturnInfoService;
import com.vion.financial.vo.DeliverGoodsVo;
@RestController
public class DeliverGoodsController extends BaseController{ @RestController
@Resource public class DeliverGoodsController extends BaseController{
DeliverGoodsService deliverGoodsService; @Resource
DeliverGoodsService deliverGoodsService;
@GetMapping("/{contract_unid}/delivers")
@ResponseBody @GetMapping("/{contract_unid}/delivers")
public Object queryDeliverInfo(@PathVariable String contract_unid) { @ResponseBody
return deliverGoodsService.queryDeliverGoods(contract_unid); public Object queryDeliverInfo(@PathVariable String contract_unid) {
} return deliverGoodsService.queryDeliverGoods(contract_unid);
}
@PostMapping("/{contract_unid}/delivers")
@ResponseBody @PostMapping("/{contract_unid}/delivers")
public Object addDeliverInfo(@RequestBody DeliverGoodsVo deliverGoodsVo,@PathVariable String contract_unid) { @ResponseBody
return deliverGoodsService.addDeliverGoods(deliverGoodsVo, contract_unid); public Object addDeliverInfo(@RequestBody DeliverGoodsVo deliverGoodsVo,@PathVariable String contract_unid) {
} return deliverGoodsService.addDeliverGoods(deliverGoodsVo, contract_unid);
}
@PutMapping("/{contract_unid}/delivers")
@ResponseBody @PutMapping("/{contract_unid}/delivers")
public Object updateDeliverInf(@RequestBody DeliverGoodsVo deliverGoodsVo,@PathVariable String contract_unid) { @ResponseBody
return deliverGoodsService.updateDeliverGoods(deliverGoodsVo, contract_unid); public Object updateDeliverInf(@RequestBody DeliverGoodsVo deliverGoodsVo,@PathVariable String contract_unid) {
} return deliverGoodsService.updateDeliverGoods(deliverGoodsVo, contract_unid);
} }
@DeleteMapping("/{contract_unid}/delivers")
@ResponseBody
public Object deleteDeliverInfo(@RequestBody DeliverGoodsVo deliverGoodsVo,@PathVariable String contract_unid) {
return deliverGoodsService.deleteDeliverGoods(deliverGoodsVo, contract_unid);
}
}
package com.vion.financial.entity; package com.vion.financial.entity;
public class Appendix { public class Appendix {
private int appendix_unid; private Integer appendix_unid;
private String business_table; private String business_table;
private String business_unid; private String business_unid;
private String appendix_name; private String appendix_name;
private String appendix_type; private String appendix_type;
private String appendix_url; private String appendix_url;
public int getAppendix_unid() { public Integer getAppendix_unid() {
return appendix_unid; return appendix_unid;
} }
public void setAppendix_unid(int appendix_unid) { public void setAppendix_unid(Integer appendix_unid) {
this.appendix_unid = appendix_unid; this.appendix_unid = appendix_unid;
} }
public String getBusiness_table() { public String getBusiness_table() {
return business_table; return business_table;
} }
public void setBusiness_table(String business_table) { public void setBusiness_table(String business_table) {
this.business_table = business_table; this.business_table = business_table;
} }
public String getBusiness_unid() { public String getBusiness_unid() {
return business_unid; return business_unid;
} }
public void setBusiness_unid(String business_unid) { public void setBusiness_unid(String business_unid) {
this.business_unid = business_unid; this.business_unid = business_unid;
} }
public String getAppendix_name() { public String getAppendix_name() {
return appendix_name; return appendix_name;
} }
public void setAppendix_name(String appendix_name) { public void setAppendix_name(String appendix_name) {
this.appendix_name = appendix_name; this.appendix_name = appendix_name;
} }
public String getAppendix_type() { public String getAppendix_type() {
return appendix_type; return appendix_type;
} }
public void setAppendix_type(String appendix_type) { public void setAppendix_type(String appendix_type) {
this.appendix_type = appendix_type; this.appendix_type = appendix_type;
} }
public String getAppendix_url() { public String getAppendix_url() {
return appendix_url; return appendix_url;
} }
public void setAppendix_url(String appendix_url) { public void setAppendix_url(String appendix_url) {
this.appendix_url = appendix_url; this.appendix_url = appendix_url;
} }
} }
package com.vion.financial.entity; package com.vion.financial.entity;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
@JsonInclude(value=Include.NON_NULL) @JsonInclude(value=Include.NON_NULL)
public class DeliverGoods { public class DeliverGoods {
private int deliver_unid; private int deliver_unid;
private String contract_unid; private String contract_unid;
private Date deliver_goods_date; private Date deliver_goods_date;
private Date goods_acceptanc_date; private Date goods_acceptanc_date;
private List<Appendix> appendix_list; private List<Appendix> list_deliver_data;
public int getDeliver_unid() { List<Integer> appendix_unids;
return deliver_unid; public int getDeliver_unid() {
} return deliver_unid;
public void setDeliver_unid(int deliver_unid) { }
this.deliver_unid = deliver_unid; public void setDeliver_unid(int deliver_unid) {
} this.deliver_unid = deliver_unid;
public String getContract_unid() { }
return contract_unid; public String getContract_unid() {
} return contract_unid;
public void setContract_unid(String contract_unid) { }
this.contract_unid = contract_unid; public void setContract_unid(String contract_unid) {
} this.contract_unid = contract_unid;
public Date getDeliver_goods_date() { }
return deliver_goods_date; public Date getDeliver_goods_date() {
} return deliver_goods_date;
public void setDeliver_goods_date(Date deliver_goods_date) { }
this.deliver_goods_date = deliver_goods_date; public void setDeliver_goods_date(Date deliver_goods_date) {
} this.deliver_goods_date = deliver_goods_date;
public Date getGoods_acceptanc_date() { }
return goods_acceptanc_date; public Date getGoods_acceptanc_date() {
} return goods_acceptanc_date;
public void setGoods_acceptanc_date(Date goods_acceptanc_date) { }
this.goods_acceptanc_date = goods_acceptanc_date; public void setGoods_acceptanc_date(Date goods_acceptanc_date) {
} this.goods_acceptanc_date = goods_acceptanc_date;
public List<Appendix> getAppendix_list() { }
return appendix_list; public List<Appendix> getList_deliver_data() {
} return list_deliver_data;
public void setAppendix_list(List<Appendix> appendix_list) { }
this.appendix_list = appendix_list; public void setList_deliver_data(List<Appendix> list_deliver_data) {
} this.list_deliver_data = list_deliver_data;
}
} public List<Integer> getAppendix_unids() {
return appendix_unids;
}
public void setAppendix_unids(List<Integer> appendix_unids) {
this.appendix_unids = appendix_unids;
}
}
package com.vion.financial.entity; package com.vion.financial.entity;
import java.util.Date; import java.util.Date;
import java.util.List;
public class ProjectAcceptanc {
private int acceptanc_unid; public class ProjectAcceptanc {
private String contract_unid; private int acceptanc_unid;
private String acceptanc_type; private String contract_unid;
private Date acceptanc_date; private String acceptanc_type;
private String acceptanc_note; private Date acceptanc_date;
public int getAcceptanc_unid() { private String acceptanc_note;
return acceptanc_unid; private List<Integer> appendix_unids;
} private List<ProjectAcceptanc> appendix_list;
public void setAcceptanc_unid(int acceptanc_unid) { public int getAcceptanc_unid() {
this.acceptanc_unid = acceptanc_unid; return acceptanc_unid;
} }
public String getContract_unid() { public void setAcceptanc_unid(int acceptanc_unid) {
return contract_unid; this.acceptanc_unid = acceptanc_unid;
} }
public void setContract_unid(String contract_unid) { public String getContract_unid() {
this.contract_unid = contract_unid; return contract_unid;
} }
public String getAcceptanc_type() { public void setContract_unid(String contract_unid) {
return acceptanc_type; this.contract_unid = contract_unid;
} }
public void setAcceptanc_type(String acceptanc_type) { public String getAcceptanc_type() {
this.acceptanc_type = acceptanc_type; return acceptanc_type;
} }
public Date getAcceptanc_date() { public void setAcceptanc_type(String acceptanc_type) {
return acceptanc_date; this.acceptanc_type = acceptanc_type;
} }
public void setAcceptanc_date(Date acceptanc_date) { public Date getAcceptanc_date() {
this.acceptanc_date = acceptanc_date; return acceptanc_date;
} }
public String getAcceptanc_note() { public void setAcceptanc_date(Date acceptanc_date) {
return acceptanc_note; this.acceptanc_date = acceptanc_date;
} }
public void setAcceptanc_note(String acceptanc_note) { public String getAcceptanc_note() {
this.acceptanc_note = acceptanc_note; return acceptanc_note;
} }
public void setAcceptanc_note(String acceptanc_note) {
} this.acceptanc_note = acceptanc_note;
}
public List<ProjectAcceptanc> getAppendix_list() {
return appendix_list;
}
public void setAppendix_list(List<ProjectAcceptanc> appendix_list) {
this.appendix_list = appendix_list;
}
public List<Integer> getAppendix_unids() {
return appendix_unids;
}
public void setAppendix_unids(List<Integer> appendix_unids) {
this.appendix_unids = appendix_unids;
}
}
package com.vion.financial.mapper; package com.vion.financial.mapper;
import org.springframework.transaction.annotation.Transactional; import java.util.List;
import com.vion.financial.vo.ContractVo; import org.springframework.transaction.annotation.Transactional;
import com.vion.financial.vo.ContractsListVo;
import com.vion.financial.vo.SelectVo; import com.vion.financial.vo.ContractVo;
import com.vion.financial.vo.ContractsListVo;
public interface ContractMapper { import com.vion.financial.vo.SelectVo;
@Transactional
public void addOne(ContractVo contractVo); public interface ContractMapper {
public ContractVo queryOne(String contract_unid); @Transactional
@Transactional public void addOne(ContractVo contractVo);
public void updateOne(ContractVo contractVo); public ContractVo queryOne(String contract_unid);
@Transactional @Transactional
public void deleteOne(String contract_unid); public void updateOne(ContractVo contractVo);
@Transactional
public ContractsListVo selectByCondition(SelectVo selectVo); public void deleteOne(String contract_unid);
public List<String> queryList();
public boolean isDelete(String contract_unid); public ContractsListVo selectByCondition(SelectVo selectVo);
}
public boolean isDelete(String contract_unid);
}
package com.vion.financial.mapper; package com.vion.financial.mapper;
import com.vion.financial.entity.ProjectAcceptanc; import java.util.List;
public interface ProjectAcceptancMapper { import com.vion.financial.entity.ProjectAcceptanc;
public Object addProjectAcceptanc(ProjectAcceptanc projectAcceptanc);
public ProjectAcceptanc queryProjectAcceptanc(String s); public interface ProjectAcceptancMapper {
public Object updateProjectAcceptanc(ProjectAcceptanc projectAcceptanc); public void addProjectAcceptanc(ProjectAcceptanc projectAcceptanc);
public Object deleteProjectAcceptanc(int n); public List<ProjectAcceptanc> queryProjectAcceptanc(String s);
} public void updateProjectAcceptanc(ProjectAcceptanc projectAcceptanc);
public void deleteProjectAcceptanc(int n);
}
package com.vion.financial.mapper; package com.vion.financial.mapper;
import com.vion.financial.entity.Project; import java.util.List;
public interface ProjectMapper { import com.vion.financial.entity.Project;
public Object addProject(Project projec);
public Project queryProject(String s); public interface ProjectMapper {
public Object updateProject(Project project); public void addProject(Project projec);
public Object deleteProject(int n); public List<Project> queryProject();
} public void updateProject(Project project);
public void deleteProject(int n);
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.vion.financial.mapper.AppendixMapper"> <mapper namespace="com.vion.financial.mapper.AppendixMapper">
<select id="queryAppendixList" resultType="com.vion.financial.entity.Appendix" parameterType="com.vion.financial.entity.Appendix"> <select id="queryAppendixList" resultType="com.vion.financial.entity.Appendix" parameterType="com.vion.financial.entity.Appendix">
select * from tb_appendix where select * from tb_appendix where
<if test="business_table !=null and business_table !=''"> <if test="business_table !=null and business_table !=''">
business_table = #{business_table} business_table = #{business_table}
</if> </if>
<if test="business_unid !=null and business_unid !=''"> <if test="business_unid !=null and business_unid !=''">
and business_unid = #{business_unid} and business_unid = #{business_unid}
</if> </if>
<!-- and <!-- and
<if test="appendix_name !=null and appendix_name !=''"> <if test="appendix_name !=null and appendix_name !=''">
appendix_name = #{appendix_name} appendix_name = #{appendix_name}
</if> </if>
and and
<if test="appendix_type !=null and appendix_type !=''"> <if test="appendix_type !=null and appendix_type !=''">
appendix_type = #{appendix_type} appendix_type = #{appendix_type}
</if> </if>
and and
<if test="appendix_url !=null and appendix_url !=''"> <if test="appendix_url !=null and appendix_url !=''">
appendix_url = #{appendix_url} appendix_url = #{appendix_url}
</if> --> </if> -->
</select> </select>
<insert id="addAppendix" parameterType="com.vion.financial.entity.Appendix" keyColumn="appendix_unid" keyProperty="appendix_unid" useGeneratedKeys="true" > <insert id="addAppendix" parameterType="com.vion.financial.entity.Appendix" keyColumn="appendix_unid" keyProperty="appendix_unid" useGeneratedKeys="true" >
insert into tb_appendix ( insert into tb_appendix (
business_table business_table
<if test="business_unid !=null and business_unid !=''"> <if test="business_unid !=null and business_unid !=''">
,business_unid ,business_unid
</if> </if>
<if test="appendix_name !=null and appendix_name !=''"> <if test="appendix_name !=null and appendix_name !=''">
,appendix_name ,appendix_name
</if> </if>
<if test="appendix_type !=null and appendix_type !=''"> <if test="appendix_type !=null and appendix_type !=''">
,appendix_type ,appendix_type
</if> </if>
<if test="appendix_url !=null and appendix_url !=''"> <if test="appendix_url !=null and appendix_url !=''">
,appendix_url ,appendix_url
</if> </if>
) values ( ) values (
#{business_table} #{business_table}
<if test="business_unid !=null and business_unid !=''"> <if test="business_unid !=null and business_unid !=''">
,#{business_unid} ,#{business_unid}
</if> </if>
<if test="appendix_name !=null and appendix_name !=''"> <if test="appendix_name !=null and appendix_name !=''">
,#{appendix_name} ,#{appendix_name}
</if> </if>
<if test="appendix_type !=null and appendix_type !=''"> <if test="appendix_type !=null and appendix_type !=''">
,#{appendix_type} ,#{appendix_type}
</if> </if>
<if test="appendix_url !=null and appendix_url !=''"> <if test="appendix_url !=null and appendix_url !=''">
,#{appendix_url} ,#{appendix_url}
</if> </if>
) )
</insert> </insert>
<update id="updateAppendix" parameterType="com.vion.financial.entity.Appendix"> <update id="updateAppendix" parameterType="com.vion.financial.entity.Appendix">
update tb_appendix set update tb_appendix set
<if test="appendix_unid != null and appendix_unid != ''"> <if test="appendix_unid != null and appendix_unid != ''">
appendix_unid=#{appendix_unid} appendix_unid=#{appendix_unid}
</if> </if>
<if test="business_table != null and business_table != ''"> <if test="business_table != null and business_table != ''">
,business_table=#{business_table} ,business_table=#{business_table}
</if> </if>
<if test="business_unid !=null and business_unid != ''"> <if test="business_unid !=null and business_unid != ''">
, business_unid=#{business_unid} , business_unid=#{business_unid}
</if> </if>
<if test="appendix_name != null and appendix_name != ''"> <if test="appendix_name != null and appendix_name != ''">
,appendix_name=#{appendix_name} ,appendix_name=#{appendix_name}
</if> </if>
<if test="appendix_type != null and appendix_type != ''"> <if test="appendix_type != null and appendix_type != ''">
,appendix_type=#{appendix_type} ,appendix_type=#{appendix_type}
</if> </if>
<if test="appendix_url != null and appendix_url != ''"> <if test="appendix_url != null and appendix_url != ''">
,appendix_url=#{appendix_url} ,appendix_url=#{appendix_url}
</if> </if>
where appendix_unid = #{appendix_unid} where appendix_unid = #{appendix_unid}
</update> </update>
<delete id="deleteAppendix" parameterType="com.vion.financial.entity.Appendix"> <delete id="deleteAppendix" parameterType="com.vion.financial.entity.Appendix">
delete from tb_appendix where business_table = #{business_table} and business_unid = #{business_unid} delete from tb_appendix where business_table = #{business_table} or business_unid = #{business_unid}
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.vion.financial.mapper.ProjectAcceptancMapper"> <mapper namespace="com.vion.financial.mapper.ProjectAcceptancMapper">
<insert id="addProjectAcceptanc" parameterType="com.vion.financial.entity.ProjectAcceptanc"> <insert id="addProjectAcceptanc" parameterType="com.vion.financial.entity.ProjectAcceptanc" keyColumn="acceptanc_unid" useGeneratedKeys="true" keyProperty="acceptanc_unid">
insert into tb_project_acceptanc (contract_unid,acceptanc_type,acceptanc_date,acceptanc_note) insert into tb_project_acceptanc (contract_unid,acceptanc_type,acceptanc_date,acceptanc_note)
values(#{contract_unid},#{acceptanc_type},#{acceptanc_date},#{acceptanc_note}) values(#{contract_unid},#{acceptanc_type},#{acceptanc_date},#{acceptanc_note})
</insert> </insert>
<update id="updateProjectAcceptanc" parameterType="com.vion.financial.entity.ProjectAcceptanc"> <update id="updateProjectAcceptanc" parameterType="com.vion.financial.entity.ProjectAcceptanc">
update tb_project_acceptanc set contract_unid = #{contract_unid},acceptanc_type = #{acceptanc_type},acceptanc_date = #{acceptanc_date},acceptanc_note = #{acceptanc_note} update tb_project_acceptanc set contract_unid = #{contract_unid},acceptanc_type = #{acceptanc_type},acceptanc_date = #{acceptanc_date},acceptanc_note = #{acceptanc_note}
where acceptanc_unid = #{acceptanc_unid} where acceptanc_unid = #{acceptanc_unid}
</update> </update>
<select id="queryProjectAcceptanc" parameterType="String"> <select id="queryProjectAcceptanc" parameterType="String" resultType="com.vion.financial.entity.ProjectAcceptanc">
select *from tb_project_acceptanc where contract_unid = #{contract_unid} select *from tb_project_acceptanc where contract_unid = #{contract_unid}
</select> </select>
<delete id="deleteProjectAcceptanc" parameterType="int"> <delete id="deleteProjectAcceptanc" parameterType="int">
delete from tb_project_acceptanc where acceptanc_unid = #{acceptanc_unid} delete from tb_project_acceptanc where acceptanc_unid = #{acceptanc_unid}
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.vion.financial.mapper.ProjectMapper"> <mapper namespace="com.vion.financial.mapper.ProjectMapper">
<insert id="addProject" parameterType="com.vion.financial.entity.Project"> <insert id="addProject" parameterType="com.vion.financial.entity.Project">
insert into tb_project (project_name) values (#{project_name}) insert into tb_project (project_name) values (#{project_name})
</insert> </insert>
<update id="updateProject" parameterType="com.vion.financial.entity.Project"> <update id="updateProject" parameterType="com.vion.financial.entity.Project">
update tb_project set contract_unid = #{contract_unid},project_name = #{project_name} update tb_project set contract_unid = #{contract_unid},project_name = #{project_name}
where project_unid = #{project_unid} where project_unid = #{project_unid}
</update> </update>
<select id="queryProject" parameterType="String"> <select id="queryProject" resultType="com.vion.financial.entity.Project">
select *from tb_project where contract_unid = #{contract_unid} select * from tb_project where contract_unid = #{contract_unid}
</select> </select>
<delete id="deleteProject" parameterType="int"> <delete id="deleteProject" parameterType="int">
delete from tb_project where project_unid = #{project_unid} delete from tb_project where project_unid = #{project_unid}
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
package com.vion.financial.service; package com.vion.financial.service;
import com.vion.financial.vo.ContractVo; import com.vion.financial.vo.ContractVo;
public interface ContractService { public interface ContractService {
Object addOne(ContractVo vontractVo); public Object addOne(ContractVo vontractVo);
Object queryOne(String s); public Object queryOne(String s);
Object updateOne(ContractVo vontractVo); public Object updateOne(ContractVo vontractVo);
Object deleteOne(String s); public Object deleteOne(String s);
boolean isDelete(String s); public Object queryList();
} boolean isDelete(String s);
}
package com.vion.financial.service.imp; package com.vion.financial.service.imp;
import java.util.List; import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.vion.financial.entity.Appendix; import com.vion.financial.entity.Appendix;
import com.vion.financial.mapper.AppendixMapper; import com.vion.financial.mapper.AppendixMapper;
import com.vion.financial.mapper.ContractMapper; import com.vion.financial.mapper.ContractMapper;
import com.vion.financial.service.ContractService; import com.vion.financial.service.ContractService;
import com.vion.financial.vo.ContractVo; import com.vion.financial.vo.ContractVo;
import com.vion.financial.vo.FailCode; import com.vion.financial.vo.FailCode;
import com.vion.financial.vo.SuccessCode; import com.vion.financial.vo.SuccessCode;
@Service @Service
public class ContractServiceImpl implements ContractService { public class ContractServiceImpl implements ContractService {
Logger logger = LoggerFactory.getLogger(ContractServiceImpl.class); Logger logger = LoggerFactory.getLogger(ContractServiceImpl.class);
@Autowired @Autowired
ContractMapper contractMapper; ContractMapper contractMapper;
@Autowired @Autowired
AppendixMapper appendixMapper; AppendixMapper appendixMapper;
@Autowired @Autowired
SuccessCode successCode; SuccessCode successCode;
@Autowired @Autowired
FailCode failCode; FailCode failCode;
/*** /***
* 新增合同信息 * 新增合同信息
*/ */
@Override @Override
public Object addOne(ContractVo contractVo) { public Object addOne(ContractVo contractVo) {
try { try {
//先插入合同信息 //先插入合同信息
logger.info("============新增合同 start ============"); logger.info("============新增合同 start ============");
//根据附件unid集合更新附件表信息 //根据附件unid集合更新附件表信息
Appendix appendix = new Appendix(); Appendix appendix = new Appendix();
if(contractMapper.queryOne(contractVo.getContract_unid()) !=null) { if(contractMapper.queryOne(contractVo.getContract_unid()) !=null) {
contractMapper.updateOne(contractVo); contractMapper.updateOne(contractVo);
}else { }else {
contractMapper.addOne(contractVo); contractMapper.addOne(contractVo);
} }
appendix.setBusiness_table("tb_contract"); appendix.setBusiness_table("tb_contract");
appendix.setBusiness_unid(contractVo.getContract_unid()); appendix.setBusiness_unid(contractVo.getContract_unid());
for(int n:contractVo.getAppendix_unids()) { for(int n:contractVo.getAppendix_unids()) {
appendix.setAppendix_unid(n); appendix.setAppendix_unid(n);
appendixMapper.updateAppendix(appendix); appendixMapper.updateAppendix(appendix);
} }
return successCode; return successCode;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error("增加合同异常:"+e.getLocalizedMessage(), e); logger.error("增加合同异常:"+e.getLocalizedMessage(), e);
failCode.setEnode("500"); failCode.setEnode("500");
failCode.setEnode("增加异常"); failCode.setEnode("增加异常");
return failCode; return failCode;
} }
} }
@Override @Override
public Object queryOne(String s) { public Object queryOne(String s) {
try { try {
logger.info("================查询合同start==================="); logger.info("================查询合同start===================");
ContractVo contractVo = contractMapper.queryOne(s); ContractVo contractVo = contractMapper.queryOne(s);
Appendix appendix = new Appendix(); Appendix appendix = new Appendix();
appendix.setBusiness_table("tb_contract"); appendix.setBusiness_table("tb_contract");
appendix.setBusiness_unid(s); appendix.setBusiness_unid(s);
List<Appendix> appendixs = appendixMapper.queryAppendixList(appendix); List<Appendix> appendixs = appendixMapper.queryAppendixList(appendix);
contractVo.setAppendix_list(appendixs); contractVo.setAppendix_list(appendixs);
return contractVo; return contractVo;
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
/* return failCode;*/ /* return failCode;*/
logger.error("查询合同异常"+e.getLocalizedMessage(),e); logger.error("查询合同异常"+e.getLocalizedMessage(),e);
e.printStackTrace(); e.printStackTrace();
failCode.setEnode("500"); failCode.setEnode("500");
failCode.setEnode("查询异常"); failCode.setEnode("查询异常");
return failCode; return failCode;
} }
} }
@Override @Override
public Object updateOne(ContractVo vontractVo) { public Object updateOne(ContractVo vontractVo) {
try { try {
logger.info("======================修改合同start====================="); logger.info("======================修改合同start=====================");
contractMapper.updateOne(vontractVo); contractMapper.updateOne(vontractVo);
Appendix appendix = new Appendix(); Appendix appendix = new Appendix();
appendix.setBusiness_table("tb_contract"); appendix.setBusiness_table("tb_contract");
appendix.setBusiness_unid(vontractVo.getContract_unid()); appendix.setBusiness_unid(vontractVo.getContract_unid());
for(int n:vontractVo.getAppendix_unids()) { for(int n:vontractVo.getAppendix_unids()) {
appendix.setAppendix_unid(n); appendix.setAppendix_unid(n);
appendixMapper.updateAppendix(appendix); appendixMapper.updateAppendix(appendix);
} }
return successCode; return successCode;
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
logger.error("修改合同异常"+e.getLocalizedMessage(), e); logger.error("修改合同异常"+e.getLocalizedMessage(), e);
e.printStackTrace(); e.printStackTrace();
failCode.setEnode("500"); failCode.setEnode("500");
failCode.setEnode("修改异常"); failCode.setEnode("修改异常");
return failCode; return failCode;
} }
} }
@Override @Override
public Object deleteOne(String s) { public Object deleteOne(String s) {
try { try {
logger.info("=================删除合同================="); logger.info("=================删除合同=================");
//contractMapper.updateSingleContract(contractVo); //contractMapper.updateSingleContract(contractVo);
contractMapper.deleteOne(s); contractMapper.deleteOne(s);
return successCode; return successCode;
} catch (Exception e) { } catch (Exception e) {
logger.error("删除合同异常"+e.getLocalizedMessage(),e); logger.error("删除合同异常"+e.getLocalizedMessage(),e);
e.printStackTrace(); e.printStackTrace();
failCode.setEnode("500"); failCode.setEnode("500");
failCode.setEnode("删除异常"); failCode.setEnode("删除异常");
return failCode; return failCode;
} }
} }
public boolean isDelete(String s) { public boolean isDelete(String s) {
return contractMapper.isDelete(s); return contractMapper.isDelete(s);
} }
}
@Override
public Object queryList() {
// TODO Auto-generated method stub
try {
logger.info("=================查询合同编号=================");
return contractMapper.queryList();
} catch (Exception e) {
// TODO: handle exception
logger.error("查询合同列表异常"+e.getLocalizedMessage(),e);
e.printStackTrace();
failCode.setEnode("500");
failCode.setEnode("查询异常");
return failCode;
}
}
}
package com.vion.financial.service.imp; package com.vion.financial.service.imp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.vion.financial.entity.Appendix; import com.vion.financial.entity.Appendix;
import com.vion.financial.entity.DeliverGoods; import com.vion.financial.entity.DeliverGoods;
import com.vion.financial.mapper.DeliverGoodsMapper; import com.vion.financial.entity.Receipt;
import com.vion.financial.service.AppendixService; import com.vion.financial.mapper.DeliverGoodsMapper;
import com.vion.financial.service.ContractService; import com.vion.financial.service.AppendixService;
import com.vion.financial.service.DeliverGoodsService; import com.vion.financial.service.ContractService;
import com.vion.financial.vo.DeliverGoodsVo; import com.vion.financial.service.DeliverGoodsService;
import com.vion.financial.vo.FailCode; import com.vion.financial.vo.DeliverGoodsVo;
import com.vion.financial.vo.SuccessCode; import com.vion.financial.vo.FailCode;
import com.vion.financial.vo.SuccessCode;
@Service
public class DeliverGoodsServiceImpl implements DeliverGoodsService { @Service
public class DeliverGoodsServiceImpl implements DeliverGoodsService {
Logger logger = LoggerFactory.getLogger(DeliverGoodsServiceImpl.class);
@Autowired Logger logger = LoggerFactory.getLogger(DeliverGoodsServiceImpl.class);
SuccessCode successCode; @Autowired
@Autowired SuccessCode successCode;
FailCode failCode; @Autowired
@Autowired FailCode failCode;
DeliverGoodsMapper deliverGoodsMapper; @Autowired
@Autowired DeliverGoodsMapper deliverGoodsMapper;
ContractService contractService; @Autowired
@Autowired ContractService contractService;
AppendixService appendixService; @Autowired
@Override AppendixService appendixService;
public Object addDeliverGoods(DeliverGoodsVo deliverGoodsVo, String s) { @Override
// TODO Auto-generated method stub public Object addDeliverGoods(DeliverGoodsVo deliverGoodsVo, String s) {
try { // TODO Auto-generated method stub
Appendix appendix = new Appendix(); try {
logger.info("=====================增加发货信息====================="); Appendix appendix = new Appendix();
if((boolean)contractService.isDelete(s)) { logger.info("=====================增加发货信息=====================");
List<DeliverGoods> list=deliverGoodsVo.getList_deliver_data(); if((boolean)contractService.isDelete(s)) {
for(DeliverGoods deliverGoods:list) { List<DeliverGoods> list=deliverGoodsVo.getList_deliver_data();
deliverGoods.setContract_unid(s); for(DeliverGoods deliverGoods:list) {
deliverGoodsMapper.addDeliverGoods(deliverGoods); deliverGoods.setContract_unid(s);
for(int appendixUnid:deliverGoodsVo.getAppendix_unids()) { deliverGoodsMapper.addDeliverGoods(deliverGoods);
appendix.setAppendix_unid(appendixUnid); for(int appendixUnid:deliverGoods.getAppendix_unids()) {
appendix.setBusiness_table("tb_deliver_goods"); appendix.setAppendix_unid(appendixUnid);
appendix.setBusiness_unid(String.valueOf(deliverGoods.getDeliver_unid())); appendix.setBusiness_table("tb_deliver_goods");
} appendix.setBusiness_unid(String.valueOf(deliverGoods.getDeliver_unid()));
} appendixService.updateAppendix(appendix);
return successCode; }
}else { }
failCode.setEnode("100"); return successCode;
failCode.setEnode("合同已删除"); }else {
return failCode; failCode.setEnode("100");
} failCode.setEnode("合同已删除");
} catch (Exception e) { return failCode;
// TODO: handle exception }
logger.error("增加发货信息异常"+e.getLocalizedMessage(),e); } catch (Exception e) {
failCode.setEnode("500"); // TODO: handle exception
failCode.setEnode("增加异常"); logger.error("增加发货信息异常"+e.getLocalizedMessage(),e);
return failCode; failCode.setEnode("500");
} failCode.setEnode("增加异常");
} return failCode;
}
@Override }
public Object queryDeliverGoods(String s) {
try { @Override
DeliverGoodsVo deliverGoodsVo = new DeliverGoodsVo(); public Object queryDeliverGoods(String s) {
deliverGoodsVo.setList_deliver_data(new ArrayList()); try {
Appendix appendix = null; DeliverGoodsVo deliverGoodsVo = new DeliverGoodsVo();
logger.info("========================查询发货信息========================"); deliverGoodsVo.setList_deliver_data(new ArrayList());
if(contractService.isDelete(s)) { Appendix appendix = null;
List<DeliverGoods> list=deliverGoodsMapper.queryDeliverGoods(s); logger.info("========================查询发货信息========================");
for(DeliverGoods deliverGoods:list) { if(contractService.isDelete(s)) {
appendix = new Appendix(); List<DeliverGoods> list=deliverGoodsMapper.queryDeliverGoods(s);
appendix.setBusiness_table("tb_deliver_goods"); for(DeliverGoods deliverGoods:list) {
appendix.setBusiness_unid(String.valueOf(deliverGoods.getDeliver_unid())); appendix = new Appendix();
Object o = appendixService.queryAppendixList(appendix); appendix.setBusiness_table("tb_deliver_goods");
deliverGoods.setAppendix_list(o == null ? null : (List)o); appendix.setBusiness_unid(String.valueOf(deliverGoods.getDeliver_unid()));
deliverGoodsVo.getList_deliver_data().add(deliverGoods); Object o = appendixService.queryAppendixList(appendix);
} deliverGoods.setList_deliver_data(o == null ? null : (List)o);
} deliverGoodsVo.getList_deliver_data().add(deliverGoods);
else { }
failCode.setEnode("100"); }
failCode.setEnode("合同已删除"); else {
return failCode; failCode.setEnode("100");
} failCode.setEnode("合同已删除");
return deliverGoodsVo; return failCode;
} catch (Exception e) { }
// TODO: handle exception return deliverGoodsVo;
logger.error("查询发货信息异常"+e.getLocalizedMessage(),e); } catch (Exception e) {
failCode.setEnode("500"); // TODO: handle exception
failCode.setEnode("查询异常"); logger.error("查询发货信息异常"+e.getLocalizedMessage(),e);
return failCode; failCode.setEnode("500");
} failCode.setEnode("查询异常");
} return failCode;
}
@Override }
public Object updateDeliverGoods(DeliverGoodsVo deliverGoodsVo, String s) {
// TODO Auto-generated method stub @Override
try { public Object updateDeliverGoods(DeliverGoodsVo deliverGoodsVo, String s) {
logger.info("===========================修改发货信息==========================="); // TODO Auto-generated method stub
if(contractService.isDelete(s)) { try {
List<DeliverGoods> list_deliver_data=deliverGoodsVo.getList_deliver_data(); logger.info("===========================修改发货信息===========================");
for(DeliverGoods deliverGoods:list_deliver_data) { if(contractService.isDelete(s)) {
deliverGoodsMapper.updateDeliverGoods(deliverGoods); List<DeliverGoods> list_deliver_data=deliverGoodsVo.getList_deliver_data();
} for(DeliverGoods deliverGoods:list_deliver_data) {
return successCode; deliverGoodsMapper.updateDeliverGoods(deliverGoods);
}else { }
failCode.setEnode("100"); return successCode;
failCode.setEnode("合同已删除"); }else {
return failCode; failCode.setEnode("100");
} failCode.setEnode("合同已删除");
} catch (Exception e) { return failCode;
logger.error("更新发货信息异常"+e.getLocalizedMessage(),e); }
failCode.setEnode("500"); } catch (Exception e) {
failCode.setEnode("更新异常"); logger.error("更新发货信息异常"+e.getLocalizedMessage(),e);
return failCode; failCode.setEnode("500");
// TODO: handle exception failCode.setEnode("更新异常");
} return failCode;
} // TODO: handle exception
}
@Override }
public Object deleteDeliverGoods(DeliverGoodsVo deliverGoodsVo, String s) {
// TODO Auto-generated method stub @Override
return null; public Object deleteDeliverGoods(DeliverGoodsVo deliverGoodsVo, String s) {
} // TODO Auto-generated method stub
try {
} logger.info("=========================删除合同发货信息=======================");
if(contractService.isDelete(s)) {
for(int receiptUnid :deliverGoodsVo.getDeliver_unids()) {
deliverGoodsMapper.deleteDeliverGoods(receiptUnid);;
}
return successCode;
}
else {
failCode.setEnode("100");
failCode.setEnote("合同已删除");
return failCode;
}
} catch (Exception e) {
logger.error("删除发货信息异常"+e.getLocalizedMessage(),e);
failCode.setEnode("500");
failCode.setEnode("删除异常");
return failCode;
}
}
}
package com.vion.financial.vo; package com.vion.financial.vo;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.vion.financial.entity.Appendix; import com.vion.financial.entity.Appendix;
import com.vion.financial.entity.DeliverGoods; import com.vion.financial.entity.DeliverGoods;
@JsonInclude(value=Include.NON_NULL) @JsonInclude(value=Include.NON_NULL)
public class DeliverGoodsVo { public class DeliverGoodsVo {
private Integer deliver_unid; private Integer deliver_unid;
private String contract_unid; private String contract_unid;
private Date deliver_goods_date; private Date deliver_goods_date;
private Date goods_acceptanc_date; private Date goods_acceptanc_date;
List<DeliverGoods> list_deliver_data; List<DeliverGoods> list_deliver_data;
List<Integer> appendix_unids; List<Integer> deliver_unids;
public List<DeliverGoods> getList_deliver_data() { public List<DeliverGoods> getList_deliver_data() {
return list_deliver_data; return list_deliver_data;
} }
public void setList_deliver_data(List<DeliverGoods> list_deliver_data) { public void setList_deliver_data(List<DeliverGoods> list_deliver_data) {
this.list_deliver_data = list_deliver_data; this.list_deliver_data = list_deliver_data;
} }
public Integer getDeliver_unid() { public Integer getDeliver_unid() {
return deliver_unid; return deliver_unid;
} }
public void setDeliver_unid(Integer deliver_unid) { public void setDeliver_unid(Integer deliver_unid) {
this.deliver_unid = deliver_unid; this.deliver_unid = deliver_unid;
} }
public String getContract_unid() { public String getContract_unid() {
return contract_unid; return contract_unid;
} }
public void setContract_unid(String contract_unid) { public void setContract_unid(String contract_unid) {
this.contract_unid = contract_unid; this.contract_unid = contract_unid;
} }
public Date getDeliver_goods_date() { public Date getDeliver_goods_date() {
return deliver_goods_date; return deliver_goods_date;
} }
public void setDeliver_goods_date(Date deliver_goods_date) { public void setDeliver_goods_date(Date deliver_goods_date) {
this.deliver_goods_date = deliver_goods_date; this.deliver_goods_date = deliver_goods_date;
} }
public Date getGoods_acceptanc_date() { public Date getGoods_acceptanc_date() {
return goods_acceptanc_date; return goods_acceptanc_date;
} }
public void setGoods_acceptanc_date(Date goods_acceptanc_date) { public void setGoods_acceptanc_date(Date goods_acceptanc_date) {
this.goods_acceptanc_date = goods_acceptanc_date; this.goods_acceptanc_date = goods_acceptanc_date;
} }
public List<Integer> getAppendix_unids() { public List<Integer> getDeliver_unids() {
return appendix_unids; return deliver_unids;
} }
public void setAppendix_unids(List<Integer> appendix_unids) { public void setDeliver_unids(List<Integer> deliver_unids) {
this.appendix_unids = appendix_unids; this.deliver_unids = deliver_unids;
} }
}
}
server: server:
port: 8080 port: 8080
spring: spring:
thymeleaf: thymeleaf:
prefix: classpath:/templates/thymeleaf/ prefix: classpath:/templates/thymeleaf/
suffix: .html suffix: .html
mode: HTML5 mode: HTML5
encoding: UTF-8 encoding: UTF-8
cache: false cache: false
datasource: datasource:
url: jdbc:postgresql://192.168.9.162:5432/financial_serv url: jdbc:postgresql://192.168.9.162:5432/financial_serv
username: postgres username: postgres
password: authpass password: authpass
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver
hikari: hikari:
connection-timeout: 1800000 connection-timeout: 30000
maximum-pool-size: 20 maximum-pool-size: 20
# hikari: dbcp2:
# maximum-pool-size: max-total: 20
http: pool-prepared-statements: true
multipart: # hikari:
max-file-size: 20Mb # maximum-pool-size:
max-request-size: 40Mb http:
mybatis: multipart:
mapper-locations: com/vion/financial/mapping/*.xml max-file-size: 20Mb
max-request-size: 40Mb
logging: mybatis:
level: mapper-locations: com/vion/financial/mapping/*.xml
root: INFO
pattern: logging:
level: INFO level:
console: "[financial_serv]-[%d{yyyy-MM-dd HH:mm:ss.SSS}]-%m%n" root: INFO
path: F:\LOG\ pattern:
#pagehelper: level: INFO
# helperDialect: postgresql console: "[financial_serv]-[%d{yyyy-MM-dd HH:mm:ss.SSS}]-%m%n"
# reasonable: true path: F:\LOG\
# supportMethodsArguments: true #pagehelper:
# helperDialect: postgresql
# reasonable: true
# supportMethodsArguments: true
# params: count=countSql # params: count=countSql
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!