Commit d87be0a2 by 王军业

21254521

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