Browse Source

Merge remote-tracking branch 'origin/master'

zhanglei
yunuo970428 3 years ago
parent
commit
378f2656fa
  1. 4
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finpaymentrecord/FinPaymentrecordFeign.java
  2. 2
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finpaymentrecord/FinPaymentrecordRest.java
  3. 56
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finpaymentrecord/FinPaymentrecordService.java
  4. 18
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinbound/ScmApplyInboundService.java
  5. 16
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.java
  6. 30
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.xml
  7. 160
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleService.java

4
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finpaymentrecord/FinPaymentrecordFeign.java

@ -75,7 +75,7 @@ public interface FinPaymentrecordFeign {
ResultBean updateState(@RequestBody String[] sids);
@ApiOperation("生成预付款申请PDF")
@PostMapping("/createPdf")
@GetMapping("/createPdf")
@ResponseBody
public ResultBean<String> createPdf(@RequestParam("sid") String sid);
ResultBean createPdf(@RequestParam("sid") String sid);
}

2
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finpaymentrecord/FinPaymentrecordRest.java

@ -78,7 +78,7 @@ public class FinPaymentrecordRest implements FinPaymentrecordFeign {
}
@Override
public ResultBean<String> createPdf(String sid) {
public ResultBean createPdf(String sid) {
return finPaymentrecordService.createPdf(sid);
}
}

56
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finpaymentrecord/FinPaymentrecordService.java

@ -66,12 +66,12 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
@ -335,7 +335,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord
return rb.success();
}
public ResultBean<String> createPdf(String sid) {
public ResultBean createPdf(String sid) {
ResultBean rb = ResultBean.fireFail();
FinPaymentrecord finPaymentrecord = fetchBySid(sid);
Map<String, Object> dataMap = new HashMap<String, Object>();
@ -418,7 +418,51 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord
//生成出门证文件名
String pdfName = "预付款申请_" + dateStr + seconds + ".pdf";
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName);
return rb.success().setData(pdfName);
HttpServletResponse response = null;
try {
download(response,pdfName);
} catch (IOException e) {
e.printStackTrace();
}
return rb.success();
}
public void download(HttpServletResponse response, String path) throws IOException {
String filePath = fileUploadComponent.getUrlPrefix();
File file = null;
InputStream inputStream = null;
ServletOutputStream out = null;
if (path.indexOf(filePath) > -1) {
path = path.replace(filePath, "");
}
try {
String realPath = fileUploadComponent.getUploadPath();
file = new File(realPath + path);
inputStream = new FileInputStream(file);
response.setCharacterEncoding("utf-8");
response.setContentType("application/pdf");
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode(path, "UTF-8"));
out = response.getOutputStream();
byte[] buffer = new byte[512]; // 缓冲区
int bytesToRead = -1;
// 通过循环将读入的Excel文件的内容输出到浏览器中
while ((bytesToRead = inputStream.read(buffer)) != -1) {
out.write(buffer, 0, bytesToRead);
}
out.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null) {
inputStream.close();
}
if (out != null) {
out.close();
}
if (file != null) {
}
}
}
public static String image2Base64(String imgUrl) {

18
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinbound/ScmApplyInboundService.java

@ -253,7 +253,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
}
// 验证数据库是否重复
for (int i = 0; i < vinNoList.size(); i++) {
int count = scmApplyInboundVehicleService.checkVinNo(vinNoList.get(i));
int count = scmApplyInboundVehicleService.checkVinNo(vinNoList.get(i), dto.getSid());
BaseVehicle data = baseVehicleFeign.selectByVinNoAndOrgSid(vinNoList.get(i), dto.getUseOrgSid()).getData();
if (count != 0) {
return new ResultBean().setMsg(vinNoList.get(i) + "车架号已经存在");
@ -383,7 +383,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
if (StringUtils.isBlank(busSid)) {
Map<String, Object> variables = BeanUtil.beanToMap(dto);
ResultBean<String> resultBean = saveOrUpdateApplyInBound(dto);
if (!resultBean.getSuccess()){
if (!resultBean.getSuccess()) {
return ResultBean.fireFail().setMsg(resultBean.getMsg());
}
String businessSid = resultBean.getData().toString();
@ -461,7 +461,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
dto.setVehicleList(scmApplyInboundVehicleDtos2);
dto.setNum(String.valueOf(scmApplyInboundVehicleDtos2.size()));
ResultBean<String> stringResultBean = saveOrUpdateApplyInBound(dto);
if (!stringResultBean.getSuccess()){
if (!stringResultBean.getSuccess()) {
return ResultBean.fireFail().setMsg(stringResultBean.getMsg());
}
ResultBean<UpdateFlowFieldVo> resultBean1 = flowableFeign.startProcess(bv);
@ -472,7 +472,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
dto.setVehicleList(scmApplyInboundVehicleDtos2);
dto.setNum(String.valueOf(scmApplyInboundVehicleDtos2.size()));
ResultBean<String> stringResultBean = saveOrUpdateApplyInBound(dto);
if (!stringResultBean.getSuccess()){
if (!stringResultBean.getSuccess()) {
return ResultBean.fireFail().setMsg(stringResultBean.getMsg());
}
bv.setTaskDefKey(entity.getTaskDefKey());
@ -506,7 +506,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
ScmApplyInbound scmApplyInbound = scmApplyInboundService.fetchBySid(businessSid);
List<ScmApplyInboundVehicleDto> scmApplyInboundVehicleDtos = scmApplyInboundVehicleService.fetchByMainSid(businessSid);
ResultBean<List<String>> sids = scmVehicleExamineService.saveEntryCarInspectedInfoBatch(scmApplyInbound.getPriceDate(),
bv.getUserSid(),booad,businessSid,scmApplyInboundVehicleDtos);
bv.getUserSid(), booad, businessSid, scmApplyInboundVehicleDtos);
saveItem(sids);
newBaseVehicleDto(booad, scmApplyInboundVehicleDtos);
// 入账审批通关修改采购订单状态 state = 1
@ -547,9 +547,9 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
baseVehicleDto.setManufSaleAccessName(aaodd.getActualPay());
//厂家回款通路类别key
ResultBean<BaseManufacturerBankVo> baseManufacturerBankVoResultBean = baseManufacturerBankFeign.details(aaodd.getActualSid());
if(baseManufacturerBankVoResultBean.getSuccess()){
if (baseManufacturerBankVoResultBean.getSuccess()) {
BaseManufacturerBankVo baseManufacturerBankVo = baseManufacturerBankVoResultBean.getData();
if(baseManufacturerBankVo != null){
if (baseManufacturerBankVo != null) {
baseVehicleDto.setManufSaleAccessKey(baseManufacturerBankVo.getActualPayKey());
//付款通路code
baseVehicleDto.setPaymentAccessNoKey(baseManufacturerBankVo.getPaymentAccessNoKey());
@ -593,11 +593,11 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
baseVehicleDto.setManPurOrderTypeValue(booad.getManPurOrderTypeValue());
//存放地点
ScmWarehouseVo scmWarehouseVo = scmWarehouseService.selectByGressionCode(booad.getUseOrgSid());
if (scmWarehouseVo == null){
if (scmWarehouseVo == null) {
baseVehicleDto.setLocation("");
baseVehicleDto.setLocationName("");
baseVehicleDto.setLocationCode("");
}else {
} else {
baseVehicleDto.setLocation(scmWarehouseVo.getSid());
baseVehicleDto.setLocationName(scmWarehouseVo.getWarehouseName());
baseVehicleDto.setLocationCode(scmWarehouseVo.getGressionCode());

16
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.java

@ -29,15 +29,15 @@ import java.util.List;
@Mapper
public interface ScmApplyInboundVehicleMapper extends BaseMapper<ScmApplyInboundVehicle> {
//@Update("update scm_apply_inbound_vehicle set name=#{msg} where id=#{id}")
//IPage<ScmApplyInboundVehicleVo> voPage(IPage<ScmApplyInboundVehicle> page, @Param(Constants.WRAPPER) QueryWrapper<ScmApplyInboundVehicle> qw);
IPage<ScmApplyInboundVehicleVo> selectPageVo(IPage<ScmApplyInboundVehicle> page, @Param(Constants.WRAPPER) Wrapper<ScmApplyInboundVehicle> qw);
int checkVinNo(@Param("vinNo") String vinNo);
//@Update("update scm_apply_inbound_vehicle set name=#{msg} where id=#{id}")
//IPage<ScmApplyInboundVehicleVo> voPage(IPage<ScmApplyInboundVehicle> page, @Param(Constants.WRAPPER) QueryWrapper<ScmApplyInboundVehicle> qw);
List<ScmApplyInboundVehicleVo> selectListByAppSid(@Param("applySid") String applySid);
IPage<ScmApplyInboundVehicleVo> selectPageVo(IPage<ScmApplyInboundVehicle> page, @Param(Constants.WRAPPER) Wrapper<ScmApplyInboundVehicle> qw);
@Select("select * from scm_apply_inbound_vehicle where applySid = #{businessSid}")
int checkVinNo(@Param("vinNo") String vinNo, @Param("mainSid") String mainSid);
List<ScmApplyInboundVehicleVo> selectListByAppSid(@Param("applySid") String applySid);
@Select("select * from scm_apply_inbound_vehicle where applySid = #{businessSid}")
List<ScmApplyInboundVehicleDto> fetchByMainSid(String businessSid);
}

30
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.xml

@ -1,17 +1,25 @@
<?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">
<mapper namespace="com.yxt.anrui.scm.biz.scmapplyinboundvehicle.ScmApplyInboundVehicleMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.anrui.scm.api.scmapplyinboundvehicle.ScmApplyInboundVehicleVo">
SELECT * FROM scm_apply_inbound_vehicle <where> ${ew.sqlSegment} </where>
</select>
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.anrui.scm.api.scmapplyinboundvehicle.ScmApplyInboundVehicleVo">
SELECT * FROM scm_apply_inbound_vehicle
<where>
${ew.sqlSegment}
</where>
</select>
<select id="checkVinNo" resultType="int">
SELECT count(1) FROM scm_apply_inbound_vehicle WHERE vinNo=#{vinNo}
</select>
<select id="checkVinNo" resultType="int">
SELECT count(1)
FROM scm_apply_inbound_vehicle
WHERE vinNo = #{vinNo}
AND applySid != #{mainSid}
</select>
<select id="selectListByAppSid" resultType="com.yxt.anrui.scm.api.scmapplyinboundvehicle.ScmApplyInboundVehicleVo">
SELECT * FROM scm_apply_inbound_vehicle WHERE applySid=#{applySid}
</select>
<select id="selectListByAppSid" resultType="com.yxt.anrui.scm.api.scmapplyinboundvehicle.ScmApplyInboundVehicleVo">
SELECT *
FROM scm_apply_inbound_vehicle
WHERE applySid = #{applySid}
</select>
</mapper>

160
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleService.java

@ -34,89 +34,95 @@ import java.util.List;
*/
@Service
public class ScmApplyInboundVehicleService extends MybatisBaseService<ScmApplyInboundVehicleMapper, ScmApplyInboundVehicle> {
public PagerVo<ScmApplyInboundVehicle> listPage(PagerQuery<ScmApplyInboundVehicleQuery> pq) {
ScmApplyInboundVehicleQuery query = pq.getParams();
QueryWrapper<ScmApplyInboundVehicle> qw = createQueryWrapper(query);
IPage<ScmApplyInboundVehicle> page = PagerUtil.queryToPage(pq);
IPage<ScmApplyInboundVehicle> pagging = baseMapper.selectPage(page, qw);
PagerVo<ScmApplyInboundVehicle> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public List<ScmApplyInboundVehicle> listAll(ScmApplyInboundVehicleQuery query) {
QueryWrapper<ScmApplyInboundVehicle> qw = createQueryWrapper(query);
return baseMapper.selectList(qw);
}
private QueryWrapper<ScmApplyInboundVehicle> createQueryWrapper(ScmApplyInboundVehicleQuery query) {
// todo: 这里根据具体业务调整查询条件
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
QueryWrapper<ScmApplyInboundVehicle> qw = new QueryWrapper<>();
public PagerVo<ScmApplyInboundVehicle> listPage(PagerQuery<ScmApplyInboundVehicleQuery> pq) {
ScmApplyInboundVehicleQuery query = pq.getParams();
QueryWrapper<ScmApplyInboundVehicle> qw = createQueryWrapper(query);
IPage<ScmApplyInboundVehicle> page = PagerUtil.queryToPage(pq);
IPage<ScmApplyInboundVehicle> pagging = baseMapper.selectPage(page, qw);
PagerVo<ScmApplyInboundVehicle> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public List<ScmApplyInboundVehicle> listAll(ScmApplyInboundVehicleQuery query) {
QueryWrapper<ScmApplyInboundVehicle> qw = createQueryWrapper(query);
return baseMapper.selectList(qw);
}
if (StringUtils.isNotBlank(query.getModelSid())) {
qw.eq("modelSid", query.getModelSid());
}
private QueryWrapper<ScmApplyInboundVehicle> createQueryWrapper(ScmApplyInboundVehicleQuery query) {
// todo: 这里根据具体业务调整查询条件
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
QueryWrapper<ScmApplyInboundVehicle> qw = new QueryWrapper<>();
if (StringUtils.isNotBlank(query.getVinNo())) {
qw.eq("vinNo", query.getVinNo());
}
return qw;
}
public PagerVo<ScmApplyInboundVehicleVo> listPageVo(PagerQuery<ScmApplyInboundVehicleQuery> pq) {
ScmApplyInboundVehicleQuery query = pq.getParams();
QueryWrapper<ScmApplyInboundVehicle> qw = createQueryWrapper(query);
IPage<ScmApplyInboundVehicle> page = PagerUtil.queryToPage(pq);
IPage<ScmApplyInboundVehicleVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<ScmApplyInboundVehicleVo> p = PagerUtil.pageToVo(pagging, null);
return p;
}
/**
* 验证车架号是否重复
* @return
*/
public int checkVinNo(String vinNo) {
return baseMapper.checkVinNo(vinNo);
}
if (StringUtils.isNotBlank(query.getModelSid())) {
qw.eq("modelSid", query.getModelSid());
}
/**
* 保存车辆列表
* @param list
* @param applySid
* @param modelSid
*/
public void saveApplyInboundVehicleList(List<ScmApplyInboundVehicleDto> list, String applySid, String modelSid) {
for (ScmApplyInboundVehicleDto dto : list) {
ScmApplyInboundVehicle inboundVehicle = new ScmApplyInboundVehicle();
BeanUtil.copyProperties(dto, inboundVehicle);
inboundVehicle.setApplySid(applySid);
inboundVehicle.setModelSid(modelSid);
save(inboundVehicle);
}
}
if (StringUtils.isNotBlank(query.getVinNo())) {
qw.eq("vinNo", query.getVinNo());
}
return qw;
}
/**
* 修改车辆列表
* @param list
*/
public void updateApplyInboundVehicleList(List<ScmApplyInboundVehicleDto> list) {
for (ScmApplyInboundVehicleDto dto : list) {
ScmApplyInboundVehicle inboundVehicle = fetchBySid(dto.getSid());
BeanUtil.copyProperties(dto, inboundVehicle);
updateById(inboundVehicle);
}
}
public PagerVo<ScmApplyInboundVehicleVo> listPageVo(PagerQuery<ScmApplyInboundVehicleQuery> pq) {
ScmApplyInboundVehicleQuery query = pq.getParams();
QueryWrapper<ScmApplyInboundVehicle> qw = createQueryWrapper(query);
IPage<ScmApplyInboundVehicle> page = PagerUtil.queryToPage(pq);
IPage<ScmApplyInboundVehicleVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<ScmApplyInboundVehicleVo> p = PagerUtil.pageToVo(pagging, null);
return p;
}
/**
* 根据车辆入账单查询车辆信息
* @param applySid
* @return
*/
public List<ScmApplyInboundVehicleVo> selectListByAppSid(String applySid) {
return baseMapper.selectListByAppSid(applySid);
}
/**
* 验证车架号是否重复
*
* @return
*/
public int checkVinNo(String vinNo, String mainSid) {
return baseMapper.checkVinNo(vinNo, mainSid);
}
public List<ScmApplyInboundVehicleDto> fetchByMainSid(String businessSid) {
return baseMapper.fetchByMainSid(businessSid);
}
/**
* 保存车辆列表
*
* @param list
* @param applySid
* @param modelSid
*/
public void saveApplyInboundVehicleList(List<ScmApplyInboundVehicleDto> list, String applySid, String modelSid) {
for (ScmApplyInboundVehicleDto dto : list) {
ScmApplyInboundVehicle inboundVehicle = new ScmApplyInboundVehicle();
BeanUtil.copyProperties(dto, inboundVehicle);
inboundVehicle.setApplySid(applySid);
inboundVehicle.setModelSid(modelSid);
save(inboundVehicle);
}
}
/**
* 修改车辆列表
*
* @param list
*/
public void updateApplyInboundVehicleList(List<ScmApplyInboundVehicleDto> list) {
for (ScmApplyInboundVehicleDto dto : list) {
ScmApplyInboundVehicle inboundVehicle = fetchBySid(dto.getSid());
BeanUtil.copyProperties(dto, inboundVehicle);
updateById(inboundVehicle);
}
}
/**
* 根据车辆入账单查询车辆信息
*
* @param applySid
* @return
*/
public List<ScmApplyInboundVehicleVo> selectListByAppSid(String applySid) {
return baseMapper.selectListByAppSid(applySid);
}
public List<ScmApplyInboundVehicleDto> fetchByMainSid(String businessSid) {
return baseMapper.fetchByMainSid(businessSid);
}
}
Loading…
Cancel
Save