Commit 1a724108 by 王军业

[修改合同]

1 parent 0dd46a5a
...@@ -8,6 +8,8 @@ import org.springframework.stereotype.Component; ...@@ -8,6 +8,8 @@ import org.springframework.stereotype.Component;
public class FinanceConfig { public class FinanceConfig {
private String authurl; private String authurl;
private String appendsavepath;
private String appendurl;
public String getAuthurl() { public String getAuthurl() {
return authurl; return authurl;
...@@ -17,4 +19,21 @@ public class FinanceConfig { ...@@ -17,4 +19,21 @@ public class FinanceConfig {
this.authurl = authurl; this.authurl = authurl;
} }
public String getAppendsavepath() {
return appendsavepath;
}
public void setAppendsavepath(String appendsavepath) {
this.appendsavepath = appendsavepath;
}
public String getAppendurl() {
return appendurl;
}
public void setAppendurl(String appendurl) {
this.appendurl = appendurl;
}
} }
...@@ -36,39 +36,6 @@ public class AppendixController extends BaseController{ ...@@ -36,39 +36,6 @@ public class AppendixController extends BaseController{
@PostMapping(value="/{contract_unid}/upload/appendixes") @PostMapping(value="/{contract_unid}/upload/appendixes")
@ResponseBody @ResponseBody
public Object upload(AppendixVo appendixVo) { public Object upload(AppendixVo appendixVo) {
try { return AppendixService.upload(appendixVo);
Appendix appendix = null;
List<Appendix> list=new ArrayList<Appendix> ();
MultipartFile[] appendix_files=appendixVo.getAppendix_files();
for (MultipartFile multipartFile : appendix_files) {
appendix = new Appendix();
appendix.setAppendix_name(multipartFile.getOriginalFilename());
appendix.setBusiness_table(appendixVo.getBusiness_table());
String suffix = appendix.getAppendix_name().substring(appendix.getAppendix_name().lastIndexOf(".") + 1);
appendix.setAppendix_type(suffix);
appendix.setAppendix_url("E:\\"+multipartFile.getOriginalFilename());
AppendixService.addAppendix(appendix);
list.add(appendix);
InputStream inputStream = multipartFile.getInputStream();
File file = new File("E:\\"+multipartFile.getOriginalFilename());
OutputStream os = new FileOutputStream(file);
byte[] read = new byte[2048];
int off=0;
while((off=inputStream.read(read)) != -1) {
os.write(read);
}
os.flush();
os.close();
inputStream.close();
}
return list;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
failCode.setEcode("500");
failCode.setEnote("上传异常");
return failCode;
}
} }
} }
...@@ -190,91 +190,94 @@ ...@@ -190,91 +190,94 @@
from tb_contract where contract_unid = #{contract_unid} from tb_contract where contract_unid = #{contract_unid}
</select> </select>
<update id="updateOne" parameterType="com.vion.financial.vo.ContractVo"> <update id="updateOne" parameterType="com.vion.financial.vo.ContractVo">
update tb_contract set update tb_contract
<set>
<if test="salesperson_unid != null and salesperson_unid != ''"> <if test="salesperson_unid != null and salesperson_unid != ''">
salesperson_unid=#{salesperson_unid} salesperson_unid=#{salesperson_unid},
</if> </if>
<if test="province != null and province != ''"> <if test="province != null and province != ''">
,province=#{province} province=#{province},
</if> </if>
<if test="city !=null and city != ''"> <if test="city !=null and city != ''">
, city=#{city} city=#{city},
</if> </if>
<if test="county != null and county != ''"> <if test="county != null and county != ''">
,county=#{county} county=#{county},
</if> </if>
<if test="guarantee_period != null and guarantee_period != ''"> <if test="guarantee_period != null and guarantee_period != ''">
,guarantee_period=#{guarantee_period} guarantee_period=#{guarantee_period},
</if> </if>
<if test="sign_date != null and sign_date != ''"> <if test="sign_date != null and sign_date != ''">
,sign_date=#{sign_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler} sign_date=#{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} product_line_type=#{product_line_type},
</if> </if>
<if test="contract_state != null and contract_state != ''"> <if test="contract_state != null and contract_state != ''">
,contract_state=#{contract_state} contract_state=#{contract_state},
</if> </if>
<if test="contract_type != null and contract_type != ''"> <if test="contract_type != null and contract_type != ''">
,contract_type=#{contract_type} contract_type=#{contract_type},
</if> </if>
<if test="contract_amount != null and contract_amount != ''"> <if test="contract_amount != null and contract_amount != ''">
,contract_amount=#{contract_amount} contract_amount=#{contract_amount},
</if> </if>
<if test="deduct_amount != null and deduct_amount != ''"> <if test="deduct_amount != null and deduct_amount != ''">
,deduct_amount=#{deduct_amount} 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_type} contract_type=#{contract_type},
</if> </if>
<if test="stop_amount != null and stop_amount != ''"> <if test="stop_amount != null and stop_amount != ''">
,stop_amount=#{stop_amount} stop_amount=#{stop_amount},
</if> </if>
<if test="reback_note != null and reback_note != ''"> <if test="reback_note != null and reback_note != ''">
,reback_note=#{reback_note} reback_note=#{reback_note},
</if> </if>
<if test="exemptions_amount != null and exemptions_amount != ''"> <if test="exemptions_amount != null and exemptions_amount != ''">
,exemptions_amount=#{exemptions_amount} exemptions_amount=#{exemptions_amount},
</if> </if>
<if test="contract_remain_note != null and contract_remain_note != ''"> <if test="contract_remain_note != null and contract_remain_note != ''">
,contract_remain_note=#{contract_remain_note} contract_remain_note=#{contract_remain_note},
</if> </if>
<if test="is_archive != null and is_archive != ''"> <if test="is_archive != null and is_archive != ''">
,is_archive=#{is_archive} is_archive=#{is_archive},
</if> </if>
<if test="bad_amount != null and bad_amount != ''"> <if test="bad_amount != null and bad_amount != ''">
,bad_amount=#{bad_amount} bad_amount=#{bad_amount},
</if> </if>
<if test="bad_amount_note != null and bad_amount_note != ''"> <if test="bad_amount_note != null and bad_amount_note != ''">
,bad_amount_note=#{bad_amount_note} bad_amount_note=#{bad_amount_note},
</if> </if>
<if test="confirm_income_amount != null and confirm_income_amount != ''"> <if test="confirm_income_amount != null and confirm_income_amount != ''">
,confirm_income_amount=#{confirm_income_amount} confirm_income_amount=#{confirm_income_amount},
</if> </if>
<if test="amount_state_unid != null and amount_state_unid != ''"> <if test="amount_state_unid != null and amount_state_unid != ''">
,amount_state_unid=#{amount_state_unid} amount_state_unid=#{amount_state_unid},
</if> </if>
<if test="start_guarantee_date != null "> <if test="start_guarantee_date != null ">
,start_guarantee_date=#{start_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler} start_guarantee_date=#{start_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if> </if>
<if test="end_guarantee_date != null "> <if test="end_guarantee_date != null ">
,end_guarantee_date=#{end_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler} end_guarantee_date=#{end_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if> </if>
<if test="mainten_start_point != null and mainten_start_point != ''"> <if test="mainten_start_point != null and mainten_start_point != ''">
,mainten_start_point=#{mainten_start_point} mainten_start_point=#{mainten_start_point},
</if> </if>
<if test="contract_note != null and contract_note != ''"> <if test="contract_note != null and contract_note != ''">
,contract_note=#{contract_note} contract_note=#{contract_note},
</if> </if>
<if test="is_delete != null and is_delete != ''"> <if test="is_delete != null and is_delete != ''">
,is_delete=#{is_delete} is_delete=#{is_delete},
</if> </if>
<if test="project_unid != null and project_unid != ''"> <if test="project_unid != null and project_unid != ''">
,project_unid=#{project_unid} project_unid=#{project_unid},
</if> </if>
<if test="customer_unid != null and customer_unid != ''"> <if test="customer_unid != null and customer_unid != ''">
,customer_unid=#{customer_unid} customer_unid=#{customer_unid}
</if> </if>
</set>
where contract_unid=#{contract_unid} where contract_unid=#{contract_unid}
</update> </update>
<delete id="deleteOne" parameterType="java.lang.String"> <delete id="deleteOne" parameterType="java.lang.String">
......
package com.vion.financial.service; package com.vion.financial.service;
import java.util.List; import java.util.List;
import com.vion.financial.entity.Appendix; import com.vion.financial.entity.Appendix;
import com.vion.financial.vo.AppendixVo;
public interface AppendixService {
public Object queryAppendixList(Appendix appendix); public interface AppendixService {
public Object addAppendix(Appendix appendix); public Object queryAppendixList(Appendix appendix);
public Object updateAppendix(Appendix appendix); public Object addAppendix(Appendix appendix);
public Object deleteAppendix(Appendix appendix); public Object updateAppendix(Appendix appendix);
} public Object deleteAppendix(Appendix appendix);
public Object upload(AppendixVo appendixVo);
}
package com.vion.financial.service.imp; package com.vion.financial.service.imp;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
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 org.springframework.web.multipart.MultipartFile;
import com.vion.financial.config.FinanceConfig;
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.service.AppendixService; import com.vion.financial.service.AppendixService;
import com.vion.financial.vo.AppendixVo;
import com.vion.financial.vo.FailCode; import com.vion.financial.vo.FailCode;
import com.vion.financial.vo.SuccessCode; import com.vion.financial.vo.SuccessCode;
...@@ -23,6 +31,8 @@ public class AppendixServiceImpl implements AppendixService { ...@@ -23,6 +31,8 @@ public class AppendixServiceImpl implements AppendixService {
FailCode failCode; FailCode failCode;
@Autowired @Autowired
SuccessCode successCode; SuccessCode successCode;
@Autowired
FinanceConfig financeConfig;
@Override @Override
public Object queryAppendixList(Appendix appendix) { public Object queryAppendixList(Appendix appendix) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
...@@ -89,4 +99,42 @@ public class AppendixServiceImpl implements AppendixService { ...@@ -89,4 +99,42 @@ public class AppendixServiceImpl implements AppendixService {
} }
} }
public Object upload(AppendixVo appendixVo) {
try {
Appendix appendix = null;
List<Appendix> list=new ArrayList<Appendix> ();
MultipartFile[] appendix_files=appendixVo.getAppendix_files();
for (MultipartFile multipartFile : appendix_files) {
appendix = new Appendix();
appendix.setAppendix_name(multipartFile.getOriginalFilename());
appendix.setBusiness_table(appendixVo.getBusiness_table());
String suffix = appendix.getAppendix_name().substring(appendix.getAppendix_name().lastIndexOf(".") + 1);
appendix.setAppendix_type(suffix);
appendix.setAppendix_url("E:\\"+multipartFile.getOriginalFilename());
addAppendix(appendix);
list.add(appendix);
InputStream inputStream = multipartFile.getInputStream();
File file = new File("E:\\"+multipartFile.getOriginalFilename());
OutputStream os = new FileOutputStream(file);
byte[] read = new byte[2048];
int off=0;
while((off=inputStream.read(read)) != -1) {
os.write(read);
}
os.flush();
os.close();
inputStream.close();
}
return list;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
failCode.setEcode("500");
failCode.setEnote("上传异常");
return failCode;
}
}
} }
...@@ -45,8 +45,8 @@ logging: ...@@ -45,8 +45,8 @@ logging:
finance: finance:
authurl: http://192.168.9.162:20080/api/v1/auth/users authurl: http://192.168.9.162:20080/api/v1/auth/users
appendsavepath: appendsavepath: /data/face-web/www/static/pics/cache/finance
appendurl: http://192.168.9.162:20080/ appendurl: http://192.168.9.162:20080/static/pics/cache/finance/
#pagehelper: #pagehelper:
# helperDialect: postgresql # helperDialect: postgresql
# reasonable: true # reasonable: true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!