Commit d87be0a2 by 王军业

21254521

1 parent ff2cb3ae
...@@ -35,11 +35,15 @@ public class AppendixController extends BaseController{ ...@@ -35,11 +35,15 @@ public class AppendixController extends BaseController{
@Resource @Resource
AppendixService AppendixService; AppendixService AppendixService;
//新增
@PostMapping(value="/{contract_unid}/upload/appendixes") @PostMapping(value="/{contract_unid}/upload/appendixes")
@ResponseBody @ResponseBody
public Object upload( AppendixVo appendixVo) { public Object upload( AppendixVo appendixVo) {
return AppendixService.upload(appendixVo); return AppendixService.upload(appendixVo);
} }
//修改
@PutMapping(value="/{contract_unid}/upload/appendixes") @PutMapping(value="/{contract_unid}/upload/appendixes")
@ResponseBody @ResponseBody
public Object update(@RequestBody Appendix appendix) { public Object update(@RequestBody Appendix appendix) {
......
...@@ -11,6 +11,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter ...@@ -11,6 +11,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@RequestMapping(value="/api/v1/financial/contracts") @RequestMapping(value="/api/v1/financial/contracts")
public class BaseController extends WebMvcConfigurerAdapter { public class BaseController extends WebMvcConfigurerAdapter {
@Override @Override
/**
* 解决跨域问题
*/
public void addCorsMappings(CorsRegistry corsRegistry) { public void addCorsMappings(CorsRegistry corsRegistry) {
corsRegistry.addMapping("/api/v1/financial/contracts/**") corsRegistry.addMapping("/api/v1/financial/contracts/**")
.allowedOrigins("*") .allowedOrigins("*")
......
...@@ -9,8 +9,10 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -9,8 +9,10 @@ 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.RequestParam;
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 org.springframework.web.multipart.MultipartFile;
import com.vion.financial.service.ContractService; import com.vion.financial.service.ContractService;
import com.vion.financial.vo.ContractVo; import com.vion.financial.vo.ContractVo;
...@@ -65,4 +67,10 @@ public class ContractController extends BaseController { ...@@ -65,4 +67,10 @@ public class ContractController extends BaseController {
public void downLoadExcel(SelectVo selectVo,HttpServletResponse response) { public void downLoadExcel(SelectVo selectVo,HttpServletResponse response) {
contractService.exportExcel(selectVo, response); contractService.exportExcel(selectVo, response);
} }
@PostMapping(value="/import")
@ResponseBody
public Object importExcel(@RequestParam("file") MultipartFile file) {
return contractService.importExcel(file);
}
} }
...@@ -9,4 +9,5 @@ public interface CustomerMapper { ...@@ -9,4 +9,5 @@ public interface CustomerMapper {
public List<Customer> queryCustomer(); public List<Customer> queryCustomer();
public void updateCustomer(Customer customer); public void updateCustomer(Customer customer);
public void deleteCustomer(int n); public void deleteCustomer(int n);
public Customer selectByName(String name);
} }
...@@ -9,4 +9,5 @@ public interface ProjectMapper { ...@@ -9,4 +9,5 @@ public interface ProjectMapper {
public List<Project> queryProject(); public List<Project> queryProject();
public void updateProject(Project project); public void updateProject(Project project);
public void deleteProject(int n); public void deleteProject(int n);
public Project selectByName(String name);
} }
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
,deduct_amount ,deduct_amount
</if> </if>
<if test="contract_amount_note != null and contract_amount_note != ''"> <if test="contract_amount_note != null and contract_amount_note != ''">
,contract_type ,contract_amount_note
</if> </if>
<if test="stop_amount != null "> <if test="stop_amount != null ">
,stop_amount ,stop_amount
...@@ -86,6 +86,15 @@ ...@@ -86,6 +86,15 @@
<if test="customer_unid != null and customer_unid != ''"> <if test="customer_unid != null and customer_unid != ''">
,customer_unid ,customer_unid
</if> </if>
<if test="province_name !=null and province_name !=''">
,province_name
</if>
<if test="city_name !=null and city_name !=''">
,city_name
</if>
<if test="county_name !=null and county_name !=''">
,county_name
</if>
) VALUES( ) VALUES(
#{contract_unid} #{contract_unid}
<if test="salesperson_unid != null and salesperson_unid != ''"> <if test="salesperson_unid != null and salesperson_unid != ''">
...@@ -104,7 +113,7 @@ ...@@ -104,7 +113,7 @@
,#{guarantee_period} ,#{guarantee_period}
</if> </if>
<if test="sign_date != null "> <if test="sign_date != null ">
,{sign_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler} ,#{sign_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler}
</if> </if>
<if test="product_line_type != null and product_line_type != ''"> <if test="product_line_type != null and product_line_type != ''">
,#{product_line_type} ,#{product_line_type}
...@@ -122,7 +131,7 @@ ...@@ -122,7 +131,7 @@
,#{deduct_amount} ,#{deduct_amount}
</if> </if>
<if test="contract_amount_note != null and contract_amount_note != ''"> <if test="contract_amount_note != null and contract_amount_note != ''">
,#{contract_type} ,#{contract_amount_note}
</if> </if>
<if test="stop_amount != null "> <if test="stop_amount != null ">
,#{stop_amount} ,#{stop_amount}
...@@ -170,6 +179,15 @@ ...@@ -170,6 +179,15 @@
<if test="customer_unid != null and customer_unid != ''"> <if test="customer_unid != null and customer_unid != ''">
,#{customer_unid} ,#{customer_unid}
</if> </if>
<if test="province_name !=null and province_name !=''">
,#{province_name}
</if>
<if test="city_name !=null and city_name !=''">
,#{city_name}
</if>
<if test="county_name !=null and county_name !=''">
,#{county_name}
</if>
) )
</insert> </insert>
...@@ -524,6 +542,10 @@ ...@@ -524,6 +542,10 @@
and and
contract_unid in (select receive_amount_view.contract_unid from receive_amount_view where receive_amount_view.leave_amount_point <![CDATA[<=]]> #{leave_amount_end_point}) contract_unid in (select receive_amount_view.contract_unid from receive_amount_view where receive_amount_view.leave_amount_point <![CDATA[<=]]> #{leave_amount_end_point})
</if> </if>
<if test="salesperson_unid !=null and salesperson_unid !=''">
and
salesperson_unid = #{salesperson_unid}
</if>
and is_delete=false and is_delete=false
and project_unid is not null and project_unid is not null
and customer_unid is not null and customer_unid is not null
......
...@@ -14,4 +14,7 @@ ...@@ -14,4 +14,7 @@
<delete id="deleteCustomer" parameterType="int"> <delete id="deleteCustomer" parameterType="int">
delete from tb_customer where customer_unid = #{customer_unid} delete from tb_customer where customer_unid = #{customer_unid}
</delete> </delete>
<select id="selectByName" parameterType="String" resultType="com.vion.financial.entity.Customer">
select * from tb_customer where customer_name = #{customer_name}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -14,4 +14,7 @@ ...@@ -14,4 +14,7 @@
<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>
<select id="selectByName" parameterType="String" resultType="com.vion.financial.entity.Project">
select * from tb_project where project_name=#{project_name}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,8 @@ package com.vion.financial.service; ...@@ -2,6 +2,8 @@ package com.vion.financial.service;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;
import com.vion.financial.vo.ContractVo; import com.vion.financial.vo.ContractVo;
import com.vion.financial.vo.SelectVo; import com.vion.financial.vo.SelectVo;
...@@ -14,4 +16,5 @@ public interface ContractService { ...@@ -14,4 +16,5 @@ public interface ContractService {
Boolean isDelete(String s); Boolean isDelete(String s);
public Object selectByCondition(SelectVo selectVo); public Object selectByCondition(SelectVo selectVo);
public void exportExcel(SelectVo selectVo,HttpServletResponse response); public void exportExcel(SelectVo selectVo,HttpServletResponse response);
public Object importExcel(MultipartFile file);
} }
...@@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; ...@@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
@JsonInclude(value=Include.NON_NULL) @JsonInclude(value=Include.NON_NULL)
public class SelectVo { public class SelectVo {
private String contract_unid; private String contract_unid;
private String salesperson_unid; //销售员id
private String salesperson_name__like; //销售员name,模糊查询 private String salesperson_name__like; //销售员name,模糊查询
private String project_name__like; //工程name,模糊查询 private String project_name__like; //工程name,模糊查询
private String customer_name__like; //客户name,模糊查询 private String customer_name__like; //客户name,模糊查询
...@@ -212,6 +213,12 @@ public class SelectVo { ...@@ -212,6 +213,12 @@ public class SelectVo {
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 String getSalesperson_unid() {
return salesperson_unid;
}
public void setSalesperson_unid(String salesperson_unid) {
this.salesperson_unid = salesperson_unid;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!