|
|
|
@ -7,6 +7,7 @@ import com.dxhy.order.baseservice.annotation.SysLog; |
|
|
|
|
import com.dxhy.order.baseservice.config.BaseServiceConfig; |
|
|
|
|
import com.dxhy.order.baseservice.module.base.service.ExcelReadService; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntityDetail; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerImportExcel; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerImportExcelEnum; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.service.BuyerService; |
|
|
|
@ -34,6 +35,7 @@ import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 购方信息控制层 |
|
|
|
@ -146,9 +148,34 @@ public class BuyerController { |
|
|
|
|
@ApiOperation(value = "购方信息批量保存", notes = "购方信息管理-购方信息批量保存") |
|
|
|
|
@PostMapping("/saveBuyerInfoList") |
|
|
|
|
public R saveBuyerInfoList(@RequestBody List<BuyerEntity> buyerList) { |
|
|
|
|
//todo 更新订单购方信息
|
|
|
|
|
OrderInfo orderInfo = new OrderInfo(); |
|
|
|
|
//orderInfoService.updateOrderInfoByOrderId();
|
|
|
|
|
|
|
|
|
|
if(buyerList != null && buyerList.size()==1){ |
|
|
|
|
BuyerEntity buyerEntity = buyerList.get(0); |
|
|
|
|
if(StringUtils.isBlank(buyerEntity.getDeptId())){ |
|
|
|
|
return R.error("请求参数有误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(buyerEntity.getSynchronizeOrders()){ |
|
|
|
|
|
|
|
|
|
OrderInfo orderInfo = new OrderInfo(); |
|
|
|
|
orderInfo.setGhfMc(StringUtils.isBlank(buyerEntity.getTaxpayerCode())?null:buyerEntity.getTaxpayerCode()); |
|
|
|
|
orderInfo.setGhfNsrsbh(StringUtils.isBlank(buyerEntity.getPurchaseName())?null:buyerEntity.getPurchaseName()); |
|
|
|
|
if(buyerEntity.getBuyerEntityDetail() != null && buyerEntity.getBuyerEntityDetail().size() > 0 ){ |
|
|
|
|
buyerEntity.getBuyerEntityDetail().forEach(t->{ |
|
|
|
|
if("0".equals(t.getDefaultMark())){ |
|
|
|
|
orderInfo.setGhfDz(StringUtils.isBlank(buyerEntity.getAddress())?null:buyerEntity.getAddress()); |
|
|
|
|
orderInfo.setGhfDh(StringUtils.isBlank(buyerEntity.getPhone())?null:buyerEntity.getPhone()); |
|
|
|
|
orderInfo.setGhfYh(StringUtils.isBlank(buyerEntity.getBankOfDeposit())?null:buyerEntity.getBankOfDeposit()); |
|
|
|
|
orderInfo.setGhfZh(StringUtils.isBlank(buyerEntity.getBankNumber())?null:buyerEntity.getBankNumber()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
orderInfo.setEntId(buyerEntity.getDeptId()); |
|
|
|
|
orderInfo.setGhfSj(StringUtils.isBlank(buyerEntity.getSjh())?null:buyerEntity.getSjh()); |
|
|
|
|
orderInfo.setGhfEmail(StringUtils.isBlank(buyerEntity.getEmail())?null:buyerEntity.getEmail()); |
|
|
|
|
orderInfoService.updateOrderBuyerInfo(orderInfo,null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 业务逻辑放到provider
|
|
|
|
|
return buyerService.saveBuyerInfoList(buyerList, |
|
|
|
|
userInfoService.getUser().getUserId() == null ? "" : String.valueOf(userInfoService.getUser().getUserId())); |
|
|
|
@ -186,7 +213,8 @@ public class BuyerController { |
|
|
|
|
@ApiParam(name = "xhfDh", value = "销货方电话", required = true) @RequestParam(value = "xhfDh") String xhfDh, |
|
|
|
|
@ApiParam(name = "xhfZh", value = "销货方账号", required = true) @RequestParam(value = "xhfZh") String xhfZh, |
|
|
|
|
@ApiParam(name = "xhfNsrsbh", value = "销货方纳税人识别号", required = true) @RequestParam(value = "xhfNsrsbh") String xhfNsrsbh, |
|
|
|
|
@ApiParam(name = "xhfMc", value = "销货方纳税人名称", required = true) @RequestParam(value = "xhfMc") String xhfMc) { |
|
|
|
|
@ApiParam(name = "xhfMc", value = "销货方纳税人名称", required = true) @RequestParam(value = "xhfMc") String xhfMc, |
|
|
|
|
@ApiParam(name = "entId", value = "销货deptid", required = true) @RequestParam(value = "entId") String entId) { |
|
|
|
|
|
|
|
|
|
R r = new R(); |
|
|
|
|
try { |
|
|
|
@ -243,6 +271,7 @@ public class BuyerController { |
|
|
|
|
//购方名称 带中文括号的转换成英文括号
|
|
|
|
|
// 购方名称 带中文括号的转换成英文括号
|
|
|
|
|
buyerEntity.setPurchaseName(StringUtil.replaceStr(buyerEntity.getPurchaseName(), true)); |
|
|
|
|
buyerEntity.setEntId(entId); |
|
|
|
|
buyerEntityList.add(buyerEntity); |
|
|
|
|
} |
|
|
|
|
r = buyerService.importBuyerByExcel(buyerEntityList); |
|
|
|
|