Merge branch 'dev' into test

dev
anthonywj 2 years ago
commit b8a5a9bc6c

@ -10,86 +10,91 @@ public class ConstantStatus {
/**
* (稿
*/
public static final Integer ORDER_STATUS_TEMP_SAVE = 1;
public static final int ORDER_STATUS_TEMP_SAVE = 1;
/**
*
*/
public static final Integer ORDER_STATUS_PROCESS = 2;
public static final int ORDER_STATUS_PROCESS = 2;
/**
*
*/
public static final Integer ORDER_STATUS_CHECK = 3;
public static final int ORDER_STATUS_CHECK = 3;
/**
*
*/
public static final Integer ORDER_STATS_ERROR = 4;
public static final int ORDER_STATS_ERROR = 4;
/**
*
*/
public static final Integer ORDER_STATUS_CHECK_SUCCESS = 5;
public static final int ORDER_STATUS_CHECK_SUCCESS = 5;
/**
*
*/
public static final Integer ORDER_STATUS_CHECK_FAIL = 6;
public static final int ORDER_STATUS_CHECK_FAIL = 6;
/**
*
*/
public static final Integer ORDER_STATUS_CHECK_REW = 10;
public static final int ORDER_STATUS_CHECK_REW = 10;
/**
*
*/
public static final Integer ORDER_STATUS_AUDITED = 7;
public static final int ORDER_STATUS_AUDITED = 7;
/**
*
*/
public static final Integer ORDER_STATUS_AUDITED_REFUSED = 8;
public static final int ORDER_STATUS_AUDITED_REFUSED = 8;
/**
*
*/
public static final Integer ORDER_STATUS_PROCESSING = 9;
public static final int ORDER_STATUS_PROCESSING = 9;
/**
*
*/
public static final int ORDER_STATUS_CHECK_PROCESS = 12;
/**
*
*/
public static final Integer ORDER_STATUS_ALLOCATE = 11;
public static final int ORDER_STATUS_ALLOCATE = 11;
public static final Integer ORDER_DELIVERY_STATUS_UN = 1;
public static final Integer ORDER_DELIVERY_STATUS_ED = 2;
public static final int ORDER_DELIVERY_STATUS_UN = 1;
public static final int ORDER_DELIVERY_STATUS_ED = 2;
/**
* 2.13,4:
*/
public static final Integer ORDER_TYPE_BIZ = 1;
public static final Integer ORDER_TYPE_SCAN = 2;
public static final Integer ORDER_TYPE_NORMAL = 3;
public static final Integer ORDER_TYPE_WAIT = 4;
public static final int ORDER_TYPE_BIZ = 1;
public static final int ORDER_TYPE_SCAN = 2;
public static final int ORDER_TYPE_NORMAL = 3;
public static final int ORDER_TYPE_WAIT = 4;
/**
*
*/
public static final Integer BUS_TYPE_NORMAL = 1; //正常出入库单据(入账)
public static final Integer BUS_TYPE_DELIVERY = 2; //送货出入库单据
public static final Integer BUS_TYPE_ARRIVAL = 3; //到货出库单据类型
public static final Integer BUS_TYPE_RETURNED = 4; //退货单单据类型
public static final Integer BUS_TYPE_INVOICE = 4; //退货单单据类型
public static final int BUS_TYPE_NORMAL = 1; //正常出入库单据(入账)
public static final int BUS_TYPE_DELIVERY = 2; //送货出入库单据
public static final int BUS_TYPE_ARRIVAL = 3; //到货出库单据类型
public static final int BUS_TYPE_RETURNED = 4; //退货单单据类型
public static final int BUS_TYPE_INVOICE = 4; //退货单单据类型
public static final Integer ACTION_TYPE_NORMAL = 1; //带票
public static final Integer ACTION_TYPE_PREIN = 2; //预验收
public static final Integer ACTION_TYPE_ADVANCE = 3; //寄售
public static final int ACTION_TYPE_NORMAL = 1; //带票
public static final int ACTION_TYPE_PREIN = 2; //预验收
public static final int ACTION_TYPE_ADVANCE = 3; //寄售
public static final int ORDER_SPUSE_NO = 0; //不允许供应商使用
@ -97,41 +102,41 @@ public class ConstantStatus {
public static final int ORDER_SPUSE_EDIT = 2; //允许供应商编辑
public static final Integer ORDER_STATUS_ADDITIONAL = 5; //补录单据
// public static final Integer ORDER_STATUS_RECEIVEED = 7;
public static final int ORDER_STATUS_ADDITIONAL = 5; //补录单据
// public static final int ORDER_STATUS_RECEIVEED = 7;
//订单处理状态
public static final Integer ORDER_DEAL_DRAFT = 1; //草稿
public static final Integer ORDER_DEAL_POST = 2; //已提交,待交接
public static final Integer ORDER_DEAL_REW = 4; //交接中,待审核
public static final Integer ORDER_DEAL_CHECK = 3; //已审核
public static final int ORDER_DEAL_DRAFT = 1; //草稿
public static final int ORDER_DEAL_POST = 2; //已提交,待交接
public static final int ORDER_DEAL_REW = 4; //交接中,待审核
public static final int ORDER_DEAL_CHECK = 3; //已审核
//ERP校验状态
public static final Integer ORDER_CHECK_SUCCESS = 2; //校验成功
public static final Integer ORDER_CHECK_FAIL = 1; //校验失败
public static final Integer ORDER_CHECK_UN = 0; //未校验
public static final int ORDER_CHECK_SUCCESS = 2; //校验成功
public static final int ORDER_CHECK_FAIL = 1; //校验失败
public static final int ORDER_CHECK_UN = 0; //未校验
//ERP订单上传状态
public static final Integer ORDER_EXPORT_UN = 0; //未导出
public static final Integer ORDER_EXPORT_ED = 1; //已导出
public static final Integer ORDER_EXPORT_FAIL = 2; //导出失败
public static final int ORDER_EXPORT_UN = 0; //未导出
public static final int ORDER_EXPORT_ED = 1; //已导出
public static final int ORDER_EXPORT_FAIL = 2; //导出失败
//ERP订单签字状态
public static final Integer ORDER_SIGN_UN = 0; //未签字
public static final Integer ORDER_SIGN_ED = 1; //已签字
public static final Integer ORDER_SIGN_FAIL = 2; //签字失败
public static final int ORDER_SIGN_UN = 0; //未签字
public static final int ORDER_SIGN_ED = 1; //已签字
public static final int ORDER_SIGN_FAIL = 2; //签字失败
//UDI产品信息表字段类型
public static final Integer PRODUCT_TYPE_UDI = 0;
public static final Integer PRODUCT_TYPE_THIRD = 1;
public static final int PRODUCT_TYPE_UDI = 0;
public static final int PRODUCT_TYPE_THIRD = 1;
//DI类型
public static final Integer DI_TYPE_MAIN = 1;//主标识
public static final Integer DI_TYPE_SYDY = 2;//使用单元
public static final Integer DI_TYPE_BTBS = 3;//本体标识
public static final Integer DI_TYPE_BZBS = 4;//包装标识
public static final int DI_TYPE_MAIN = 1;//主标识
public static final int DI_TYPE_SYDY = 2;//使用单元
public static final int DI_TYPE_BTBS = 3;//本体标识
public static final int DI_TYPE_BZBS = 4;//包装标识
//业务单据状态
@ -174,8 +179,8 @@ public class ConstantStatus {
//采购类型
public static final Integer PRUCHASE_ADVANCE = 1; //预入库
public static final Integer PRUCHASE_COMMON = 2; //普通采购
public static final int PRUCHASE_ADVANCE = 1; //预入库
public static final int PRUCHASE_COMMON = 2; //普通采购
//往来单位类型

@ -35,6 +35,8 @@ public class AuthUserController extends BaseController {
private WarehouseUserService warehouseUserService;
@Resource
DeptService deptService;
@Resource
CustomerService customerService;
@AuthRuleAnnotation("admin/auth/admin/updateInv")
@PostMapping("/admin/auth/admin/updateInv")
@ -126,4 +128,12 @@ public class AuthUserController extends BaseController {
return ResultVOUtils.success(hospitalUserList);
}
//查询用户名信息
@AuthRuleAnnotation("")
@GetMapping("/admin/auth/admin/selectUser")
public BaseResponse selectUser() {
AuthAdmin authAdmin=customerService.getUserBean();
return ResultVOUtils.success(authAdmin);
}
}

@ -88,7 +88,7 @@ public class BasicOrderPrintController {
public BaseResponse inspectionStockOrderPDFFromTemplateFile(@RequestBody FilterOrderPrintRequest filterOrderPrintRequest) {
String name=getStatusName(filterOrderPrintRequest.getStatus());
String name = getStatusName(filterOrderPrintRequest.getStatus());
SysPdfTemplateRelevanceCodeEntity sysPdfTemplateRelevanceCodeEntity = systemPDFTemplateRelevanceCodeService.selectNameAndAction(name, filterOrderPrintRequest.getAction());
if (sysPdfTemplateRelevanceCodeEntity != null) {
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(sysPdfTemplateRelevanceCodeEntity.getTemplateId() + "");
@ -108,7 +108,7 @@ public class BasicOrderPrintController {
@PostMapping("/udiwms/pdf/template/order/file")
public void printSupCertProduction(@RequestBody FilterOrderPrintRequest filterOrderPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterOrderPrintRequest.getTemplateId());
String name=getStatusName(filterOrderPrintRequest.getStatus());
String name = getStatusName(filterOrderPrintRequest.getStatus());
SysPdfTemplateRelevanceCodeEntity sysPdfTemplateRelevanceCodeEntity = systemPDFTemplateRelevanceCodeService.selectNameAndAction(name, filterOrderPrintRequest.getAction());
//打印单号标签
Map<String, Object> data = new HashMap<>(1);
@ -210,19 +210,19 @@ public class BasicOrderPrintController {
data.put("data", list);
String param = JSON.toJSONString(data);
JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf");
JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
}
public String getStatusName(Integer type){
String name="";
if(type==3){
name="ScanCodeVerification";
}else if(type==5){
name="ScanCodeCheck";
}else if(type==10){
name="ScanCode";
}else if(type==7){
name="ScanCodeAlready";
public String getStatusName(Integer type) {
String name = "";
if (type == 3) {
name = "ScanCodeVerification";
} else if (type == 5) {
name = "ScanCodeCheck";
} else if (type == 10) {
name = "ScanCode";
} else if (type == 7) {
name = "ScanCodeAlready";
}
return name;
}
@ -235,7 +235,7 @@ public class BasicOrderPrintController {
@RequestBody FilterOrderPrintRequest filterOrderPrintRequest) throws Exception {
//查询模板文件是否存在
SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(filterOrderPrintRequest.getLabelId()+"");
SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(filterOrderPrintRequest.getLabelId() + "");
if (null == sysPdfTemplateRelevanceStatemenEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
}
@ -280,7 +280,10 @@ public class BasicOrderPrintController {
Map<String, Object> bizData = new HashMap<>();
bizData.put("index", i);
bizData.put("nameCode", obj.getNameCode() == null ? ' ' : obj.getNameCode());
bizData.put("udiCode", udiProductEntity.getUuid() == null ? ' ' : udiProductEntity.getUuid());
String udiCode = "#" + obj.getNameCode() + "#" + obj.getProduceDate() + "#" + obj.getExpireDate() +
"#" + obj.getBatchNo() + "#" + obj.getSerialNo() + "#" + "#" ;
udiCode = udiCode.replaceAll("#null", "#");
bizData.put("udiCode", udiCode);
bizData.put("cpmctymc", udiProductEntity.getCpmctymc() == null ? ' ' : udiProductEntity.getCpmctymc());
bizData.put("ggxh", udiProductEntity.getGgxh() == null ? ' ' : udiProductEntity.getGgxh());
bizData.put("batchNo", obj.getBatchNo() == null ? ' ' : obj.getBatchNo());
@ -300,5 +303,4 @@ public class BasicOrderPrintController {
}
}

@ -51,6 +51,10 @@ import java.util.Date;
import java.util.List;
import static com.glxp.api.constant.ConstantStatus.ORDER_STATUS_CHECK_PROCESS;
import static com.glxp.api.constant.ConstantStatus.ORDER_STATUS_PROCESSING;
@Slf4j
@RestController
public class IoOrderController extends BaseController {
@ -192,6 +196,10 @@ public class IoOrderController extends BaseController {
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse submitBiz(@RequestBody AddOrderRequest addOrderRequest) {
IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo());
BaseResponse tempResponse = checkSubmitEnable(orderEntity);
if (tempResponse != null)
return tempResponse;
//校验单据是否已完成
List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(addOrderRequest.getBillNo());
@ -219,7 +227,7 @@ public class IoOrderController extends BaseController {
}
}
IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo());
ioAddInoutService.dealBusProcess(orderEntity, addOrderRequest.getFromVailPi());
return ResultVOUtils.success("提交成功!");
}
@ -237,6 +245,13 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.error(500, "单据未扫码或扫码校验无法通过,提交失败,请检查后重新提交!");
}
IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo());
BaseResponse tempResponse = checkSubmitEnable(orderEntity);
if (tempResponse != null)
return tempResponse;
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_TEMP_SAVE)
ioAddInoutService.dealProcess(orderEntity);
//不需要手动校验,则走正常单据校验处理流程
@ -283,6 +298,11 @@ public class IoOrderController extends BaseController {
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse submitOrderWeb(@RequestBody AddOrderRequest addOrderRequest) {
IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo());
BaseResponse tempResponse = checkSubmitEnable(orderEntity);
if (tempResponse != null)
return tempResponse;
//校验单据是否已完成
List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(addOrderRequest.getBillNo());
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(addOrderRequest.getBillNo());
@ -304,8 +324,7 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.error(500, errMsg);
}
saveOrderWeb(addOrderRequest);
IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo());
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
orderEntity.setStatus(ORDER_STATUS_CHECK_PROCESS);
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderService.update(orderEntity);
checkInoutService.check(addOrderRequest.getBillNo());
@ -313,7 +332,7 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.error(500, "单据校验提交失败,请先录入业务单据!");
}
} else {
IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo());
orderEntity.setStatus(ORDER_STATUS_CHECK_PROCESS);
ioAddInoutService.dealProcess(orderEntity);
checkInoutService.check(addOrderRequest.getBillNo());
return ResultVOUtils.success("提交成功!");
@ -323,6 +342,17 @@ public class IoOrderController extends BaseController {
}
public BaseResponse checkSubmitEnable(IoOrderEntity orderEntity) {
if (orderEntity.getStatus() == ORDER_STATUS_CHECK_PROCESS || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_PROCESS
|| orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_PROCESSING) {
return ResultVOUtils.error(500, "提交失败,单据正在处理,请稍后刷新查看!");
}
if (orderEntity.getStatus() != 1 && orderEntity.getStatus() != 3 && orderEntity.getStatus() != 4 && orderEntity.getStatus() != 6) {
return ResultVOUtils.error(500, "提交失败,单据已提交,请稍后刷新查看!");
}
return null;
}
//带配货-立即提交
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/waitAllocate/submitOrderWeb")
@ -331,6 +361,10 @@ public class IoOrderController extends BaseController {
//校验单据是否已完成
IoOrderEntity orderEntity = orderService.findByBillNo(addOrderRequest.getBillNo());
BaseResponse tempResponse = checkSubmitEnable(orderEntity);
if (tempResponse != null)
return tempResponse;
List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(addOrderRequest.getBillNo());
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(addOrderRequest.getBillNo());
@ -378,6 +412,10 @@ public class IoOrderController extends BaseController {
@PostMapping("udiwms/inout/order/delete")
@Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse deletById(@RequestBody DeleteRequest deleteRequest) {
IoOrderEntity orderEntity = orderService.findByBillNo(deleteRequest.getBillNo());
if (orderEntity.getStatus() != 1 && orderEntity.getStatus() != 3 && orderEntity.getStatus() != 4 && orderEntity.getStatus() != 6) {
return ResultVOUtils.error(500, "单据已提交无法删除!");
}
orderService.deleteByBillNo(deleteRequest.getBillNo());
orderDetailBizService.deleteByOrderId(deleteRequest.getBillNo());
orderDetailCodeService.deleteByOrderId(deleteRequest.getBillNo());

@ -2,6 +2,7 @@ package com.glxp.api.controller.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
@ -28,6 +29,7 @@ import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
import com.glxp.api.entity.thrsys.ThrOrderEntity;
import com.glxp.api.entity.thrsys.ThrSystemBusApiEntity;
import com.glxp.api.req.inout.*;
import com.glxp.api.req.inv.FilterInvoiceRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
@ -56,6 +58,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -615,7 +618,6 @@ public class IoOrderDetailBizController extends BaseController {
}
@PostMapping("/udiwms/inout/biz/insertInvoice")
@Log(title = "发票管理", businessType = BusinessType.INSERT)
public BaseResponse insertInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) {
@ -644,6 +646,20 @@ public class IoOrderDetailBizController extends BaseController {
}
//解析发票二维码
@GetMapping("/udiwms/inout/biz/parseInvoice")
public BaseResponse parseInvoice(String code) {
List<String> list = Arrays.asList(code.split(","));
FilterInvoiceRequest filterInvoiceRequest = new FilterInvoiceRequest();
filterInvoiceRequest.setType(list.get(1));
filterInvoiceRequest.setInvoiceCode(list.get(2));
filterInvoiceRequest.setInvoiceEncode(list.get(3));
filterInvoiceRequest.setPrice(new BigDecimal(list.get(4)));
filterInvoiceRequest.setInvoiceDate(DateUtil.formatDateTime(DateUtil.parse(list.get(5), "yyyyMMdd")));
return ResultVOUtils.success(filterInvoiceRequest);
}
@PostMapping("/udiwms/inout/biz/updateorderBiz")
public BaseResponse updateorderBiz(@RequestBody List<IoOrderDetailCodeEntity> list) {
for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) {

@ -343,14 +343,16 @@ public class IoOrderReviewController extends BaseController {
if (StrUtil.isNotEmpty(code)) {
code = code.replace("\r\n", "");
}
if (code.endsWith("\u001D")) {
code = code.replace("\u001D", "");
}
for (IoCodeEntity checkOrderCodesBean : codesList) {
if (checkOrderCodesBean.getCode().toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) {
if (checkOrderCodesBean.getStatus() == Constant.DB_CHECK_ED
String checkCode = checkOrderCodesBean.getCode();
if (checkCode.endsWith("\u001D")) {
checkCode = checkCode.replace("\u001D", "");
}
if (checkCode.toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) {
if (IntUtil.value(checkOrderCodesBean.getStatus()) == Constant.DB_CHECK_ED
&& IntUtil.value(checkOrderCodesBean.getReCount()) == checkOrderCodesBean.getScanCount()) {
return Constant.CHECK_REPEAT;
}
@ -367,8 +369,18 @@ public class IoOrderReviewController extends BaseController {
public IoCodeEntity isExit(List<IoCodeEntity> codeList, String code) {
if (CollUtil.isNotEmpty(codeList)) {
if (StrUtil.isNotEmpty(code)) {
code = code.replace("\r\n", "");
}
if (code.endsWith("\u001D")) {
code = code.replace("\u001D", "");
}
for (IoCodeEntity codeEntity : codeList) {
if (codeEntity.getCode().equals(code)) {
String checkCode = codeEntity.getCode();
if (checkCode.endsWith("\u001D")) {
checkCode = checkCode.replace("\u001D", "");
}
if (checkCode.equals(code)) {
return codeEntity;
}
}

@ -25,7 +25,6 @@ public class InvPlaceOrderController {
public BaseResponse filterList(FilterInvPlaceOrderRequest filterInvPlaceOrderRequest) {
List<InvPlaceOrderResponse> list = invPlaceOrderService.filterList(filterInvPlaceOrderRequest);
PageInfo<InvPlaceOrderResponse> pageInfo = new PageInfo<>(list);
System.out.println("6666666666666666");
return ResultVOUtils.page(pageInfo);
}

@ -136,10 +136,13 @@ public class IoPurChangeService {
purPlanEntity.setInvCode(purApplyEntity.getInvCode());
purPlanEntity.setDeptCode(purApplyEntity.getDeptCode());
purPlanEntity.setCreateUser(purApplyEntity.getAuditUser());
//purPlanEntity.setCreateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
if (basicBusTypeChangeEntity.getBusBeforeTime() != null) {
purPlanEntity.setCreateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
purPlanEntity.setUpdateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
}else{
purPlanEntity.setCreateTime(purApplyEntity.getCreateTime());
purPlanEntity.setUpdateUser(purApplyEntity.getAuditUser());
//purPlanEntity.setUpdateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
}
purPlanEntity.setUpdateTime(purApplyEntity.getUpdateTime());
if (purPlanEntity.getStatus() == 3) {
purPlanEntity.setAuditUser("");
@ -196,9 +199,14 @@ public class IoPurChangeService {
purOrderEntity.setInvCode(purPlanEntity.getInvCode());
purOrderEntity.setDeptCode(purPlanEntity.getDeptCode());
purOrderEntity.setCreateUser(purPlanEntity.getAuditUser());
purOrderEntity.setCreateTime(DateUtil.timeProcess(purPlanEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
purOrderEntity.setUpdateUser(purPlanEntity.getAuditUser());
purOrderEntity.setUpdateTime(DateUtil.timeProcess(purPlanEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
if (basicBusTypeChangeEntity.getBusBeforeTime() != null) {
purPlanEntity.setCreateTime(DateUtil.timeProcess(purOrderEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
purPlanEntity.setUpdateTime(DateUtil.timeProcess(purOrderEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime()));
}else{
purPlanEntity.setCreateTime(purOrderEntity.getCreateTime());
purPlanEntity.setUpdateUser(purOrderEntity.getAuditUser());
}
if (purOrderEntity.getStatus() == 3) {
purOrderEntity.setAuditUser("");
purOrderEntity.setAuditTime(new Date());
@ -348,7 +356,6 @@ public class IoPurChangeService {
}
if (basicProductsEntity != null && basicProductsEntity.getZczbhhzbapzbh() != null) {
ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh());
}
@ -367,7 +374,7 @@ public class IoPurChangeService {
// if (basicProductsEntity.getPrice() != null) {
// ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice()));
// }
if (basicProductsEntity.getPrice() != null&& basicProductsEntity.getPrice() != null) {
if (basicProductsEntity.getPrice() != null && basicProductsEntity.getPrice() != null) {
ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice()));
}
ioOrderDetailBizEntity.setSupId(obj.getSupId());

@ -108,8 +108,8 @@ public class PurApplyController {
/**
*
*/
@GetMapping("/purchase/apply/list")
public BaseResponse list(PurApplyRequest purApplyRequest) {
@PostMapping("/purchase/apply/list")
public BaseResponse list(@RequestBody PurApplyRequest purApplyRequest) {
if (purApplyRequest.getStatus() == null) {
purApplyRequest.setStatus(11); //查询未审核和草稿状态
@ -129,8 +129,8 @@ public class PurApplyController {
/**
*
*/
@GetMapping("/purchase/apply/auditList")
public BaseResponse auditList(PurApplyRequest purApplyRequest) {
@PostMapping("/purchase/apply/auditList")
public BaseResponse auditList(@RequestBody PurApplyRequest purApplyRequest) {
if (purApplyRequest.getStatus() == null) {
purApplyRequest.setStatus(10); //查询未审核和已审核状态

@ -105,11 +105,11 @@ public class ThrBusTypeOriginController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (thrBusTypeOriginEntity != null) {
//校验单据类型代码是否重复
// boolean exists = thrBusTypeOriginService.checkActionExists(thrBusTypeOriginEntity.getAction(), thrBusTypeOriginEntity.getThirdSys());
// if (exists) {
// return ResultVOUtils.error(500, "单据类型已存在!");
// }
// 校验单据类型代码是否重复
boolean exists = thrBusTypeOriginService.checkActionExists(thrBusTypeOriginEntity.getAction(), thrBusTypeOriginEntity.getThirdSys());
if (exists) {
return ResultVOUtils.error(500, "单据类型已存在!");
}
thrBusTypeOriginService.updateBusOriginType(thrBusTypeOriginEntity);
} else {
ResultVOUtils.error(999, "参数错误");

@ -1,5 +1,6 @@
package com.glxp.api.controller.thrsys;
import cn.hutool.core.thread.ThreadUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
@ -23,6 +24,7 @@ import com.glxp.api.service.thrsys.ThrCorpsDlService;
import com.glxp.api.service.thrsys.ThrSystemDetailService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
@ -32,6 +34,7 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@RestController
public class ThrCorpsController {
@Resource
@ -137,7 +140,7 @@ public class ThrCorpsController {
thrCorpImportLogEntity.setUpdateTime(new Date());
thrCorpImportLogEntity.setThirdSysFk(filterThrProductsRequest.getThirdSysFk());
thrCorpImportLogService.insertImportLog(thrCorpImportLogEntity);
thrCorpsDlService.importCorps(genKey,null, filterThrProductsRequest.getThirdSysFk());
thrCorpsDlService.importCorps(genKey, null, filterThrProductsRequest.getThirdSysFk());
return ResultVOUtils.success("后台开始下载更新,请稍后刷新查看");
}
}
@ -146,33 +149,19 @@ public class ThrCorpsController {
@AuthRuleAnnotation("")
@PostMapping("/udiwms/thrsys/corp/corpsDlAll")
public BaseResponse corpsDlAll(@RequestBody ThrUnitMaintainFilterRequest thrUnitMaintainFilterRequest) {
thrUnitMaintainFilterRequest.setThirdSysFk(thrUnitMaintainFilterRequest.getThirdSys());
String data = (String) redisUtil.get(Constant.dlThrProducts);
if (data != null && data.equals("true")) {
return ResultVOUtils.error(500, "当前任务正在下载更新产品信息,请稍后重试!");
} else {
redisUtil.set(Constant.dlThrCorps, "true", 30);
if (thrUnitMaintainFilterRequest.getThirdSysFk() == null) {
return ResultVOUtils.error(500, "未选择第三方系统!");
if (null == thrUnitMaintainFilterRequest) {
return ResultVOUtils.error(500, "参数不能为空");
}
ThrCorpImportLogEntity thrCorpImportLogEntity = new ThrCorpImportLogEntity();
String genKey = CustomUtil.getId();
thrCorpImportLogEntity.setGenKey(genKey);
thrCorpImportLogEntity.setFromType("第三方系统获取");
thrCorpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
thrCorpImportLogEntity.setUpdateTime(new Date());
thrCorpImportLogEntity.setThirdSysFk(thrUnitMaintainFilterRequest.getThirdSysFk());
thrCorpImportLogService.insertImportLog(thrCorpImportLogEntity);
if (thrUnitMaintainFilterRequest.getThrCorpEntities() != null && thrUnitMaintainFilterRequest.getThrCorpEntities().size() > 0) {//选中导出
thrCorpsDlService.importSelectCorps(genKey, thrUnitMaintainFilterRequest.getThrCorpEntities(), thrUnitMaintainFilterRequest.getThirdSysFk());
} else { //结果导出
thrCorpsDlService.importCorps(genKey,thrUnitMaintainFilterRequest, thrUnitMaintainFilterRequest.getThirdSysFk());
ThreadUtil.execAsync(() -> {
try {
thrCorpService.downloadByRequest(thrUnitMaintainFilterRequest);
} catch (Exception e) {
log.error("下载异常", e);
e.printStackTrace();
}
// thrCorpsDlService.importCorps(genKey, filterThrCorpRequest.getThirdSysFk());
return ResultVOUtils.success("后台开始下载更新,请稍后刷新查看");
}
});
return ResultVOUtils.success("后台正在下载,请稍后刷新查看!");
}
//查询ERP往来单位

@ -286,9 +286,9 @@ public class ThrOrderController {
return ResultVOUtils.error(500, "当前任务正在下载更新业务单据信息,请稍后重试!");
} else {
redisUtil.set(Constant.dlThrOrders, "true", 10 * 30);
if (filterThrProductsRequest.getBillAction() == null) {
return ResultVOUtils.error(500, "未选择业务类型!");
}
// if (filterThrProductsRequest.getBillAction() == null) {
// return ResultVOUtils.error(500, "未选择业务类型!");
// }
ThrOrderImportLogEntity thrOrderImportLogEntity = new ThrOrderImportLogEntity();
String genKey = CustomUtil.getId();
@ -356,8 +356,8 @@ public class ThrOrderController {
}
//只查询第三方单据
@GetMapping("/udiwms/thirdOrder/filter")
public BaseResponse filterThirdOrder(FilterThrOrderRequest filterErpOrderRequest,
@PostMapping("/udiwms/thirdOrder/filter")
public BaseResponse filterThirdOrder(@RequestBody FilterThrOrderRequest filterErpOrderRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -390,7 +390,7 @@ public class ThrOrderController {
if (data != null && data.size() > 0) {
for (ThrOrderEntity thrOrderEntity : data) {
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + "");
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getBillNo() + "");
List<ThrOrderDetailEntity> thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
ThrOrderResponse erpOrderResponse = new ThrOrderResponse();
BeanUtils.copyProperties(thrOrderEntity, erpOrderResponse);

@ -1,6 +1,8 @@
package com.glxp.api.controller.thrsys;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.IdUtil;
@ -22,12 +24,14 @@ import com.glxp.api.res.thrsys.ThrProductsResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.service.thrsys.ThrSystemDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.Date;
import java.util.List;
@ -39,6 +43,7 @@ import java.util.List;
* @author ${author}
* @since 2023-01-10
*/
@Slf4j
@RestController
public class ThrProductsController {
@ -72,35 +77,9 @@ public class ThrProductsController {
if (thrSystemDetailEntity.getEnabled()) {
if (thrSystemDetailEntity.getFromType() == 0 || (filterThrProductsRequest.getIsDownThrSys() != null && filterThrProductsRequest.getIsDownThrSys())) {
BaseResponse<PageSimpleResponse<ThrProductsResponse>> udiDlDeviceResponse = erpBasicClient.getErpProducts(filterThrProductsRequest);
if (udiDlDeviceResponse.getCode() == 20000) {
List<ThrProductsResponse> invmandocResponses = udiDlDeviceResponse.getData().getList();
//todo 耗材字典未确认数据库
// if (invmandocResponses != null) {
// for (ThrProductsResponse invmandocResponse : invmandocResponses) {
// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(invmandocResponse.getCode(), filterErpGoodsRequest.getThirdSys());
// invmandocResponse.setThirdSys(thrProductsRequest.getThirdSys());
// if (udiRelevanceEntity != null) {
// invmandocResponse.setChecked(true);
// } else {
// invmandocResponse.setChecked(false);
// }
// }
// }
}
return udiDlDeviceResponse;
} else {
List<ThrProductsResponse> thrCorpEntities = thrProductsService.filterJoinThrProducts(filterThrProductsRequest);
//todo 耗材字典未确认数据库
// for (ThrProductsEntity thrProductsEntity : thrCorpEntities) {
// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(thrProductsEntity.getCode(), thrProductsEntity.getThirdSysFk());
// if (udiRelevanceEntity != null) {
// thrProductsEntity.setChecked(true);
// } else {
// thrProductsEntity.setChecked(false);
// }
// }
PageInfo<ThrProductsResponse> pageInfo;
pageInfo = new PageInfo<>(thrCorpEntities);
PageSimpleResponse<ThrProductsResponse> pageSimpleResponse = new PageSimpleResponse<>();
@ -216,7 +195,11 @@ public class ThrProductsController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "每次只能上传一个文件!");
}
ThreadUtil.execAsync(() -> {
thrProductsService.uploadPi(files, thirdSys);
try {
thrProductsService.uploadPi(files.get(0).getBytes(), files.get(0).getName(), thirdSys);
} catch (IOException e) {
e.printStackTrace();
}
});
return ResultVOUtils.success("正在导入中,稍后请刷新页面查看");
}
@ -249,10 +232,18 @@ public class ThrProductsController {
if (null == filterThrProductsRequest) {
return ResultVOUtils.error(500, "参数不能为空");
}
ThreadUtil.execAsync(() -> {
erpBasicClient.getErpProducts(filterThrProductsRequest);
try {
thrProductsService.downloadByRequest(filterThrProductsRequest);
} catch (Exception e) {
log.error("下载异常", e);
e.printStackTrace();
}
});
return ResultVOUtils.success();
return ResultVOUtils.success("后台正在下载,请稍后刷新查看!");
}
}

@ -18,10 +18,7 @@ import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
/**
* Mapper ,
@ -242,8 +239,39 @@ public interface BaseMapperPlus<M, T, V> extends BaseMapper<T> {
* @param entityList
* @return
*/
default boolean insertIgnoreBatchs(List<T> entityList) {
return insertIgnoreBatchs(entityList, DEFAULT_BATCH_SIZE);
}
default boolean insertIgnoreBatchs(List<T> entityList, int batchSize) {
try {
int size = entityList.size();
int idxLimit = Math.min(DEFAULT_BATCH_SIZE, size);
int i = 1;
//保存单批提交的数据集合
List<T> oneBatchList = new ArrayList<>();
for (Iterator<T> var7 = entityList.iterator(); var7.hasNext(); ++i) {
T element = var7.next();
oneBatchList.add(element);
if (i == idxLimit) {
this.insertIgnoreBatch(oneBatchList);
//每次提交后需要清空集合数据
oneBatchList.clear();
idxLimit = Math.min(idxLimit + batchSize, size);
}
}
} catch (Exception e) {
log.error("insertIgnoreBatch fail", e);
return false;
}
return true;
}
int insertIgnoreBatch(List<T> entityList);
/**
*
* replace intoPrimaryKeyuniqueinsert into
@ -262,5 +290,36 @@ public interface BaseMapperPlus<M, T, V> extends BaseMapper<T> {
* @param entityList
* @return
*/
default boolean replaceBatchs(List<T> entityList) {
return this.replaceBatchs(entityList, DEFAULT_BATCH_SIZE);
}
default boolean replaceBatchs(List<T> entityList, int batchSize) {
try {
int size = entityList.size();
int idxLimit = Math.min(DEFAULT_BATCH_SIZE, size);
int i = 1;
//保存单批提交的数据集合
List<T> oneBatchList = new ArrayList<>();
for (Iterator<T> var7 = entityList.iterator(); var7.hasNext(); ++i) {
T element = var7.next();
oneBatchList.add(element);
if (i == idxLimit) {
this.replaceBatch(oneBatchList);
//每次提交后需要清空集合数据
oneBatchList.clear();
idxLimit = Math.min(idxLimit + batchSize, size);
}
}
} catch (Exception e) {
log.error("insertIgnoreBatch fail", e);
return false;
}
return true;
}
int replaceBatch(List<T> entityList);
}

@ -118,4 +118,11 @@ public interface UdiRelevanceDao extends BaseMapperPlus<UdiRelevanceDao, UdiRele
* @return
*/
UdiRelevanceResponse selectOneUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest);
/**
*
* @param productName
* @return
*/
List<String> selectRelIdByName(@Param("productName") String productName);
}

@ -70,4 +70,9 @@ public interface IoOrderDao extends BaseMapperPlus<IoOrderDao, IoOrderEntity, Io
List<String> selectWaitSubmitOrder(@Param("thirdSys") String thirdSys);
boolean updateOrder(IoOrderEntity orderEntity);
List<String> selectOrderIdList(@Param("data") String data);
List<String> selectOrderfirstAndLastIdList(@Param("firstData") String firstData,@Param("lastData") String lastData);
}

@ -31,5 +31,5 @@ public interface IoOrderDetailResultDao extends BaseMapperPlus<IoOrderDetailBizD
*
* @return
*/
List<IoOrderDetailResultEntity> selectStatDataByTime(@Param("date") String date);
List<IoOrderDetailResultEntity> selectStatDataByTime(@Param("list") List<String> orderIdFk);
}

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName(value = "io_order_detail_code")
@ -194,5 +195,8 @@ public class IoOrderDetailCodeEntity {
@TableField(value = "regStatus")
private boolean regStatus;
@TableField(value = "updateTime")
private Date updateTime;
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import javax.validation.Valid;
import java.math.BigDecimal;
@Data
@ -182,4 +183,7 @@ public class IoOrderDetailResultEntity {
@TableField(value = "remark5")
private String remark5;
@TableField(exist = false)
private String deptCode;
}

@ -163,4 +163,10 @@ public class IoStatDayEntity {
@TableField(value = "updateTime")
private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
@TableField(exist = false)
private String deptName;
}

@ -157,4 +157,9 @@ public class IoStatMonthEntity {
@TableField(value = "updateTime")
private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
@TableField(exist = false)
private String deptName;
}

@ -151,4 +151,7 @@ public class IoStatQuarterEntity {
@TableField(value = "updateTime")
private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
}

@ -145,4 +145,8 @@ public class IoStatYearEntity {
@TableField(value = "updateTime")
private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
}

@ -70,6 +70,13 @@ public class InvPlaceOrderDetailEntity {
@TableField(value = "serialNo")
private String serialNo;
@TableField(value = "topInvCode")
private String topInvCode;
@TableField(value = "topInvSpaceCode")
private String topInvSpaceCode;
}

@ -47,6 +47,10 @@ public class ThrOrderEntity {
@TableField(value = "billType")
private String billType;
@TableField(value = "originType")
private String originType;
/**
*
*/
@ -161,6 +165,7 @@ public class ThrOrderEntity {
@TableField(value = "remark")
private String remark;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "id";

@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.util.List;
/**
@ -43,8 +44,7 @@ public class ErpBasicClient {
UdiwmsUnitRequest udiwmsUnitRequest = new UdiwmsUnitRequest();
BeanUtils.copyProperties(thrUnitMaintainFilterRequest, udiwmsUnitRequest);
udiwmsUnitRequest.setUnitId(thrUnitMaintainFilterRequest.getErpId());
ThrSystemEntity thrSystemEntity = basicThirdSysService.selectByThirdId(thrUnitMaintainFilterRequest.getThirdSys());
ThrSystemEntity thrSystemEntity = basicThirdSysService.selectByThirdId(thrUnitMaintainFilterRequest.getThirdSysFk());
try {
String url = thrSystemEntity.getThridUrl() + "/udiwms/erp/getUnits";
String response = httpOkClient.uCloudPost(url, udiwmsUnitRequest, thrSystemEntity);
@ -64,9 +64,8 @@ public class ErpBasicClient {
//获取产品信息
public BaseResponse<PageSimpleResponse<ThrProductsResponse>> getErpProducts(FilterThrProductsRequest filterThrProductsRequest) {
ThrSystemEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(filterThrProductsRequest.getThirdSys());
ThrSystemEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(filterThrProductsRequest.getThirdSysFk());
String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/getProducts";
try {
String response = httpOkClient.uCloudPost(url, filterThrProductsRequest, basicThirdSysEntity);
if (StrUtil.isBlank(response)) {
@ -159,16 +158,14 @@ public class ErpBasicClient {
* @param thirdSys
* @return
*/
public BaseResponse<PostThrProductsRequest> uploadPi(List<MultipartFile> files, String thirdSys) {
public BaseResponse<PostThrProductsRequest> uploadPi(byte[] bytes, String fileName, String thirdSys) {
ThrSystemEntity thrSystemEntity = basicThirdSysService.selectByThirdId(thirdSys);
String url = thrSystemEntity.getThridUrl() + "/udiwms/erp/pi/upload";
try {
MultipartBody.Builder builder = new MultipartBody.Builder()
.setType(MultipartBody.FORM);
for (MultipartFile file : files) {
builder.addFormDataPart("file", file.getOriginalFilename(), RequestBody.create(MediaType.parse("application/vnd.ms-excel"), file.getBytes()));
}
builder.addFormDataPart("file", fileName, RequestBody.create(MediaType.parse("application/vnd.ms-excel"), bytes));
builder.addFormDataPart("thirdSys", thirdSys);
MultipartBody multipartBody = builder.build();

@ -3,6 +3,8 @@ package com.glxp.api.req.inv;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.List;
/**
*
*/
@ -59,4 +61,6 @@ public class FilterInvRemindMsgRequest extends ListPageRequest {
*/
private String supId;
private List<String> listInv;
}

@ -3,6 +3,8 @@ package com.glxp.api.req.inv;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.List;
/**
*
*/
@ -34,4 +36,8 @@ public class FilterInvRemindSetRequest extends ListPageRequest {
*/
private Integer status;
private String productName;
List<String> relIds;
}

@ -0,0 +1,41 @@
package com.glxp.api.req.inv;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.math.BigDecimal;
/**
*
*/
@Data
public class FilterInvoiceRequest extends ListPageRequest {
/**
* 10010432()31()
*/
private String type;
/**
*
*/
private String invoiceCode;
/**
*
*/
private String invoiceEncode;
/**
*
*/
private String invoiceDate;
/**
*
*/
private BigDecimal price;
}

@ -1,6 +1,7 @@
package com.glxp.api.req.thrsys;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
@ -34,5 +35,20 @@ public class FilterThrProductsRequest extends ListPageRequest {
private String uuid;
private Integer diType;
public List<ThrProductsEntity> getThrProductsEntities() {
return thrProductsEntities;
}
public String getThirdSys() {
if (StrUtil.isEmpty(thirdSys))
return thirdSysFk;
return thirdSys;
}
public String getThirdSysFk() {
if (StrUtil.isEmpty(thirdSysFk))
return thirdSys;
return thirdSysFk;
}
}

@ -1,6 +1,7 @@
package com.glxp.api.req.thrsys;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.util.page.ListPageRequest;
import com.glxp.api.res.thrsys.ThrCorpsResponse;
import lombok.Data;
@ -28,4 +29,18 @@ public class ThrUnitMaintainFilterRequest extends ListPageRequest {
private Boolean isDownThrSys;
private String lastUpdateTime;
List<ThrCorpsResponse> thrCorpEntities;
public String getThirdSys() {
if (StrUtil.isEmpty(thirdSys))
return thirdSysFk;
return thirdSys;
}
public String getThirdSysFk() {
if (StrUtil.isEmpty(thirdSysFk))
return thirdSys;
return thirdSysFk;
}
}

@ -6,7 +6,7 @@ import lombok.Data;
public class CompanyProductRelevanceResponse {
private Long id;
private Integer rlId;
private Long rlId;
private String thirdId;
private String thirdName;
private String uuid;

@ -6,7 +6,7 @@ import lombok.Data;
public class UdiRlSupResponse {
private Long id;
private Integer rlId;
private Long rlId;
private String thirdId;
private String thirdName;
private String uuid;

@ -0,0 +1,12 @@
package com.glxp.api.res.inv;
import lombok.Data;
@Data
public class DateRequest {
private String firstDay;
private String lastDay;
private int year;
private int momth;
}

@ -94,4 +94,10 @@ public class InvPlaceOrderDetailResponse {
private String recordId;
private String topInvCode;
private String topInvSpaceCode;
private String topInvSpaceName;
}

@ -133,4 +133,6 @@ public class InvPlaceOrderResponse {
private Integer count;
private String topInvSpaceName;
}

@ -15,7 +15,7 @@ public class InvRemindMsgResponse {
/**
* ID
*/
private Integer relId;
private Long relId;
/**
*

@ -1,5 +1,6 @@
package com.glxp.api.res.thrsys;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.math.BigDecimal;
@ -37,6 +38,7 @@ public class ThrOrderResponse {
private String remark3; //备注3
private String invWarehouseName;
private String fromSubInvName;
private String billTypeName;
public static class SubErpOrder {
private Integer id;
@ -56,7 +58,6 @@ public class ThrOrderResponse {
private String detailId; //明细ID
private String corpName; //往来单位
private BigDecimal price; //单价
public String getDetailId() {
return detailId;
}

@ -48,5 +48,7 @@ public class ThrProductsResponse {
private String updateUser;
private Date updateTime;
private String remark;
private String manufactoryCode;
private String supCode;
}

@ -6,7 +6,7 @@ import java.util.List;
public interface CustomService<T> extends IService<T> {
int insertIgnore(T entity);
int insertIgnoreBatch(List<T> entityList);
boolean insertIgnoreBatch(List<T> entityList);
int replace(T entity);
int replaceBatch(List<T> entityList);
boolean replaceBatch(List<T> entityList);
}

@ -13,8 +13,8 @@ public class CustomServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<B
}
@Override
public int insertIgnoreBatch(List<T> entityList) {
return baseMapper.insertIgnoreBatch(entityList);
public boolean insertIgnoreBatch(List<T> entityList) {
return baseMapper.insertIgnoreBatchs(entityList);
}
@Override
@ -23,7 +23,7 @@ public class CustomServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<B
}
@Override
public int replaceBatch(List<T> entityList) {
return baseMapper.replaceBatch(entityList);
public boolean replaceBatch(List<T> entityList) {
return baseMapper.replaceBatchs(entityList);
}
}

@ -240,7 +240,7 @@ public class BasicBackUpdateProductService {
udiRelevanceEntity1.setThirdId(thrProductsEntity.getCode());
udiRelevanceEntity1.setUpdateTime(new Date());
udiRelevanceEntity1.setModifyTime(new Date());
udiRelevanceEntity1.setId(IdUtil.getSnowflakeNextId());
udiRelevanceEntity1.setId(gennerOrderUtils.getRelId());
udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1);
}
}

@ -85,8 +85,8 @@ public class BasicBusTypePreServiceImpl extends ServiceImpl<BasicBusTypePreDao,
public boolean verifyExists(BasicBusTypePreEntity basicBusTypePreEntity) {
QueryWrapper<BasicBusTypePreEntity> wrapper = new QueryWrapper<>();
wrapper.eq("action", basicBusTypePreEntity.getAction())
.eq("originAction", basicBusTypePreEntity.getOriginAction())
.eq("invCode", basicBusTypePreEntity.getInvCode())
// .eq("originAction", basicBusTypePreEntity.getOriginAction())
.eq(null !=basicBusTypePreEntity.getInvCode(),"invCode", basicBusTypePreEntity.getInvCode())
.eq(null != basicBusTypePreEntity.getBeforeTime(), "beforeTime", basicBusTypePreEntity.getBeforeTime())
.eq(null != basicBusTypePreEntity.getDefaultInvCode(), "defaultInvCode", basicBusTypePreEntity.getDefaultInvCode())
.eq(null != basicBusTypePreEntity.getSupplementAll(), "supplementAll", basicBusTypePreEntity.getSupplementAll());

@ -149,6 +149,7 @@ public class IoAddInoutService {
} else {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setErrMsg(result);
orderService.update(orderEntity);
insertList.clear();
return;
@ -326,6 +327,7 @@ public class IoAddInoutService {
UpdateWrapper<IoOrderDetailCodeEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("count", orderDetailCodeEntity.getCount()).set("reCount", orderDetailCodeEntity.getReCount());
orderDetailCodeEntity.setUpdateTime(new Date());
orderDetailCodeDao.updateCount(orderDetailCodeEntity);
isUpdate = true;
break;
@ -690,6 +692,7 @@ public class IoAddInoutService {
ioOrderDetailCodeEntity.setPrice(udiRelevanceResponse.getPrice());
ioOrderDetailCodeEntity.setCount(codeTempEntity.getCount());
ioOrderDetailCodeEntity.setReCount(codeTempEntity.getMyReCount());
ioOrderDetailCodeEntity.setUpdateTime(new Date());
return ioOrderDetailCodeEntity;
}

@ -39,6 +39,8 @@ import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
import static com.glxp.api.constant.ConstantStatus.ORDER_STATUS_CHECK_PROCESS;
/**
*
*/
@ -119,8 +121,13 @@ public class IoCheckInoutService {
public void check(String orderId) {
IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
//过滤非未校验或校验异常
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK && orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_FAIL)
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_PROCESS &&
orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK && orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_FAIL)
return;
orderEntity.setStatus(ORDER_STATUS_CHECK_PROCESS);
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderService.update(orderEntity);
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
if (!bussinessTypeEntity.isCheckEnable()) {
unCheckFirstFinish(orderEntity);

@ -7,6 +7,7 @@ import com.glxp.api.req.inout.FilterOrderRequest;
import com.glxp.api.req.inout.FilterUploadOrderRequest;
import com.glxp.api.req.inout.OrderEditRequest;
import com.glxp.api.res.inout.IoOrderResponse;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@ -137,4 +138,6 @@ public interface IoOrderService {
BaseResponse submitOrderToThrSys(ThrSystemDetailEntity thrSystemDetailEntity);
List<IoOrderEntity> selectList(Long userId);
List<String> selectOrderIdList(@Param("data") String data);
}

@ -40,7 +40,7 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService {
@Override
public List<IoOrderDetailCodeEntity> findByOrderId(String orderId) {
return ioOrderDetailCodeDao.selectList(new QueryWrapper<IoOrderDetailCodeEntity>().eq("orderIdFk", orderId));
return ioOrderDetailCodeDao.selectList(new QueryWrapper<IoOrderDetailCodeEntity>().eq("orderIdFk", orderId).orderByDesc("updateTime"));
}
@Override

@ -634,7 +634,7 @@ public class IoOrderServiceImpl implements IoOrderService {
filterOrderRequest.setDealStatuses(Arrays.asList(2));
break;
case Constant.ORDER_STATUS_CHECKED_ERROR:
filterOrderRequest.setStatuses(Arrays.asList(6));
filterOrderRequest.setStatuses(Arrays.asList(6,4));
filterOrderRequest.setDealStatuses(Arrays.asList(2));
break;
case Constant.ORDER_STATUS_CHECK_SUCCESS:
@ -869,6 +869,11 @@ public class IoOrderServiceImpl implements IoOrderService {
return ioOrderEntities;
}
@Override
public List<String> selectOrderIdList(String data) {
return orderDao.selectOrderIdList(data);
}
/**
*
*

@ -11,10 +11,7 @@ import com.glxp.api.dao.inout.IoOrderDao;
import com.glxp.api.dao.inout.IoOrderDetailResultDao;
import com.glxp.api.dao.inout.IoStatDayDao;
import com.glxp.api.dao.inout.IoStatOrderDao;
import com.glxp.api.entity.inout.IoOrderDetailResultEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.inout.IoStatDayEntity;
import com.glxp.api.entity.inout.IoStatOrderEntity;
import com.glxp.api.entity.inout.*;
import com.glxp.api.req.inout.FilterStatDataDetailRequest;
import com.glxp.api.service.inout.IoStatDayService;
import com.glxp.api.util.GennerOrderUtils;
@ -29,10 +26,10 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
@ -52,20 +49,27 @@ public class IoStatDayServiceImpl implements IoStatDayService {
@Resource
private SqlSessionFactory sqlSessionFactory;
@Override
public void statData(Date date) {
//汇总前一天的数据
//汇总前一天的数据9
DateTime yesterday = DateUtil.offsetDay(date, -1);
List<IoOrderDetailResultEntity> orderDetailResultEntities = ioOrderDetailResultDao.selectStatDataByTime(yesterday.toString("yyyy-MM-dd"));
List<IoStatDayEntity> dataList = new ArrayList<>();
//查询单号
List<String> orderIdFkList = new ArrayList<>();
orderIdFkList = orderDao.selectOrderIdList(yesterday.toString("yyyy-MM-dd"));
List<IoOrderDetailResultEntity> orderDetailResultEntities = new ArrayList<>();
if(orderIdFkList.size()>0){
orderDetailResultEntities = ioOrderDetailResultDao.selectStatDataByTime(orderIdFkList);
}
if (CollUtil.isNotEmpty(orderDetailResultEntities)) {
//声明用于存放汇总数据的集合
List<IoStatDayEntity> dataList = new ArrayList<>();
orderDetailResultEntities.forEach(orderDetailResultEntity -> {
//获取新的汇总数据
IoStatDayEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday);
//查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()));
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode",orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
//入库
statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount());
@ -83,6 +87,17 @@ public class IoStatDayServiceImpl implements IoStatDayService {
}
});
//汇总上一天存在上上一天不存在产品的汇总数据
//获取上上天的数据
DateTime twoDay = DateUtil.offsetDay(date, -2);
QueryWrapper<IoStatDayEntity> ew = new QueryWrapper<>();
ew.eq("year", twoDay.year());
ew.eq("quarter", twoDay.quarter());
ew.eq("month", twoDay.monthBaseOne());
ew.eq("day", twoDay.dayOfMonth());
List<IoStatDayEntity> ioStatDayEntityList=statDayDao.selectList(ew);
List<IoStatDayEntity> newOrOldDate=getNewOrOldDate(dataList,ioStatDayEntityList);
dataList.addAll(newOrOldDate);
//插入汇总记录
saveData(yesterday, dataList);
}
@ -114,7 +129,7 @@ public class IoStatDayServiceImpl implements IoStatDayService {
private IoStatDayEntity getStatData(List<IoStatDayEntity> dataList, IoOrderDetailResultEntity orderDetailResultEntity, DateTime yesterday) {
if (CollUtil.isNotEmpty(dataList)) {
for (IoStatDayEntity statDayEntity : dataList) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk())) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getDeptCode().equals(orderDetailResultEntity.getDeptCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
@ -125,6 +140,7 @@ public class IoStatDayServiceImpl implements IoStatDayService {
}
IoStatDayEntity statData = new IoStatDayEntity();
statData.setDeptCode(orderDetailResultEntity.getDeptCode());
statData.setYear(yesterday.year());
statData.setQuarter(yesterday.quarter());
statData.setMonth(yesterday.monthBaseOne());
@ -223,4 +239,26 @@ public class IoStatDayServiceImpl implements IoStatDayService {
return wrapper;
}
private List<IoStatDayEntity> getNewOrOldDate(List<IoStatDayEntity> newIoStatDayEntity, List<IoStatDayEntity> oldIoStatDayEntity){
// 计算出两个集合之间产品批次号组成的差异
List<IoStatDayEntity> IoStatDayEntityList = oldIoStatDayEntity.stream()
.filter(notComment -> {
List<IoStatDayEntity> filtered = newIoStatDayEntity.stream().filter(all ->
Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk()))
.collect(Collectors.toList());
return filtered.isEmpty();
}).collect(Collectors.toList());
for (IoStatDayEntity ioStatDayEntity : IoStatDayEntityList) {
ioStatDayEntity.setId(null);
ioStatDayEntity.setBeginCount(ioStatDayEntity.getBalanceCount());
ioStatDayEntity.setBalanceAmount(ioStatDayEntity.getBalanceAmount());
ioStatDayEntity.setBeginPrice(ioStatDayEntity.getBalancePrice());
ioStatDayEntity.setInCount(0);
ioStatDayEntity.setOutCount(0);
}
return IoStatDayEntityList;
}
}

@ -7,13 +7,11 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.inout.IoStatDayDao;
import com.glxp.api.dao.inout.IoStatMonthDao;
import com.glxp.api.dao.inout.IoStatOrderDao;
import com.glxp.api.entity.inout.IoStatDayEntity;
import com.glxp.api.entity.inout.IoStatMonthEntity;
import com.glxp.api.entity.inout.IoStatOrderEntity;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.dao.inout.*;
import com.glxp.api.entity.inout.*;
import com.glxp.api.req.inout.FilterStatDataDetailRequest;
import com.glxp.api.res.inv.DateRequest;
import com.glxp.api.service.inout.IoStatMonthService;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.OrderNoTypeBean;
@ -27,7 +25,10 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
@ -44,36 +45,65 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
private IoStatOrderDao statOrderDao;
@Resource
private SqlSessionFactory sqlSessionFactory;
@Resource
private IoOrderDao orderDao;
@Resource
private IoOrderDetailResultDao ioOrderDetailResultDao;
@Override
public void statData(Date date) {
//汇总上一个月的数据
DateTime lastMonth = DateUtil.lastMonth();
//查询上个月每天的汇总数据
List<IoStatDayEntity> statDayList = statDayDao.selectList(new QueryWrapper<IoStatDayEntity>()
.eq("year", lastMonth.year())
.eq("quarter", lastMonth.quarter())
.eq("month", lastMonth.monthBaseOne())
);
if (CollUtil.isNotEmpty(statDayList)) {
//声明用于存放汇总数据的集合
//汇总上一个月的数据
DateRequest dateRequest = getYearAndMonth(1);
DateRequest dateRequest1 = getfirstDayAndLastDay(dateRequest.getYear(), dateRequest.getMomth());
List<IoStatMonthEntity> dataList = new ArrayList<>();
statDayList.forEach(statDayEntity -> {
//获取新的汇总数据
IoStatMonthEntity statData = getStatData(dataList, statDayEntity, lastMonth);
//查询单号
List<String> orderIdFkList = new ArrayList<>();
orderIdFkList = orderDao.selectOrderfirstAndLastIdList(dateRequest1.getFirstDay(), dateRequest1.getLastDay());
List<IoOrderDetailResultEntity> orderDetailResultEntities = new ArrayList<>();
if(orderIdFkList.size()>0){
orderDetailResultEntities = ioOrderDetailResultDao.selectStatDataByTime(orderIdFkList);
}
//设置入库数据
statData.setInCount(statData.getInCount() + statDayEntity.getInCount());
statData.setInPrice(statDayEntity.getBalancePrice());
statData.setInAmount(statData.getInAmount().add(statDayEntity.getInAmount()));
//设置出库数据
statData.setOutCount(statData.getOutCount() + statDayEntity.getOutCount());
statData.setOutPrice(statDayEntity.getBalancePrice());
statData.setOutAmount(statData.getOutAmount().add(statDayEntity.getOutAmount()));
if (CollUtil.isNotEmpty(orderDetailResultEntities)) {
//声明用于存放汇总数据的集合
orderDetailResultEntities.forEach(orderDetailResultEntity -> {
//获取新的汇总数据
IoStatMonthEntity statData = getStatData(dataList, orderDetailResultEntity, lastMonth);
//查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode",orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
//入库
statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount());
if (null != orderDetailResultEntity.getPrice()) {
BigDecimal inAmount = orderDetailResultEntity.getPrice().multiply(BigDecimal.valueOf(orderDetailResultEntity.getReCount()));
statData.setInAmount(inAmount.add(statData.getInAmount()));
}
} else if (order.getMainAction().equals(ConstantType.TYPE_OUT)) {
//出库
statData.setOutCount(orderDetailResultEntity.getReCount() + statData.getOutCount());
if (null != orderDetailResultEntity.getPrice()) {
BigDecimal outAmount = orderDetailResultEntity.getPrice().multiply(BigDecimal.valueOf(orderDetailResultEntity.getReCount()));
statData.setOutAmount(outAmount.add(statData.getOutAmount()));
}
}
});
//汇总上一天存在上上一天不存在产品的汇总数据
//获取上上天的数据
DateTime twoDay = new DateTime();
QueryWrapper<IoStatMonthEntity> ew = new QueryWrapper<>();
ew.eq("year", twoDay.year());
ew.eq("quarter", twoDay.quarter());
ew.eq("month", twoDay.monthBaseOne()-2);
List<IoStatMonthEntity> ioStatMonthEntityList=statMonthDao.selectList(ew);
List<IoStatMonthEntity> newOrOldDate=getNewOrOldDate(dataList,ioStatMonthEntityList);
dataList.addAll(newOrOldDate);
//插入汇总记录
saveData(lastMonth, dataList);
}
@ -137,49 +167,51 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
*
*
* @param dataList
* @param statDayEntity
* @param orderDetailResultEntity
* @param lastMonth
* @return
*/
private IoStatMonthEntity getStatData(List<IoStatMonthEntity> dataList, IoStatDayEntity statDayEntity, DateTime lastMonth) {
private IoStatMonthEntity getStatData(List<IoStatMonthEntity> dataList, IoOrderDetailResultEntity orderDetailResultEntity, DateTime lastMonth) {
if (CollUtil.isNotEmpty(dataList)) {
for (IoStatMonthEntity statMonthEntity : dataList) {
if (statMonthEntity.getRelIdFk().equals(statDayEntity.getRelIdFk())) {
if ((StrUtil.isNotBlank(statMonthEntity.getBatchNo()) && StrUtil.isNotBlank(statDayEntity.getRelIdFk())) && statMonthEntity.getBatchNo().equals(statDayEntity.getBatchNo())) {
return statMonthEntity;
for (IoStatMonthEntity statDayEntity : dataList) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getDeptCode().equals(orderDetailResultEntity.getDeptCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
}
} else if (StrUtil.isBlank(statMonthEntity.getBatchNo()) && StrUtil.isBlank(statDayEntity.getBatchNo())) {
return statMonthEntity;
}
}
}
IoStatMonthEntity statData = new IoStatMonthEntity();
statData.setYear(lastMonth.year());
statData.setDeptCode(orderDetailResultEntity.getDeptCode());
statData.setQuarter(lastMonth.quarter());
statData.setMonth(lastMonth.monthBaseOne());
statData.setRelIdFk(statDayEntity.getRelIdFk());
statData.setNameCode(statDayEntity.getNameCode());
statData.setProductName(statDayEntity.getProductName());
statData.setGgxh(statDayEntity.getGgxh());
statData.setBatchNo(statDayEntity.getBatchNo());
statData.setRelIdFk(String.valueOf(orderDetailResultEntity.getBindRlFk()));
statData.setNameCode(orderDetailResultEntity.getNameCode());
statData.setProductName(orderDetailResultEntity.getCoName());
statData.setGgxh(orderDetailResultEntity.getSpec());
statData.setBatchNo(orderDetailResultEntity.getBatchNo());
//设置结余价格
statData.setBalancePrice(statDayEntity.getBalancePrice());
statData.setBalancePrice(orderDetailResultEntity.getPrice());
//设置初始化出入库数量和价格
statData.setInCount(0);
statData.setInPrice(statDayEntity.getInPrice());
statData.setInPrice(null == orderDetailResultEntity.getPrice() ? BigDecimal.ZERO : orderDetailResultEntity.getPrice());
statData.setInAmount(BigDecimal.ZERO);
statData.setOutCount(0);
statData.setOutPrice(statDayEntity.getOutPrice());
statData.setOutPrice(null == orderDetailResultEntity.getPrice() ? BigDecimal.ZERO : orderDetailResultEntity.getPrice());
statData.setOutAmount(BigDecimal.ZERO);
//设置期初数据
IoStatMonthEntity statMonthEntity = statMonthDao.selectOne(buildQueryWrapper(statDayEntity, lastMonth));
IoStatMonthEntity statMonthEntity = statMonthDao.selectOne(buildQueryWrapper(orderDetailResultEntity, lastMonth));
if (null == statMonthEntity) {
//第一次汇总月度数据
statData.setBeginCount(0);
statData.setBeginPrice(statDayEntity.getBalancePrice());
statData.setBeginPrice(null == orderDetailResultEntity.getPrice() ? BigDecimal.ZERO : orderDetailResultEntity.getPrice());
statData.setBeginAmount(BigDecimal.ZERO);
statData.setBalanceCount(0);
@ -190,12 +222,12 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
statData.setBeginPrice(statMonthEntity.getBalancePrice());
statData.setBeginAmount(statMonthEntity.getBalanceAmount());
statData.setBalanceCount(statDayEntity.getBalanceCount());
statData.setBalanceCount(statMonthEntity.getBalanceCount());
statData.setBalanceAmount(statMonthEntity.getBalanceAmount());
}
//设置结余价格
statData.setBalancePrice(statDayEntity.getBalancePrice());
statData.setBalancePrice(statData.getBeginPrice());
dataList.add(statData);
return statData;
@ -204,11 +236,11 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
/**
*
*
* @param statDayEntity
* @param ioOrderDetailResultEntity
* @param lastMonth
* @return
*/
private Wrapper<IoStatMonthEntity> buildQueryWrapper(IoStatDayEntity statDayEntity, DateTime lastMonth) {
private Wrapper<IoStatMonthEntity> buildQueryWrapper(IoOrderDetailResultEntity ioOrderDetailResultEntity, DateTime lastMonth) {
QueryWrapper<IoStatMonthEntity> wrapper = new QueryWrapper<>();
if (lastMonth.monthBaseOne() == 1) {
//当前汇总的记录为1月上一月份的时间取前一年的12月
@ -219,9 +251,69 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
.eq("month", lastMonth.monthBaseOne() - 1);//取上上月的数据
}
wrapper.eq("relIdFk", statDayEntity.getRelIdFk())
.eq(StrUtil.isNotBlank(statDayEntity.getBatchNo()), "batchNo", statDayEntity.getBatchNo())
.eq(StrUtil.isNotBlank(statDayEntity.getNameCode()), "nameCode", statDayEntity.getNameCode());
wrapper.eq("relIdFk", ioOrderDetailResultEntity.getBindRlFk());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getBatchNo()), "batchNo", ioOrderDetailResultEntity.getBatchNo());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "nameCode", ioOrderDetailResultEntity.getNameCode());
return wrapper;
}
private List<IoStatMonthEntity> getNewOrOldDate(List<IoStatMonthEntity> newIoStatDayEntity, List<IoStatMonthEntity> oldIoStatDayEntity) {
// 计算出两个集合之间产品批次号组成的差异
// List<IoStatMonthEntity> ioStatMonthEntityList = oldIoStatDayEntity.stream().filter(notComment -> {
// List<IoStatMonthEntity> filtered = newIoStatDayEntity.stream().filter(all -> all.getBatchNo().equals(notComment.getBatchNo()) && all.getRelIdFk().equals(notComment.getRelIdFk())).collect(Collectors.toList());
// return filtered.isEmpty();
// }).collect(Collectors.toList());
List<IoStatMonthEntity> ioStatMonthEntityList = oldIoStatDayEntity.stream()
.filter(notComment -> {
List<IoStatMonthEntity> filtered = newIoStatDayEntity.stream().filter(all ->
Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk())
&& Objects.equals(all.getDeptCode(), notComment.getDeptCode()))
.collect(Collectors.toList());
return filtered.isEmpty();
}).collect(Collectors.toList());
for (IoStatMonthEntity ioStatDayEntity : ioStatMonthEntityList) {
ioStatDayEntity.setId(null);
ioStatDayEntity.setBeginCount(ioStatDayEntity.getBalanceCount());
ioStatDayEntity.setBalanceAmount(ioStatDayEntity.getBalanceAmount());
ioStatDayEntity.setBeginPrice(ioStatDayEntity.getBalancePrice());
ioStatDayEntity.setInCount(0);
ioStatDayEntity.setOutCount(0);
}
return ioStatMonthEntityList;
}
//获取目标月份的起始和结束时间
private DateRequest getfirstDayAndLastDay(int year, int month) {
LocalDate firstDayOfMonth = LocalDate.of(year, month, 1);
LocalDate lastDayOfMonth = firstDayOfMonth.withDayOfMonth(firstDayOfMonth.lengthOfMonth());
String pattern = "yyyy-MM-dd";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
DateRequest dateRequest = new DateRequest();
dateRequest.setLastDay(firstDayOfMonth.format(formatter));
dateRequest.setFirstDay(lastDayOfMonth.format(formatter));
return dateRequest;
}
//获取指定的月份和年份
private DateRequest getYearAndMonth(int lastNum) {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR); // 获取当前年份
int month = calendar.get(Calendar.MONTH) + 1 - lastNum;
if (month < 1) { // 如果当前是一月份,则上一个月份是去年 12 月
year--;
month = 12 - month;
}
DateRequest dateRequest = new DateRequest();
dateRequest.setYear(year);
dateRequest.setMomth(month);
return dateRequest;
}
}

@ -119,7 +119,7 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
UdiProductEntity udiProductEntity = udiProductService.findByNameCode(filterUdiRelevance.getNameCode());
String udiCode = "#" + udiProductEntity.getNameCode() + "#" + obj.getProductDate() + "#" + obj.getExpireDate() +
"#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + udiProductEntity.getWarehouseCode() + "#" + udiProductEntity.getDeptCode();
"#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + "#";
udiCode = udiCode.replaceAll("#null", "#");
innerOrderPrintEntity.setUdiCode(udiCode);
invInnerOrderPrintDao.insert(innerOrderPrintEntity);
@ -288,7 +288,7 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
UdiProductEntity udiProductEntity = udiProductService.findByNameCode(filterUdiRelevance.getNameCode());
String udiCode = "#" + obj.getNameCode() + "#" + obj.getProductDate() + "#" + obj.getExpireDate() +
"#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + udiProductEntity.getWarehouseCode() + "#" + udiProductEntity.getDeptCode();
"#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + "#";
udiCode = udiCode.replaceAll("#null", "#");
innerOrderPrintEntity.setUdiCode(udiCode);
invInnerOrderPrintDao.insert(innerOrderPrintEntity);

@ -10,8 +10,10 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.auth.InvSpaceDao;
import com.glxp.api.dao.auth.InvWarehouseDao;
import com.glxp.api.dao.inv.*;
import com.glxp.api.entity.auth.InvSpace;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.inv.*;
import com.glxp.api.req.inv.AddInvPlaceOrderRequest;
@ -60,6 +62,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
private InvPreProductDetailDao invPreProductDetailDao;
@Resource
private InvPreInProductDetailDao invPreInProductDetailDao;
@Resource
private InvSpaceDao invSpaceDao;
@Override
@ -129,6 +133,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
String produceDate = null;
String expireDate = null;
String serialNo = null;
InvSpace invSpace=invSpaceDao.selectOne(new QueryWrapper<InvSpace>().eq("code", bindInvSpaceRequest.getInvSpaceCode()));
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper<InvWarehouseEntity>().eq("code", bindInvSpaceRequest.getInvCode()));
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
QueryWrapper<InvPreInProductDetailEntity> ew = new QueryWrapper<>();
@ -189,7 +194,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
InvPlaceOrderEntity orderEntity = new InvPlaceOrderEntity();
orderEntity.setId(IdUtil.getSnowflakeNextId());
orderEntity.setRecordId(recordId);
orderEntity.setType(3);
orderEntity.setType(bindInvSpaceRequest.getType());
// orderEntity.setOrderId(addInvPlaceOrderRequest.getOrderId());
orderEntity.setCreateUser(userId);
orderEntity.setCreateTime(new Date());
@ -202,6 +207,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
invPlaceOrderDetailEntity.setRecordId(recordId);
invPlaceOrderDetailEntity.setBatchNo(batchNo);
invPlaceOrderDetailEntity.setRelId(relId + "");
invPlaceOrderDetailEntity.setTopInvCode(invSpace.getInvWarehouseCode());
invPlaceOrderDetailEntity.setTopInvSpaceCode(invSpace.getCode());
invPlaceOrderDetailEntity.setNameCode(nameCode);
invPlaceOrderDetailEntity.setExpireDate(expireDate);
invPlaceOrderDetailEntity.setProduceDate(produceDate);

@ -52,6 +52,10 @@ public class InvRemindSetServiceImpl implements InvRemindSetService {
if (null != filterInvRemindSetRequest.getPage() && null != filterInvRemindSetRequest.getLimit()) {
PageHelper.offsetPage((filterInvRemindSetRequest.getPage() - 1) * filterInvRemindSetRequest.getLimit(), filterInvRemindSetRequest.getLimit());
}
if (StrUtil.isNotBlank(filterInvRemindSetRequest.getProductName())) {
filterInvRemindSetRequest.setRelIds(udiRelevanceDao.selectRelIdByName(filterInvRemindSetRequest.getProductName()));
}
List<InvRemindSetResponse> list = invRemindSetDao.filterList(filterInvRemindSetRequest);
if (CollUtil.isNotEmpty(list)) {
list.forEach(invRemindSetResponse -> {
@ -229,13 +233,13 @@ public class InvRemindSetServiceImpl implements InvRemindSetService {
if (null == udiRelevanceEntity) {
invRemindSetEntity.setStatus(0);
} else {
if (invRemindSetEntity.getLowStock() && null == udiRelevanceEntity.getLowStockNum()) {
invRemindSetEntity.setStatus(0);
} else if (invRemindSetEntity.getOverStock() && null == udiRelevanceEntity.getOverStockNum()) {
if (!invRemindSetEntity.getLowStock() && null == udiRelevanceEntity.getLowStockNum() &&
!invRemindSetEntity.getOverStock() && null == udiRelevanceEntity.getOverStockNum() &&
!invRemindSetEntity.getRecentDate() && null == udiRelevanceEntity.getRecentDateTime() &&
!invRemindSetEntity.getExpireDate() && !invRemindSetEntity.getLackStock()) {
invRemindSetEntity.setStatus(0);
} else if (invRemindSetEntity.getRecentDate() && null == udiRelevanceEntity.getRecentDateTime()) {
invRemindSetEntity.setStatus(0);
} else {
} else if (invRemindSetEntity.getLowStock() || invRemindSetEntity.getLackStock() ||
invRemindSetEntity.getOverStock() || invRemindSetEntity.getRecentDate() || invRemindSetEntity.getExpireDate()) {
invRemindSetEntity.setStatus(1);
}
}

@ -31,6 +31,7 @@ import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.idc.service.FileService;
import com.glxp.api.idc.service.IdcService;
import com.glxp.api.req.sync.SpsSyncDataRequest;
import com.glxp.api.res.inv.InnerOrderPrintResponse;
import com.glxp.api.res.sync.*;
import com.glxp.api.service.auth.*;
import com.glxp.api.service.basic.EntrustReceService;
@ -1350,6 +1351,7 @@ public class HeartService {
orderEntity.setUpdateTime(null);
orderEntity.setFromType(ConstantStatus.FROM_UDISP);
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
if (syncDataBustypeEntity != null) {
if (syncDataBustypeEntity.getSyncStatus() != null && syncDataBustypeEntity.getSyncStatus().compareTo(1) == 0) {
@ -1614,7 +1616,12 @@ public class HeartService {
supManufacturerDao.replaceBatch(supManufacturerList);
}
if (CollectionUtil.isNotEmpty(supProductList)) {
supProductDao.replaceBatch(supProductList);
List<List<SupProductEntity>> splits = CustomUtil.splitList(supProductList, 100);
if (CollUtil.isNotEmpty(splits)) {
for (List<SupProductEntity> items : splits) {
supProductDao.insertOrUpdateBatch(items);
}
}
}
if (CollUtil.isNotEmpty(syncFiles)) {
// fileService.download(syncFiles);

@ -6,6 +6,7 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.req.thrsys.FilterThrCorpRequest;
import com.glxp.api.req.thrsys.ThrUnitMaintainFilterRequest;
import com.glxp.api.res.thrsys.ThrCorpsResponse;
import com.glxp.api.res.thrsys.ThrUnitMaintainResponse;
@ -42,4 +43,5 @@ public interface ThrCorpService extends IService<ThrCorpEntity> {
*/
BaseResponse downloadThrCorp(ThrSystemDetailEntity thrSystemDetailEntity);
public BaseResponse downloadByRequest(ThrUnitMaintainFilterRequest request);
}

@ -45,7 +45,7 @@ public class ThrCorpsDlService {
ThrCorpExportLogService thrCorpExportLogService;
@Resource
private ThrCorpImportDetailService thrCorpImportDetailService;
// @Value("${SPSYNC_IP}")
// @Value("${SPSYNC_IP}")
// private String spsSyncUrl;
@Resource
ErpBasicClient erpBasicClient;
@ -353,9 +353,9 @@ public class ThrCorpsDlService {
public List<List<String>> genExcelData(FilterThrCorpRequest filterThrOrderRequest) {
List<List<String>> excelData = new ArrayList<>();
List<ThrCorpEntity> thrCorpEntityList=new ArrayList<>();
List<ThrCorpEntity> thrCorpEntityList = new ArrayList<>();
List<ThrCorpsResponse> thrCorpsResponseList = thrCorpService.filterThrCorps(filterThrOrderRequest);
if(thrCorpsResponseList.size()>0){
if (thrCorpsResponseList.size() > 0) {
thrCorpEntityList = thrCorpsResponseList.stream().map(
item -> {
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();
@ -419,12 +419,12 @@ public class ThrCorpsDlService {
exportData.addAll(thrCorpEntities);
} else {
//根据查询条件一键导出数据库往来单位
List<ThrCorpEntity> thrCorpEntityList=new ArrayList<>();
List<ThrCorpEntity> thrCorpEntityList = new ArrayList<>();
FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest();
BeanUtils.copyProperties(thrCorpExportRequest, filterThrCorpRequest);
filterThrCorpRequest.setPage(null);
List<ThrCorpsResponse> thrCorpsResponseList = thrCorpService.filterThrCorps(filterThrCorpRequest);
if(thrCorpsResponseList.size()>0){
if (thrCorpsResponseList.size() > 0) {
thrCorpEntityList = thrCorpsResponseList.stream().map(
item -> {
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();
@ -476,12 +476,12 @@ public class ThrCorpsDlService {
exportData.addAll(thrCorpEntities);
} else {
//根据查询条件一键导出数据库往来单位
List<ThrCorpEntity> thrCorpEntityList=new ArrayList<>();
List<ThrCorpEntity> thrCorpEntityList = new ArrayList<>();
FilterThrCorpRequest filterThrCorpRequest = new FilterThrCorpRequest();
BeanUtils.copyProperties(thrCorpExportRequest, filterThrCorpRequest);
filterThrCorpRequest.setPage(null);
List<ThrCorpsResponse> thrCorpsResponseList = thrCorpService.filterThrCorps(filterThrCorpRequest);
if(thrCorpsResponseList.size()>0){
if (thrCorpsResponseList.size() > 0) {
thrCorpEntityList = thrCorpsResponseList.stream().map(
item -> {
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();

@ -49,7 +49,7 @@ public interface ThrProductsService extends IService<ThrProductsEntity> {
* @param thirdSys
* @return
*/
BaseResponse uploadPi(List<MultipartFile> files, String thirdSys);
BaseResponse uploadPi(byte[] bytes, String fileName, String thirdSys);
/**
*
@ -66,4 +66,12 @@ public interface ThrProductsService extends IService<ThrProductsEntity> {
* @return
*/
BaseResponse downloadThrPi(ThrSystemDetailEntity thrSystemDetailEntity);
/**
*
*
* @param filterThrProductsRequest
* @return
*/
BaseResponse downloadByRequest(FilterThrProductsRequest filterThrProductsRequest);
}

@ -34,7 +34,7 @@ import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class ThrBusTypeOriginServiceImpl extends ServiceImpl<ThrBusTypeOriginDao,ThrBusTypeOriginEntity> implements IThrBusTypeOriginService {
public class ThrBusTypeOriginServiceImpl extends ServiceImpl<ThrBusTypeOriginDao, ThrBusTypeOriginEntity> implements IThrBusTypeOriginService {
@Resource
private CustomerService customerService;
@ -180,7 +180,7 @@ public class ThrBusTypeOriginServiceImpl extends ServiceImpl<ThrBusTypeOriginDao
if (baseResponse.getCode() == 20000) {
List<ThrSystemBusApiEntity> list = baseResponse.getData().getList();
list.forEach(item -> {
ThrBusTypeOriginEntity thrBusTypeOriginEntity = thrBusTypeOriginDao.selectOne(new QueryWrapper<ThrBusTypeOriginEntity>().eq("code", item.getCode()).eq("thirdSys", thrSystemDetailEntity.getThirdSysFk()));
ThrBusTypeOriginEntity thrBusTypeOriginEntity = thrBusTypeOriginDao.selectOne(new QueryWrapper<ThrBusTypeOriginEntity>().eq("action", item.getCode()).eq("thirdSys", thrSystemDetailEntity.getThirdSysFk()));
if (null == thrBusTypeOriginEntity) {
thrBusTypeOriginEntity = new ThrBusTypeOriginEntity();
BeanUtil.copyProperties(item, thrBusTypeOriginEntity);

@ -1,6 +1,7 @@
package com.glxp.api.service.thrsys.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
@ -47,11 +48,19 @@ public class ThrCorpServiceImpl extends ServiceImpl<ThrCorpDao, ThrCorpEntity> i
@Override
public boolean insertThrCorps(ThrCorpEntity thrCorpEntity) {
if (thrCorpEntity.getId() == null) {
thrCorpEntity.setId(IdUtil.getSnowflakeNextId());
}
return thrCorpDao.insertThrCorps(thrCorpEntity);
}
@Override
public boolean insertThrCorpss(List<ThrCorpEntity> thrCorpEntitys) {
for (ThrCorpEntity thrCorpEntity : thrCorpEntitys) {
if (thrCorpEntity.getId() == null) {
thrCorpEntity.setId(IdUtil.getSnowflakeNextId());
}
}
return thrCorpDao.insertThrCorpss(thrCorpEntitys);
}
@ -125,7 +134,51 @@ public class ThrCorpServiceImpl extends ServiceImpl<ThrCorpDao, ThrCorpEntity> i
BeanUtil.copyProperties(thrCorpsResponse, thrCorpEntity);
thrCorpEntity.setCreateTime(new Date());
thrCorpEntity.setUpdateTime(new Date());
thrCorpEntity.setId(null);
thrCorpEntity.setId(IdUtil.getSnowflakeNextId());
thrCorpEntity.setThirdSysFk(thrSystemDetailEntity.getThirdSysFk());
thrCorpDao.insertThrCorps(thrCorpEntity);
} else {
boolean isChange = verifyDataChange(thrCorpEntity, thrCorpsResponse);
if (isChange) {
thrCorpEntity.setUpdateTime(new Date());
thrCorpDao.updateThrCorps(thrCorpEntity);
}
}
});
if (list.size() >= limit) {
page++;
} else {
break;
}
} else {
return baseResponse;
}
}
return ResultVOUtils.success("下载完成");
}
@Override
public BaseResponse downloadByRequest(ThrUnitMaintainFilterRequest request) {
int page = 1;
int limit = 100;
while (true) {
request.setPage(page);
request.setLimit(limit);
request.setThirdSysFk(request.getThirdSys());
BaseResponse<PageSimpleResponse<ThrCorpsResponse>> baseResponse = erpBasicClient.getErpCrop(request);
if (baseResponse.getCode() == 20000) {
List<ThrCorpsResponse> list = baseResponse.getData().getList();
list.forEach(thrCorpsResponse -> {
ThrCorpEntity thrCorpEntity = thrCorpDao.selectByUnitIdAndThirdId(thrCorpsResponse.getUnitId(), request.getThirdSys());
if (null == thrCorpEntity) {
thrCorpEntity = new ThrCorpEntity();
BeanUtil.copyProperties(thrCorpsResponse, thrCorpEntity);
thrCorpEntity.setCreateTime(new Date());
thrCorpEntity.setUpdateTime(new Date());
thrCorpEntity.setThirdSysFk(request.getThirdSys());
thrCorpEntity.setId(IdUtil.getSnowflakeNextId());
thrCorpDao.insertThrCorps(thrCorpEntity);
} else {
boolean isChange = verifyDataChange(thrCorpEntity, thrCorpsResponse);

@ -29,7 +29,7 @@ import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class ThrInvWarehouseServiceImpl extends ServiceImpl<ThrInvWarehouseDao,ThrInvWarehouseEntity> implements ThrInvWarehouseService {
public class ThrInvWarehouseServiceImpl extends ServiceImpl<ThrInvWarehouseDao, ThrInvWarehouseEntity> implements ThrInvWarehouseService {
@Resource
private ThrInvWarehouseDao thrInvWarehouseDao;

@ -130,8 +130,8 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
}
@Override
public BaseResponse uploadPi(List<MultipartFile> files, String thirdSys) {
BaseResponse<PostThrProductsRequest> baseResponse = erpBasicClient.uploadPi(files, thirdSys);
public BaseResponse uploadPi(byte[] bytes, String fileName, String thirdSys) {
BaseResponse<PostThrProductsRequest> baseResponse = erpBasicClient.uploadPi(bytes, fileName, thirdSys);
if (baseResponse.getCode() == 20000) {
return ResultVOUtils.success("导入成功");
} else {
@ -153,10 +153,11 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
thrProductsEntity.setThirdSysFk(postThrProductsRequest.getThirdSys());
thrProductsEntity.setCreateTime(DateUtil.date(new Date()));
thrProductsEntity.setUpdateTime(DateUtil.date(new Date()));
thrProductsEntity.setId(IdUtil.getSnowflakeNextId());
try {
mapper.insertThrProducts(thrProductsEntity);
} catch (Exception e) {
e.printStackTrace();
log.error("", e);
}
});
@ -176,7 +177,6 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
request.setLimit(limit);
while (true) {
request.setPage(page);
BaseResponse<PageSimpleResponse<ThrProductsResponse>> baseResponse = erpBasicClient.getErpProducts(request);
if (baseResponse.getCode() == 20000) {
List<ThrProductsResponse> list = baseResponse.getData().getList();
@ -186,21 +186,76 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
thrProductsEntity = new ThrProductsEntity();
BeanUtil.copyProperties(item, thrProductsEntity);
thrProductsEntity.setCreateTime(new Date());
if (StrUtil.isEmpty(item.getSpec())) {
thrProductsEntity.setSpec(item.getStandard());
}
thrProductsEntity.setUpdateTime(new Date());
thrProductsEntity.setId(IdUtil.getSnowflakeNextId());
thrProductsEntity.setThirdSysFk(thrSystemDetailEntity.getThirdSysFk());
thrProductsDao.insertThrProducts(thrProductsEntity);
} else {
boolean isChange = verifyDataChange(thrProductsEntity, item);
if (isChange) {
BeanUtil.copyProperties(item,thrProductsEntity,new CopyOptions().setIgnoreNullValue(true));
BeanUtil.copyProperties(item, thrProductsEntity, new CopyOptions().setIgnoreNullValue(true));
thrProductsEntity.setUpdateTime(new Date());
if (StrUtil.isEmpty(thrProductsEntity.getSpec())) {
thrProductsEntity.setSpec(thrProductsEntity.getStandard());
}
thrProductsDao.updateEntityById(thrProductsEntity);
}
}
});
if (list.size() >= limit && !baseResponse.getData().getTotal().equals(-666)) {
page++;
} else {
break;
}
} else {
return ResultVOUtils.error(500, "下载第三方系统产品信息异常");
}
}
return ResultVOUtils.success("下载成功");
}
if (list.size() >= limit) {
@Override
public BaseResponse downloadByRequest(FilterThrProductsRequest filterThrProductsRequest) {
int page = 1;
int limit = 200;
filterThrProductsRequest.setThirdSysFk(filterThrProductsRequest.getThirdSys());
filterThrProductsRequest.setLimit(limit);
log.error("开始下载-------");
while (true) {
log.error("下载分页-------" + page);
filterThrProductsRequest.setPage(page);
BaseResponse<PageSimpleResponse<ThrProductsResponse>> baseResponse = erpBasicClient.getErpProducts(filterThrProductsRequest);
if (baseResponse.getCode() == 20000) {
List<ThrProductsResponse> list = baseResponse.getData().getList();
list.forEach(item -> {
ThrProductsEntity thrProductsEntity = thrProductsDao.selectByCodeAndThird(item.getCode(), item.getThirdSys());
if (null == thrProductsEntity) {
thrProductsEntity = new ThrProductsEntity();
BeanUtil.copyProperties(item, thrProductsEntity);
thrProductsEntity.setCreateTime(new Date());
thrProductsEntity.setUpdateTime(new Date());
if (StrUtil.isEmpty(item.getSpec())) {
thrProductsEntity.setSpec(item.getStandard());
}
thrProductsEntity.setId(IdUtil.getSnowflakeNextId());
thrProductsEntity.setThirdSysFk(filterThrProductsRequest.getThirdSys());
thrProductsDao.insertThrProducts(thrProductsEntity);
} else {
boolean isChange = verifyDataChange(thrProductsEntity, item);
if (isChange) {
BeanUtil.copyProperties(item, thrProductsEntity, new CopyOptions().setIgnoreNullValue(true));
thrProductsEntity.setUpdateTime(new Date());
if (StrUtil.isEmpty(thrProductsEntity.getSpec())) {
thrProductsEntity.setSpec(thrProductsEntity.getStandard());
}
thrProductsDao.updateEntityById(thrProductsEntity);
}
}
});
if (list.size() >= limit && !baseResponse.getData().getTotal().equals(-666)) {
page++;
} else {
break;
@ -209,6 +264,7 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
return ResultVOUtils.error(500, "下载第三方系统产品信息异常");
}
}
log.error("下载结束-------");
return ResultVOUtils.success("下载成功");
}
@ -226,7 +282,10 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
//将关键字段的值设置为新数据的值
thrProductsEntity.setName(thrProductsResponse.getName());
thrProductsEntity.setMeasname(thrProductsResponse.getMeasname());
thrProductsEntity.setSpec(thrProductsResponse.getSpec());
if (StrUtil.isEmpty(thrProductsResponse.getSpec())) {
thrProductsEntity.setSpec(thrProductsResponse.getStandard());
}
thrProductsEntity.setRegisterNo(thrProductsResponse.getRegisterNo());
thrProductsEntity.setManufactory(thrProductsResponse.getManufactory());
thrProductsEntity.setCplb(thrProductsResponse.getCplb());
@ -249,6 +308,8 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
thrProductsEntity.setRemark2(thrProductsResponse.getRemark2());
thrProductsEntity.setRemark3(thrProductsResponse.getRemark3());
thrProductsEntity.setPrice(thrProductsResponse.getPrice());
thrProductsEntity.setManufactoryCode(thrProductsResponse.getManufactoryCode());
thrProductsEntity.setSupCode(thrProductsResponse.getSupCode());
//比对更新完的对象和原对象是否发生变化,若有变化则说明书有更新
return !thrProductsEntity.equals(oldData);

@ -3,7 +3,9 @@ package com.glxp.api.task;
import cn.hutool.core.thread.ThreadUtil;
import com.glxp.api.dao.schedule.ScheduledDao;
import com.glxp.api.dao.schedule.SystemParamConfigDao;
import com.glxp.api.entity.system.ScheduledEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.req.system.ScheduledRequest;
import com.glxp.api.service.inout.IoStatDayService;
import com.glxp.api.service.inout.IoStatMonthService;
@ -17,6 +19,8 @@ import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
@ -36,6 +40,8 @@ public class IoStatOrderTask implements SchedulingConfigurer {
private IoStatQuarterService statQuarterService;
@Resource
private IoStatYearService statYearService;
@Resource
private SystemParamConfigDao systemParamConfigDao;
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
@ -53,7 +59,15 @@ public class IoStatOrderTask implements SchedulingConfigurer {
}
private void process() {
Date today = new Date();
SystemParamConfigEntity systemParamConfigEntity=systemParamConfigDao.selectByParamKey("date");
String name=systemParamConfigEntity.getParamValue();
Date today1 = new Date();
try {
today1 = new SimpleDateFormat("yyyy-MM-dd").parse(name);
} catch (ParseException e) {
e.printStackTrace();
}
Date today = today1;
//判断起始时间,设置生成递进顺序,保证日汇总数据优先生成,否则后续数据的源数据会发生缺失,导致计算错误
if (DateUtil.isYearStart(today)) {
//年初第一天,依次生成 日 -> 月 -> 季度 -> 年度 汇总数据

@ -6,8 +6,12 @@ import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.glxp.api.constant.ThirdSysConstant;
import com.glxp.api.dao.schedule.ScheduledDao;
import com.glxp.api.dao.system.SyncDataSetDao;
import com.glxp.api.dao.thrsys.ThrSystemDetailDao;
import com.glxp.api.entity.system.ScheduledEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.req.system.ScheduledRequest;
import com.glxp.api.res.thrsys.ThirdSysInterfaceExecuteVo;
import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.thrsys.IThrBusTypeOriginService;
@ -16,7 +20,12 @@ import com.glxp.api.service.thrsys.ThrInvWarehouseService;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -24,13 +33,10 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
/**
*
* 线
*/
@Slf4j
@Component
public class ThirdSysInterfaceTask {
@EnableScheduling
@Slf4j
public class SyncThirdSysTask implements SchedulingConfigurer {
/**
* redis key
@ -39,21 +45,6 @@ public class ThirdSysInterfaceTask {
private volatile ExecutorService executor;
/**
* 线
*
* @return
*/
private ExecutorService getExecutor() {
if (null == executor) {
synchronized (this) {
log.info("初始化第三方系统接口执行线程池");
executor = ThreadUtil.newExecutor(10, 100, Integer.MAX_VALUE);
}
}
return executor;
}
@Resource
private RedisUtil redisUtil;
@Resource
@ -69,8 +60,46 @@ public class ThirdSysInterfaceTask {
@Resource
private IoOrderService orderService;
@Scheduled(fixedRate = 20 * 1000, initialDelay = 60 * 1000)
public void scanInterface() {
final Logger logger = LoggerFactory.getLogger(SyncHeartTask.class);
@Resource
protected ScheduledDao scheduledDao;
@Resource
private SyncDataSetDao syncDataSetDao;
@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
scheduledTaskRegistrar.addTriggerTask(() -> process(),
triggerContext -> {
ScheduledRequest scheduledRequest = new ScheduledRequest();
scheduledRequest.setCronName("dlThrSysHeartTask");
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
if (scheduledEntity != null) {
String cron = scheduledEntity.getCron();
if (cron.isEmpty()) {
logger.error("cron is null");
}
return new CronTrigger(cron).nextExecutionTime(triggerContext);
} else
return null;
});
}
private ExecutorService getExecutor() {
if (null == executor) {
synchronized (this) {
log.info("初始化第三方系统接口执行线程池");
executor = ThreadUtil.newExecutor(10, 100, Integer.MAX_VALUE);
}
}
return executor;
}
private void process() {
log.info("开始扫描自动执行的第三方接口列表");
List<ThrSystemDetailEntity> list = thrSystemDetailDao.selectAutoExecuteList();
if (CollUtil.isNotEmpty(list)) {
@ -107,6 +136,7 @@ public class ThirdSysInterfaceTask {
}
}
/**
*
*
@ -243,11 +273,20 @@ public class ThirdSysInterfaceTask {
return false;
}
long nextTime = DateUtil.offsetMonth(new Date(), thrSystemDetailEntity.getTime()).getTime();
if (vo != null) {
if (vo.getNextTime() - new Date().getTime() > thrSystemDetailEntity.getTime() * 1000 * 60) {
log.info("定时任务时间未到", taskKey);
return false;
} else {
return true;
}
} else {
vo = Optional.ofNullable(vo).orElse(new ThirdSysInterfaceExecuteVo());
vo.setKey(taskKey);
vo.setNextTime(nextTime);
vo.setFinished(false);
redisUtil.set(taskKey, vo);
}
return true;
}
@ -288,4 +327,5 @@ public class ThirdSysInterfaceTask {
return key;
}
}

@ -20,24 +20,36 @@ public class UdiCalCountUtil {
// }
public int getActCount(UdiRelevanceResponse udiRelevanceResponse) {
int actCount;
if (!udiRelevanceResponse.getUseDy() && (udiRelevanceResponse.getDiType() == null || udiRelevanceResponse.getDiType() != 2)) {
if (udiRelevanceResponse.getBhzxxsbzsl() == 0) {
actCount = udiRelevanceResponse.getZxxsbzbhsydysl();
} else {
//启用使用单元
if (udiRelevanceResponse.getUseDy()) {
if (udiRelevanceResponse.getDiType() == 1) {
if (udiRelevanceResponse.getZxxsbzbhsydysl() == null || udiRelevanceResponse.getZxxsbzbhsydysl() == 0) {
udiRelevanceResponse.setZxxsbzbhsydysl(1);
}
return udiRelevanceResponse.getZxxsbzbhsydysl();
} else if (udiRelevanceResponse.getDiType() == 4) {
if (udiRelevanceResponse.getBhzxxsbzsl() == 0) {
udiRelevanceResponse.setBhzxxsbzsl(1);
}
if (udiRelevanceResponse.getZxxsbzbhsydysl() == null || udiRelevanceResponse.getZxxsbzbhsydysl() == 0) {
udiRelevanceResponse.setZxxsbzbhsydysl(1);
}
actCount = udiRelevanceResponse.getBhzxxsbzsl() * udiRelevanceResponse.getZxxsbzbhsydysl();
return udiRelevanceResponse.getBhzxxsbzsl() * udiRelevanceResponse.getZxxsbzbhsydysl();
} else {
return udiRelevanceResponse.getBhzxxsbzsl();
}
} else {//不启用使用单元
if (udiRelevanceResponse.getDiType() == 1) {
return 1;
} else if (udiRelevanceResponse.getDiType() == 4) {
if (udiRelevanceResponse.getBhzxxsbzsl() == 0) {
udiRelevanceResponse.setBhzxxsbzsl(1);
}
return udiRelevanceResponse.getBhzxxsbzsl();
} else {
actCount = udiRelevanceResponse.getBhzxxsbzsl();
return udiRelevanceResponse.getBhzxxsbzsl();
}
}
return actCount;
}
public int getActCount(IoCodeTempEntity codeTempEntity) {

@ -345,6 +345,9 @@
<if test="isDisable == false">
AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false)
</if>
<if test="isDisable == true">
AND basic_udirel.isDisable = true
</if>
<if test="thrPiId != '' and thrPiId != null">
and (thirdId LIKE concat('%', #{thrPiId}, '%')
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
@ -1253,4 +1256,17 @@
</where>
limit 1
</select>
<select id="selectRelIdByName" resultType="java.lang.String">
SELECT
b2.id
FROM
basic_products b1
LEFT JOIN basic_udirel b2 ON b1.uuid = b2.uuid
<where>
<if test="productName != '' and productName != null">
AND b1.cpmctymc like concat('%', #{productName}, '%')
</if>
</where>
</select>
</mapper>

@ -54,10 +54,12 @@
AND relKey = #{relKey}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d')
</if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d')
AND date_format(auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and
date_format(#{endAduditTime}, '%Y-%m-%d')
</if>
<if test="actions != null and actions.size() != 0">
AND `action` in
@ -435,4 +437,23 @@
</trim>
WHERE billNo = #{billNo}
</update>
<select id="selectOrderIdList" resultType="java.lang.String">
SELECT billNo
FROM io_order
LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action
WHERE basic_bussiness_type.inStock = 1
and io_order.`status` = 7
AND date_format(io_order.updateTime, '%Y-%m-%d') = date_format(#{data},'%Y-%m-%d')
</select>
<select id="selectOrderfirstAndLastIdList" resultType="java.lang.String">
SELECT billNo
FROM io_order
LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action
WHERE basic_bussiness_type.inStock = 1
and io_order.`status` = 7
AND date_format(io_order.updateTime, '%Y-%m-%d') between date_format(#{lastData}, '%Y-%m-%d') and
date_format(#{firstData}, '%Y-%m-%d')
</select>
</mapper>

@ -33,7 +33,8 @@
<update id="updateCount">
update io_order_detail_code
set count = #{count},
reCount = #{reCount}
reCount = #{reCount},
updateTime = #{updateTime}
where id = #{id}
</update>

@ -84,9 +84,18 @@
coName,
spec,
price,
reCount
reCount,
io_order.deptCode
from io_order_detail_result
where orderIdFk in
(select billNo from io_order where date_format(updateTime, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d'))
left JOIN io_order on io_order.billNo=io_order_detail_result.orderIdFk
<where>
<if test="list != null and list.size() > 0 ">
orderIdFk in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inout.IoStatDayDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDayEntity">
select *
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_day.deptCode = auth_dept.CODE ) deptName
from io_stat_day
<where>
<if test="recordKey != null and recordKey != ''">

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inout.IoStatMonthDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatMonthEntity">
select *
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_month.deptCode = auth_dept.CODE ) deptName
from io_stat_month
<where>
<if test="recordKey != null and recordKey != ''">

@ -12,6 +12,7 @@
(select employeeName from auth_user where id = t.createUser) operatorName,
(select name from auth_warehouse where code = t2.invCode) invName,
(select name from auth_space where code = t2.invSpaceCode) invSpaceName,
(select name from auth_space where code = t2.topInvSpaceCode) topInvSpaceName,
t.createTime,
t2.code,
t2.batchNo,

@ -158,7 +158,8 @@
auth_warehouse.name invName,
asp.name spaceName,
ipp.deptCode,
ipp.invCode
ipp.invCode,
basic_udirel.id relIdFk
from inv_prein_product_detail ipp
inner join basic_udirel on ipp.relId = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid

@ -54,6 +54,13 @@
<if test="type != null and type != ''">
AND type = #{type}
</if>
<if test="listInv != null and listInv.size() != 0">
and irm.invCode in
<foreach collection="listInv" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
order by irm.updateTime desc
</select>

@ -38,6 +38,13 @@
<if test="status != null">
AND irs.status = #{status}
</if>
<if test="relIds != null">
AND irs.relId IN
<foreach collection="relIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
order by irs.updateTime desc
</select>

@ -68,7 +68,7 @@
AND emergency = #{emergency}
</if>
</where>
order by pur_apply.updateTime desc
</select>
<insert id="insert" keyProperty="id" keyColumn="id"

@ -97,5 +97,6 @@
AND emergency = #{emergency}
</if>
</where>
order by pur_order.updateTime desc
</select>
</mapper>

@ -62,7 +62,7 @@
AND emergency = #{emergency}
</if>
</where>
order by pur_plan.updateTime desc
</select>
<insert id="insert" keyProperty="id"

@ -26,12 +26,12 @@
</select>
<insert id="insertThrCorps" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrCorpEntity">
<insert id="insertThrCorps" parameterType="com.glxp.api.entity.thrsys.ThrCorpEntity">
replace
INTO thr_corp
(unitId, name, spell, addr, creditNo,
(id, unitId, name, spell, addr, creditNo,
contact, mobile, thirdSysFk, updateTime, createUser, createTime, updateUser, remark)
values (#{unitId},
values (#{id}, #{unitId},
#{name},
#{spell},
#{addr},
@ -48,13 +48,13 @@
<insert id="insertThrCorpss" keyProperty="id" parameterType="java.util.List">
replace INTO thr_corp
(unitId, name, spell, addr, creditNo,
(id, unitId, name, spell, addr, creditNo,
contact, mobile, thirdSysFk, updateTime, createUser, createTime, updateUser, remark)
values
<foreach collection="thrCorpEntitys" item="item" index="index"
separator=",">
(#{item.unitId},
(#{item.id}, #{item.unitId},
#{item.name},
#{item.spell},
#{item.addr},

@ -41,27 +41,33 @@
<select id="selectByThrDeptCode" parameterType="com.glxp.api.req.thrsys.FilterThrSubInvWarehouseRequest"
resultType="com.glxp.api.entity.thrsys.ThrInvWarehouseEntity">
select * from thr_inv_warehouse
select *
from thr_inv_warehouse
<where>
parentId not in (SELECT code FROM thr_dept
where status=#{status} and thirdSysFk=#{thirdSysFk}) and thirdSysFk=#{thirdSysFk}
<if test=" name != '' and name != null">
and name like concat('%',#{name},'%')
parentId not in (SELECT code
FROM thr_dept
where status = #{status}
and thirdSysFk = #{thirdSysFk})
and thirdSysFk = #{thirdSysFk}
<if test="name != '' and name != null">
and name like concat('%', #{name}, '%')
</if>
</where>
</select>
<select id="countSubInvByParentInvId" resultType="java.lang.Integer">
select count(*) from thr_inv_warehouse where
parentId = (select code from thr_dept where id = #{parentInvId})
select count(*)
from thr_inv_warehouse
where parentId = (select code from thr_dept where id = #{parentInvId})
</select>
<select id="filterThrInvWarehouseResponse"
resultType="com.glxp.api.res.thrsys.ThrInvWarehouseResponse">
select t1.*, t2.name as parentName from thr_inv_warehouse t1
select t1.*, t2.name as parentName
from thr_inv_warehouse t1
left join thr_dept t2
on t2.code =t1.parentId
on t2.code = t1.parentId
<where>
<if test="id != '' and id != null">
AND t1.id = #{id}
@ -86,25 +92,22 @@
replace
INTO thr_inv_warehouse
(id, code, `name`, parentId, remark, thirdSysFk, updateTime)
values (
#{id},
values (#{id},
#{code},
#{name},
#{parentId},
#{remark},
#{thirdSysFk},
#{updateTime}
)
#{updateTime})
</insert>
<insert id="insertThrInvWarehouses" parameterType="java.util.List">
replace INTO thr_inv_warehouse
(id, code, `name`, parentId, remark, thirdSysFk,updateTime)
(id, code, `name`, parentId, remark, thirdSysFk, updateTime)
VALUES
<foreach collection="thrInvWarehouseEntitys" item="item" index="index"
separator=",">
(
#{item.id}, #{item.code},
(#{item.id}, #{item.code},
#{item.name}, #{item.parentId},
#{item.remark}, #{item.thirdSysFk}, #{item.updateTime})
</foreach>
@ -119,18 +122,32 @@
<update id="updateThrInvWarehouse" parameterType="com.glxp.api.entity.thrsys.ThrInvWarehouseEntity">
UPDATE thr_inv_warehouse
<trim prefix="set" suffixOverrides=",">
<if test="name != null">`name`=#{name},</if>
<if test="code != null">code=#{code},</if>
<if test="parentId != null">parentId=#{parentId},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="name != null">
`name`=#{name},
</if>
<if test="code != null">
code=#{code},
</if>
<if test="parentId != null">
parentId=#{parentId},
</if>
<if test="remark != null">
remark=#{remark},
</if>
<if test="thirdSysFk != null">
thirdSysFk=#{thirdSysFk},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
</trim>
WHERE id = #{id}
</update>
<select id="selectByLastTime" resultType="com.glxp.api.entity.thrsys.ThrInvWarehouseEntity">
select * from thr_inv_warehouse where updateTime >= #{lastUpdateTime}
select *
from thr_inv_warehouse
where updateTime >= #{lastUpdateTime}
</select>
<select id="selectByCodeAndThirdId" resultType="com.glxp.api.entity.thrsys.ThrInvWarehouseEntity">
@ -144,5 +161,6 @@
AND thirdSysFk = #{thirdId}
</if>
</where>
limit 1
</select>
</mapper>

@ -6,7 +6,7 @@
resultType="com.glxp.api.entity.thrsys.ThrOrderEntity">
SELECT thr_order.*, thr_bustype_origin.name billTypeName
FROM thr_order
left join thr_bustype_origin on thr_order.billType = thr_bustype_origin.action
LEFT JOIN thr_bustype_origin ON thr_order.billType = thr_bustype_origin.action
<where>
<if test="billNo != '' and billNo != null">
AND billNo = #{billNo}
@ -15,7 +15,7 @@
AND thr_order.id = #{id}
</if>
<if test="billAction != '' and billAction != null">
AND billType = #{billAction}
AND thr_bustype_origin.action = #{billAction}
</if>
<if test="billFlag != '' and billFlag != null">
AND billFlag = #{billFlag}

@ -1,36 +1,37 @@
<?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.glxp.api.dao.thrsys.ThrProductsDao">
<select id="filterThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
SELECT * FROM thr_products
SELECT *
FROM thr_products
<where>
<if test="name != '' and name != null">
AND name LIKE concat('%',#{name},'%')
AND name LIKE concat('%', #{name}, '%')
</if>
<if test="code != '' and code != null">
AND code LIKE concat('%',#{code},'%')
AND code LIKE concat('%', #{code}, '%')
</if>
<if test="sptm != '' and sptm != null">
AND sptm LIKE concat('%',#{sptm},'%')
AND sptm LIKE concat('%', #{sptm}, '%')
</if>
<if test="ybbm != '' and ybbm != null">
AND ybbm LIKE concat('%',#{ybbm},'%')
AND ybbm LIKE concat('%', #{ybbm}, '%')
</if>
<if test="registerNo != '' and registerNo != null">
AND registerNo LIKE concat('%',#{registerNo},'%')
AND registerNo LIKE concat('%', #{registerNo}, '%')
</if>
<if test="manufactory != '' and manufactory != null">
AND manufactory LIKE concat('%',#{manufactory},'%')
AND manufactory LIKE concat('%', #{manufactory}, '%')
</if>
<if test="spec != '' and spec != null">
AND spec LIKE concat('%',#{spec},'%')
AND spec LIKE concat('%', #{spec}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE
concat('%',#{unionCode},'%')
or code LIKE concat('%', #{unionCode}, '%')
or sptm LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE
concat('%', #{unionCode}, '%')
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
@ -39,16 +40,19 @@
AND thirdSysFk = #{thirdSys}
</if>
<if test="supName != '' and supName != null">
AND supName LIKE concat('%',#{supName},'%')
AND supName LIKE concat('%', #{supName}, '%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="filterThrProducts1" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
SELECT * FROM thr_products
SELECT *
FROM thr_products
<where>
<if test="name != '' and name != null">
AND name = #{name}
@ -57,22 +61,24 @@
AND code = #{code}
</if>
<if test="sptm != '' and sptm != null">
AND sptm= #{sptm}
AND sptm = #{sptm}
</if>
<if test="ybbm != '' and ybbm != null">
AND ybbm = #{ybbm}
</if>
<if test="registerNo != '' and registerNo != null">
AND registerNo= #{registerNo}
AND registerNo = #{registerNo}
</if>
<if test="manufactory != '' and manufactory != null">
AND manufactory= #{manufactory}
AND manufactory = #{manufactory}
</if>
<if test="spec != '' and spec != null">
AND spec = #{spec}
</if>
<if test="unionCode != '' and unionCode != null">
or code LIKE = #{unionCode} or sptm = #{unionCode} or ybbm LIKE
or code LIKE = #{unionCode}
or sptm = #{unionCode}
or ybbm LIKE
= #{unionCode}
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
@ -84,8 +90,10 @@
<if test="supName != '' and supName != null">
AND supName LIKE = #{supName}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
@ -93,33 +101,36 @@
<select id="filterJoinThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.res.thrsys.ThrProductsResponse">
SELECT thr_products.*,thr_system.thirdName thirdSysName FROM thr_products
SELECT thr_products.*, thr_system.thirdName thirdSysName
FROM thr_products
LEFT JOIN thr_system on thr_products.thirdSysFk = thr_system.thirdId
<where>
<if test="name != '' and name != null">
AND name LIKE concat('%',#{name},'%')
AND name LIKE concat('%', #{name}, '%')
</if>
<if test="code != '' and code != null">
AND code LIKE concat('%',#{code},'%')
AND code LIKE concat('%', #{code}, '%')
</if>
<if test="sptm != '' and sptm != null">
AND sptm LIKE concat('%',#{sptm},'%')
AND sptm LIKE concat('%', #{sptm}, '%')
</if>
<if test="ybbm != '' and ybbm != null">
AND ybbm LIKE concat('%',#{ybbm},'%')
AND ybbm LIKE concat('%', #{ybbm}, '%')
</if>
<if test="registerNo != '' and registerNo != null">
AND registerNo LIKE concat('%',#{registerNo},'%')
AND registerNo LIKE concat('%', #{registerNo}, '%')
</if>
<if test="manufactory != '' and manufactory != null">
AND manufactory LIKE concat('%',#{manufactory},'%')
AND manufactory LIKE concat('%', #{manufactory}, '%')
</if>
<if test="spec != '' and spec != null">
AND spec LIKE concat('%',#{spec},'%')
AND spec LIKE concat('%', #{spec}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE
concat('%',#{unionCode},'%')
or code LIKE concat('%', #{unionCode}, '%')
or sptm LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE
concat('%', #{unionCode}, '%')
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
@ -128,10 +139,12 @@
AND thirdSysFk = #{thirdSys}
</if>
<if test="supName != '' and supName != null">
AND supName LIKE concat('%',#{supName},'%')
AND supName LIKE concat('%', #{supName}, '%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
@ -154,11 +167,11 @@
parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
replace
INTO thr_products
(id,code, `name`, measname, spec, registerNo, manufactory,
(id, code, `name`, measname, spec, registerNo, manufactory,
cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms,
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price,createUser,createTime,updateUser)
values (
#{id},
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,
price, createUser, createTime, updateUser, manufactoryCode, supCode)
values (#{id},
#{code},
#{name},
#{measname},
@ -189,12 +202,13 @@
#{price},
#{createUser},
#{createTime},
#{updateUser}
)
#{updateUser}, #{manufactoryCode}, #{supCode})
</insert>
<select id="selectByLastTime" resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
select * from thr_products where updateTime >= #{lastUpdateTime}
select *
from thr_products
where updateTime >= #{lastUpdateTime}
</select>
<insert id="insertThrProductsList">
@ -202,8 +216,9 @@
INTO thr_products
(code, `name`, measname, spec, registerNo, manufactory,
cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms,
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3, price,
createUser, createTime, updateUser)
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,
price,
createUser, createTime, updateUser, manufactoryCode, supCode)
values
<foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
#{item.code},
@ -236,7 +251,7 @@
#{item.price},
#{item.createUser},
#{item.createTime},
#{item.updateUser}
#{item.updateUser}, #{manufactoryCode}, #{supCode}
</foreach>
</insert>
@ -268,7 +283,9 @@
remark1,
remark2,
remark3,
price
price,
manufactoryCode,
supCode
from thr_products
<where>
<if test="code != null and code != ''">
@ -309,7 +326,9 @@
remark1 = #{remark1,jdbcType=VARCHAR},
remark2 = #{remark2,jdbcType=VARCHAR},
remark3 = #{remark3,jdbcType=VARCHAR},
price = #{price,jdbcType=VARCHAR}
price = #{price,jdbcType=VARCHAR},
manufactoryCode = #{manufactoryCode,jdbcType=VARCHAR},
supCode = #{supCode,jdbcType=VARCHAR}
</set>
where id = #{id,jdbcType=INTEGER}
</update>

@ -444,9 +444,38 @@ CALL Pro_Temp_ColumnWork('io_code', 'preInSpaceCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('pur_order_detail', 'price', 'decimal(10, 2)', 1);
INSERT ignore INTO `sys_pdf_template_relevance_label`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`, `localAction`, `remark1`, `remark2`, `remark3`, `printType`, `modelKey`) VALUES (1, 30, 110, 0, 9, '内部码打印', NULL, NULL, NULL, NULL, 'lable');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`, `localAction`, `remark1`, `remark2`, `remark3`, `printType`, `modelKey`) VALUES (1, 31, 110, 0, NULL, '配送企业资质打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`, `localAction`, `remark1`, `remark2`, `remark3`, `printType`, `modelKey`) VALUES (2, 32, 110, 0, NULL, '生产企业资质打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`, `localAction`, `remark1`, `remark2`, `remark3`, `printType`, `modelKey`) VALUES (3, 33, 110, 0, NULL, '配送产品资质打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`, `localAction`, `remark1`, `remark2`, `remark3`, `printType`, `modelKey`) VALUES (4, 33, 110, 0, NULL, '库存报表打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`, `localAction`, `remark1`, `remark2`, `remark3`, `printType`, `modelKey`) VALUES (5, 33, 110, 0, NULL, '内部码报表打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_label`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`,
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (1, 30, 110, 0, 9, '内部码打印', NULL, NULL, NULL, NULL, 'lable');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`,
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (1, 31, 110, 0, NULL, '配送企业资质打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`,
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (2, 32, 110, 0, NULL, '生产企业资质打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`,
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (3, 33, 110, 0, NULL, '配送产品资质打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`,
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (4, 33, 110, 0, NULL, '库存报表打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `customerId`, `adminId`, `moduleId`,
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (5, 33, 110, 0, NULL, '内部码报表打印', NULL, NULL, NULL, NULL, 'reportForms');
INSERT ignore INTO `sys_scheduled`(`id`, `cronName`, `cron`, `customerId`, `remark`)
VALUES (140, 'dlThrSysHeartTask', '0 0/1 * * * ?', NULL, '第三方接口同步心跳');
CALL Pro_Temp_ColumnWork('io_stat_day', 'deptCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_month', 'deptCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_quarter', 'deptCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_year', 'deptCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_code', 'updateTime', 'datetime', 1);
Loading…
Cancel
Save