Merge remote-tracking branch 'origin/orderChange' into orderChange

# Conflicts:
#	api-admin/src/main/java/com/glxp/api/admin/service/business/impl/StockOrderServiceImpl.java
feature-order-fix
郑明梁 2 years ago
commit 77957dc94a

@ -0,0 +1,81 @@
package com.glxp.api.admin.config;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.lang.UUID;
import com.glxp.api.admin.dao.info.DbVersionDao;
import com.glxp.api.admin.entity.info.DbVersionEntity;
import com.glxp.api.admin.entity.info.SchemaData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Order(1)
@Component
@Slf4j
public class HdSchemaExecutor implements ApplicationRunner {
@Resource
DbVersionDao hdCommonDao;
private List<SchemaData> schema = new ArrayList<>();
@Override
public void run(ApplicationArguments args) throws Exception {
//初始版本列表
buildSchemas();
//定义sql文件路径
String basePath = "schemas/";
//非版本控制,初始化脚本
ClassLoader loader = this.getClass().getClassLoader();
//通过流的方式获取项目路径下的文件
InputStream inputStream = loader.getResourceAsStream(basePath + "init.sql");
//获取文件内容
String sql = IoUtil.readUtf8(inputStream);
try {
//判断版本表是否存在
int count = hdCommonDao.selectTableExist("hd_version");
if (count == 0) {
hdCommonDao.updateSql(sql);
}
for (SchemaData schemaData : schema) {
//查询版本记录是否存在
count = hdCommonDao.selectVersion(schemaData.getVersion());
if (count == 0) {
log.info("--------------执行数据脚本,版本:" + schemaData.getVersion());
//获取对应sql脚本
inputStream = loader.getResourceAsStream(basePath + schemaData.getFileName());
sql = IoUtil.readUtf8(inputStream);
hdCommonDao.updateSql(sql);
DbVersionEntity entity = new DbVersionEntity();
entity.setId(UUID.randomUUID().toString());
entity.setVersion(schemaData.getVersion());
entity.setCreated(new Date());
entity.setRemark(schemaData.getFileName());
//写入版本记录
hdCommonDao.insertVersion(entity);
}
}
} catch (IORuntimeException e) {
e.printStackTrace();
} finally {
//关闭流
inputStream.close();
}
}
public void buildSchemas() {
schema.add(new SchemaData("v2.1", "schema_v2.1.sql"));
// schema.add(new SchemaData("v2.2", "schema_v2.2.sql"));
// schema.add(new SchemaData("v2.3", "schema_v2.3.sql"));
}
}

@ -22,6 +22,21 @@ public class Constant {
*/
public static final String COUNT_ORDER = "MP";
/**
*
*/
public static final String MA_ORDER = "MA";
/**
*
*/
public static final String DEVICE_COLLECT_ORDER = "DCO";
/**
*
*/
public static final String DEVICE_MA_ORDER = "DMA";
public static final String dlThrProducts = "THR_DOWNLOAD_PRODUCTS";
public static final String dlThrInvProducts = "THR_DOWNLOAD_INV_PRODUCTS";
public static final String dlThrOrders = "THR_DOWNLOAD_ORDERS";

@ -113,7 +113,7 @@ public class ConstantStatus {
public static final int FROM_UDISP = 7; //供应商平台
public static final int FROM_PEACE_CHANGE = 8; //平衡补单
public static final int FROM_COPY = 10; //单据复制
public static final int FROM_COUNT = 10; //盘点单据转单
public static final int FROM_COUNT = 11; //盘点单据转单
//DI类型

@ -86,6 +86,10 @@ public class SpsSyncExportStatusController {
@PostMapping("/spssync/basic/udiinfo/updateStatus")
public BaseResponse updateStatus(@RequestBody BasicExportStatusEntity basicExportStatusEntity) {
if (StrUtil.isEmpty(basicExportStatusEntity.getReceiveStatus())) {
basicExportStatusEntity.setEndTime(new Date());
}
basicExportStatusEntity.setEndTime(new Date());
basicExportStatusEntity.setUpdateTime(new Date());
boolean b = basicExportService.updateExportStatus(basicExportStatusEntity);

@ -10,6 +10,7 @@ import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.constant.ConstantType;
import com.glxp.api.admin.controller.inout.utils.DataTransUtil;
import com.glxp.api.admin.dao.inout.CodesTempDao;
import com.glxp.api.admin.dao.inout.OrderDao;
@ -32,7 +33,9 @@ import com.glxp.api.admin.req.inout.*;
import com.glxp.api.admin.req.inventory.FilterInvBusUserRequest;
import com.glxp.api.admin.req.inventory.FilterInvUserRequest;
import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest;
import com.glxp.api.admin.req.receipt.BussinessTypeFilterRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.BussinessTypResponse;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.basic.BussinessTypeService;
import com.glxp.api.admin.service.basic.EntrustReceService;
@ -799,6 +802,56 @@ public class OrderController {
return ResultVOUtils.success();
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/inout/order/filterPreInChange")
public BaseResponse filterPreInChange(String billNo, String code) {
if (StrUtil.isEmpty(code) && StrUtil.isEmpty(billNo)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
List<OrderEntity> orderEntities = new ArrayList<>();
if (StrUtil.isNotEmpty(code)) {
//查询预验收单据类型
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
bussinessTypeFilterRequest.setPreIn(true);
bussinessTypeFilterRequest.setMainAction(ConstantType.TYPE_PUT);
List<BussinessTypResponse> bussinessTypResponses = bussinessTypeService.filterJoinList(bussinessTypeFilterRequest);
List<String> actions = new ArrayList<>();
if (CollUtil.isNotEmpty(bussinessTypResponses)) {
for (BussinessTypResponse bussinessTypResponse : bussinessTypResponses) {
actions.add(bussinessTypResponse.getAction());
}
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
warehouseQueryRequest.setCode(code);
warehouseQueryRequest.setActions(actions);
List<WarehouseEntity> warehouseEntityList = codesService.findAllByOrderId(warehouseQueryRequest);
if (CollUtil.isNotEmpty(warehouseEntityList)) {
for (WarehouseEntity warehouseEntity : warehouseEntityList) {
List<OrderEntity> temps = orderService.filterPreInChange(warehouseEntity.getOrderId());
if (CollUtil.isNotEmpty(temps))
orderEntities.addAll(temps);
}
}
}
} else {
orderEntities = orderService.filterPreInChange(billNo);
}
PageInfo<OrderEntity> pageInfo = new PageInfo<>(orderEntities);
PageSimpleResponse<OrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(orderEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*

@ -0,0 +1,115 @@
package com.glxp.api.admin.controller.inventory;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.req.inventory.AddDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
import com.glxp.api.admin.service.inventory.DeviceCollectOrderDetailService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class DeviceCollectDetailController {
@Resource
private DeviceCollectOrderDetailService detailService;
/**
*
*
* @param detailRequest
* @return
*/
@GetMapping("/device/collect/order/detail/filterList")
public BaseResponse filterList(FilterDeviceCollectOrderDetailRequest detailRequest) {
List<DeviceCollectOrderDetailResponse> list = detailService.filterList(detailRequest);
PageInfo<DeviceCollectOrderDetailResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<DeviceCollectOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param code
* @return
*/
@GetMapping("/device/collect/order/detail/checkCode")
public BaseResponse checkCode(String code) {
if (StrUtil.isBlank(code)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return detailService.checkCode(code);
}
/**
*
*
* @param addDetailRequest
* @param bindingResult
* @return
*/
@PostMapping("/device/collect/order/detail/addOrderDetail")
public BaseResponse addOrderDetail(@RequestBody AddDeviceCollectOrderDetailRequest addDetailRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == addDetailRequest || StrUtil.isBlank(addDetailRequest.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return detailService.addOrderDetail(addDetailRequest);
}
/**
*
*
* @param detailEntity
* @param bindingResult
* @return
*/
@PostMapping("/device/collect/order/detail/updateOrderDetail")
public BaseResponse updateOrderDetail(@RequestBody DeviceCollectOrderDetailEntity detailEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == detailEntity || null == detailEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return detailService.updateOrderDetail(detailEntity);
}
/**
*
*
* @param detailRequest
* @param bindingResult
* @return
*/
@PostMapping("/device/collect/order/detail/deleteOrderDetail")
public BaseResponse deleteOrderDetail(@RequestBody FilterDeviceCollectOrderDetailRequest detailRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return detailService.deleteOrderDetail(detailRequest);
}
}

@ -0,0 +1,134 @@
package com.glxp.api.admin.controller.inventory;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
import com.glxp.api.admin.service.inventory.DeviceCollectOrderService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class DeviceCollectOrderController {
@Resource
private DeviceCollectOrderService deviceCollectOrderService;
/**
*
*
* @param deviceCollectOrderRequest
* @return
*/
@GetMapping("/device/collect/order/filterList")
public BaseResponse filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest) {
List<DeviceCollectOrderResponse> list = deviceCollectOrderService.filterList(deviceCollectOrderRequest);
PageInfo<DeviceCollectOrderResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<DeviceCollectOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param deviceCollectOrderEntity
*/
@PostMapping("/device/collect/order/addOrder")
public BaseResponse addOrder(@RequestBody DeviceCollectOrderEntity deviceCollectOrderEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors() || null == deviceCollectOrderEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return deviceCollectOrderService.addDeviceCollectOrder(deviceCollectOrderEntity);
}
/**
*
*
* @param deviceCollectOrderEntity
* @param bindingResult
* @return
*/
@PostMapping("/device/collect/order/update")
public BaseResponse update(@RequestBody DeviceCollectOrderEntity deviceCollectOrderEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null == deviceCollectOrderEntity || null == deviceCollectOrderEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return deviceCollectOrderService.updateDeviceCollectOrder(deviceCollectOrderEntity);
}
/**
*
*
* @param filterDeviceCollectOrderRequest
* @param bindingResult
* @return
*/
@PostMapping("/device/collect/order/submitAudit")
public BaseResponse submitAudit(@RequestBody FilterDeviceCollectOrderRequest filterDeviceCollectOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null == filterDeviceCollectOrderRequest || null == filterDeviceCollectOrderRequest.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return deviceCollectOrderService.submitAudit(filterDeviceCollectOrderRequest.getId());
}
/**
*
*
* @param filterDeviceCollectOrderRequest
* @param bindingResult
* @return
*/
@PostMapping("/device/collect/order/updateStatus")
public BaseResponse updateStatus(@RequestBody FilterDeviceCollectOrderRequest filterDeviceCollectOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null == filterDeviceCollectOrderRequest || null == filterDeviceCollectOrderRequest.getId() || null == filterDeviceCollectOrderRequest.getStatus()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return deviceCollectOrderService.updateStatus(filterDeviceCollectOrderRequest.getId(), filterDeviceCollectOrderRequest.getStatus());
}
/**
*
* @param filterDeviceCollectOrderRequest
* @param bindingResult
* @return
*/
@PostMapping("/device/collect/order/delete")
public BaseResponse delete(@RequestBody FilterDeviceCollectOrderRequest filterDeviceCollectOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null == filterDeviceCollectOrderRequest || null == filterDeviceCollectOrderRequest.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return deviceCollectOrderService.deleteDeviceCollectOrder(filterDeviceCollectOrderRequest.getId());
}
}

@ -0,0 +1,96 @@
package com.glxp.api.admin.controller.inventory;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class DeviceMAOrderController {
@Resource
private DeviceMAOrderService deviceMAOrderService;
/**
*
*
* @param filterDeviceMAOrderRequest
* @return
*/
@GetMapping("/device/MA/order/filterList")
public BaseResponse filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
List<DeviceMAOrderEntity> list = deviceMAOrderService.filterList(filterDeviceMAOrderRequest);
PageInfo<DeviceMAOrderEntity> pageInfo = new PageInfo<>(list);
PageSimpleResponse<DeviceMAOrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param deviceMAOrderEntity
* @param bindingResult
* @return
*/
@PostMapping("/device/MA/order/addMAOrder")
public BaseResponse addMAOrder(@RequestBody DeviceMAOrderEntity deviceMAOrderEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return deviceMAOrderService.addDeviceMAOrder(deviceMAOrderEntity);
}
/**
*
*
* @param deviceMAOrderEntity
* @param bindingResult
* @return
*/
@PostMapping("/device/MA/order/updateMAOrder")
public BaseResponse updateMAOrder(@RequestBody DeviceMAOrderEntity deviceMAOrderEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return deviceMAOrderService.updateDeviceMAOrder(deviceMAOrderEntity);
}
/**
*
*
* @param filterDeviceMAOrderRequest
* @param bindingResult
* @return
*/
@PostMapping("/device/MA/order/deleteMAOrder")
public BaseResponse deleteMAOrder(@RequestBody FilterDeviceMAOrderRequest filterDeviceMAOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == filterDeviceMAOrderRequest || null == filterDeviceMAOrderRequest.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return deviceMAOrderService.deleteDeviceMAOrder(filterDeviceMAOrderRequest.getId());
}
}

@ -0,0 +1,91 @@
package com.glxp.api.admin.controller.inventory;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
import com.glxp.api.admin.service.inventory.DeviceMAOrderDetailService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@RestController
public class DeviceMAOrderDetailCotroller {
@Resource
private DeviceMAOrderDetailService deviceMAOrderDetailService;
/**
*
*
* @param detailRequest
* @return
*/
@GetMapping("/device/MA/order/detail/filterList")
public BaseResponse filterList(FilterDeviceMAOrderDetailRequest detailRequest) {
List<DeviceMAOrderDetailResponse> list = deviceMAOrderDetailService.filterList(detailRequest);
PageInfo<DeviceMAOrderDetailResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<DeviceMAOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param detailEntity
* @param bindingResult
* @return
*/
@PostMapping("/device/MA/order/detail/addOrderDetail")
public BaseResponse addOrderDetail(@RequestBody DeviceMAOrderDetailEntity detailEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return deviceMAOrderDetailService.addDetail(detailEntity);
}
/**
*
*
* @param detailEntity
* @param bindingResult
* @return
*/
@PostMapping("/device/MA/order/detail/updateOrderDetail")
public BaseResponse updateOrderDetail(@RequestBody DeviceMAOrderDetailEntity detailEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return deviceMAOrderDetailService.updateDetail(detailEntity);
}
/**
*
*
* @param detailEntity
* @param bindingResult
* @return
*/
@PostMapping("/device/MA/order/detail/deleteOrderDetail")
public BaseResponse deleteOrderDetail(@RequestBody DeviceMAOrderDetailEntity detailEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return deviceMAOrderDetailService.deleteDetail(detailEntity);
}
}

@ -3,13 +3,21 @@ package com.glxp.api.admin.controller.inventory;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.entity.info.SystemPDFModuleEntity;
import com.glxp.api.admin.entity.info.SystemPDFTemplateEntity;
import com.glxp.api.admin.entity.inventory.InvCountOrder;
import com.glxp.api.admin.req.info.SystemPDFModuleRequest;
import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.inventory.FilterInvCountOrderRequest;
import com.glxp.api.admin.req.inventory.FilterInvCountOrderSaveRequest;
import com.glxp.api.admin.req.inventory.InvCountOrderPrintRequest;
import com.glxp.api.admin.req.itextpdf.InspectionPDFTemplateRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.InvCountOrderResponse;
import com.glxp.api.admin.service.info.SystemPDFModuleService;
import com.glxp.api.admin.service.info.SystemPDFTemplateService;
import com.glxp.api.admin.service.inventory.InvCountOrderService;
import com.glxp.api.admin.util.JasperUtils;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -20,8 +28,12 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
@ -31,6 +43,10 @@ public class InvCountOrderController {
@Resource
private InvCountOrderService invCountOrderService;
@Resource
private SystemPDFTemplateService systemPDFTemplateService;
@Resource
private SystemPDFModuleService systemPDFModuleService;
/**
*
@ -38,6 +54,7 @@ public class InvCountOrderController {
* @param filterInvCountOrderRequest
* @return
*/
@AuthRuleAnnotation("")
@GetMapping("/invCount/order/filter")
public BaseResponse filterList(FilterInvCountOrderRequest filterInvCountOrderRequest) {
List<InvCountOrderResponse> list = invCountOrderService.filterList(filterInvCountOrderRequest);
@ -54,6 +71,7 @@ public class InvCountOrderController {
* @param deleteRequest
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/delete")
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
invCountOrderService.deleteOrder(deleteRequest.getId());
@ -65,6 +83,7 @@ public class InvCountOrderController {
*
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/saveCountOrder")
public BaseResponse saveCountOrder(@RequestBody InvCountOrder invCountOrder, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -83,6 +102,7 @@ public class InvCountOrderController {
* @param id
* @return
*/
@AuthRuleAnnotation("")
@GetMapping("/invCount/order/submitAudit")
public BaseResponse submitAudit(String id) {
if (StrUtil.isBlank(id)) {
@ -97,6 +117,7 @@ public class InvCountOrderController {
* @param filterInvCountOrderRequest
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/updateCountOrderStatus")
public BaseResponse updateCountOrderStatus(@RequestBody FilterInvCountOrderRequest filterInvCountOrderRequest) {
if (null == filterInvCountOrderRequest || StrUtil.isBlank(filterInvCountOrderRequest.getId()) || null == filterInvCountOrderRequest.getStatus()) {
@ -105,6 +126,50 @@ public class InvCountOrderController {
return invCountOrderService.updateCountOrderStatus(filterInvCountOrderRequest.getId(), filterInvCountOrderRequest.getStatus());
}
/**
*
*
* @param inspectionPDFTemplateRequest
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/verifyTemplateFile")
public BaseResponse verifyTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) {
if (null == inspectionPDFTemplateRequest) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
//查询模板文件是否存在
SystemPDFModuleRequest systemPDFModuleRequest = new SystemPDFModuleRequest();
systemPDFModuleRequest.setId(inspectionPDFTemplateRequest.getModuleId());
SystemPDFModuleEntity systemPDFModule = systemPDFModuleService.findSystemPDFModule(systemPDFModuleRequest);
if (null == systemPDFModule) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
}
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(systemPDFModule.getTemplateId()));
if (null == systemPDFTemplateEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
}
return ResultVOUtils.success(systemPDFModule.getTemplateId());
}
/**
*
*
* @param invCountOrderPrintRequest
* @param request
* @param response
* @throws Exception
*/
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/printOrder")
public void printOrder(@RequestBody InvCountOrderPrintRequest invCountOrderPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(invCountOrderPrintRequest.getTemplateId());
//打印单号标签
Map<String, Object> data = new HashMap<>(1);
data.put("orderId", invCountOrderPrintRequest.getOrderId());
JasperUtils.jasperReport(request, response, data, systemPDFTemplateEntity.getPath(), "pdf");
}
//------------------------------------------------------手持终端接口---------------------------------------------------------------

@ -0,0 +1,135 @@
package com.glxp.api.admin.controller.inventory;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
import com.glxp.api.admin.service.inventory.InvMAOrderService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class InvMAOrderController {
@Resource
private InvMAOrderService invMAOrderService;
/**
*
*
* @param filterInvMAOrderRequest
* @return
*/
@GetMapping("/inv/MA/order/filterList")
public BaseResponse filterList(FilterInvMAOrderRequest filterInvMAOrderRequest) {
List<InvMAOrderResponse> list = invMAOrderService.filterList(filterInvMAOrderRequest);
PageInfo<InvMAOrderResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<InvMAOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(pageInfo.getList());
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param invMaintenanceOrder
* @param bindingResult
* @return
*/
@PostMapping("/inv/MA/order/addOrder")
public BaseResponse addOrder(@RequestBody InvMaintenanceOrderEntity invMaintenanceOrder, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return invMAOrderService.addOrder(invMaintenanceOrder);
}
/**
*
*
* @param invMaintenanceOrder
* @param bindingResult
* @return
*/
@PostMapping("/inv/MA/order/update")
public BaseResponse update(@RequestBody InvMaintenanceOrderEntity invMaintenanceOrder, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == invMaintenanceOrder || StrUtil.isBlank(invMaintenanceOrder.getOrderId())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
return invMAOrderService.update(invMaintenanceOrder);
}
/**
*
*
* @return
*/
@PostMapping("/inv/MA/order/submitAudit")
public BaseResponse submitAudit(@RequestBody FilterInvMAOrderRequest filterInvMAOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == filterInvMAOrderRequest || null == filterInvMAOrderRequest.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空");
}
return invMAOrderService.submitAudit(filterInvMAOrderRequest.getId());
}
/**
*
*
* @param filterInvMAOrderRequest
* @param bindingResult
* @return
*/
@PostMapping("/inv/MA/order/updateStatus")
public BaseResponse updateStatus(@RequestBody FilterInvMAOrderRequest filterInvMAOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == filterInvMAOrderRequest || null == filterInvMAOrderRequest.getId() || null == filterInvMAOrderRequest.getStatus()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
return invMAOrderService.updateStatus(filterInvMAOrderRequest.getId(), filterInvMAOrderRequest.getStatus());
}
/**
*
*
* @param filterInvMAOrderRequest
* @param bindingResult
* @return
*/
@PostMapping("/inv/MA/order/delete")
public BaseResponse delete(@RequestBody FilterInvMAOrderRequest filterInvMAOrderRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == filterInvMAOrderRequest || null == filterInvMAOrderRequest.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
return invMAOrderService.delete(filterInvMAOrderRequest.getId());
}
}

@ -0,0 +1,120 @@
package com.glxp.api.admin.controller.inventory;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
import com.glxp.api.admin.req.inventory.AddMAOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderDetailRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse;
import com.glxp.api.admin.service.inventory.InvMAOrderDetailService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class InvMAOrderDetailController {
@Resource
private InvMAOrderDetailService invMAOrderDetailService;
/**
*
*
* @param filterInvMAOrderDetailRequest
* @return
*/
@GetMapping("/inv/MA/order/detail/filterList")
public BaseResponse filterList(FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest) {
List<InvMAOrderDetailResponse> list = invMAOrderDetailService.filterList(filterInvMAOrderDetailRequest);
PageInfo<InvMAOrderDetailResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<InvMAOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(pageInfo.getList());
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param invMaintenanceOrderDetailEntity
* @param bindingResult
* @return
*/
@PostMapping(" /inv/MA/order/detail/addOrderDetail")
public BaseResponse addOrderDetail(@RequestBody InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == invMaintenanceOrderDetailEntity || StrUtil.isBlank(invMaintenanceOrderDetailEntity.getCode()) || StrUtil.isBlank(invMaintenanceOrderDetailEntity.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空");
}
return invMAOrderDetailService.addOrderDetail(invMaintenanceOrderDetailEntity);
}
/**
*
*
* @param invProductIds
* @return
*/
@PostMapping("/inv/MA/order/detail/batchAddDetail")
public BaseResponse batchAddDetail(@RequestBody AddMAOrderDetailRequest addMAOrderDetailRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == addMAOrderDetailRequest || CollUtil.isEmpty(addMAOrderDetailRequest.getInvProductIds()) || StrUtil.isBlank(addMAOrderDetailRequest.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
return invMAOrderDetailService.batchAddDetail(addMAOrderDetailRequest);
}
/**
*
*
* @param filterInvMAOrderDetailRequest
* @return
*/
@PostMapping("/inv/MA/order/detail/delete")
public BaseResponse delete(@RequestBody FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == filterInvMAOrderDetailRequest || null == filterInvMAOrderDetailRequest.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空");
}
return invMAOrderDetailService.delete(filterInvMAOrderDetailRequest.getId());
}
/**
*
*
* @param invMaintenanceOrderDetailEntity
* @return
*/
@PostMapping("/inv/MA/order/detail/update")
public BaseResponse update(@RequestBody InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == invMaintenanceOrderDetailEntity || null == invMaintenanceOrderDetailEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
return invMAOrderDetailService.update(invMaintenanceOrderDetailEntity);
}
}

@ -485,12 +485,12 @@ public class InvProductsController {
* @return
*/
@AuthRuleAnnotation("")
@GetMapping("spms/inv/products/getCountInvProductProduct")
public BaseResponse getCountInvProductProduct(FilterInvProductRequest filterInvProductRequest) {
if (StrUtil.isBlank(filterInvProductRequest.getInvStorageCode()) || StrUtil.isBlank(filterInvProductRequest.getInvWarehouseCode())) {
@GetMapping("spms/inv/products/getCountInvProduct")
public BaseResponse getCountInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (null == filterInvProductRequest || StrUtil.isBlank(filterInvProductRequest.getInvStorageCode()) || StrUtil.isBlank(filterInvProductRequest.getInvWarehouseCode())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
List<InvProductResponse> list = invProductService.getCountInvProductProduct(filterInvProductRequest);
List<InvProductResponse> list = invProductService.getCountInvProduct(filterInvProductRequest);
PageInfo<InvProductResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<InvProductResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setList(pageInfo.getList());
@ -498,4 +498,23 @@ public class InvProductsController {
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param filterInvProductRequest
* @return
*/
@GetMapping("spms/inv/products/getMAInvProducts")
public BaseResponse getMAInvProducts(FilterInvProductRequest filterInvProductRequest) {
if (null == filterInvProductRequest || StrUtil.isBlank(filterInvProductRequest.getInvWarehouseCode())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
List<MAInvProductResponse> list = invProductService.getMAInvProducts(filterInvProductRequest);
PageInfo<MAInvProductResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<MAInvProductResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -150,6 +150,10 @@ public class InvSubWarehouseController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean checkResult = invSubWarehouseService.checkDuplicateName(invSubWarehouseEntity.getParentId(), invSubWarehouseEntity.getName());
if (checkResult) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "分库名称重复!");
}
FilterInvSubWarehouseRequest filterInvWarehouseRequest = new FilterInvSubWarehouseRequest();
filterInvWarehouseRequest.setParentId(invSubWarehouseEntity.getParentId());

@ -162,6 +162,41 @@ public class SupCompanyController {
public BaseResponse auditCompany(@RequestBody SupCompanyEntity companyEntity) {
if(companyEntity.getAuditStatus()==1){
//查询用户上传的证书
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
filterSupCertRequest.setCustomerId(companyEntity.getCustomerId());
filterSupCertRequest.setType(ConstantStatus.CERT_COMPANY);
List<SupCertEntity> supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest);
//查询用户该上传的证书
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_COMPANY);
filterCertSetsRequest.setNeed(1);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
//验证
ListIterator<SupCertSetEntity> iterable1 = supCertSetEntities.listIterator();
while (iterable1.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable1.next();
if (supCertSetEntity.isNeed()) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable1.remove();
break;
}
}
}
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
return ResultVOUtils.error(500, "必传证书不齐全!");
}
}
//查询是否包含审核未通过的证书
if (companyEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS
|| companyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) {

@ -97,14 +97,14 @@ public class SupManufacturerController {
FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest();
filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName());
filterSupManufacturerRequest.setCustomerId(getCustomerId());
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
if(companyEntities.size()>0){
return ResultVOUtils.error(999,"企业名称不能重复!");
}
filterSupManufacturerRequest=new FilterSupManufacturerRequest();
filterSupManufacturerRequest.setCustomerId(getCustomerId());
filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode());
companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
if(companyEntities.size()>0){
return ResultVOUtils.error(999,"统一社会信用代码不能重复!");
}
@ -196,14 +196,14 @@ public class SupManufacturerController {
FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest();
filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName());
filterSupManufacturerRequest.setCustomerId(getCustomerId());
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
if(companyEntities.size()>0){
return ResultVOUtils.error(999,"企业名称不能重复!");
}
filterSupManufacturerRequest=new FilterSupManufacturerRequest();
filterSupManufacturerRequest.setCustomerId(getCustomerId());
filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode());
companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
if(companyEntities.size()>0){
return ResultVOUtils.error(999,"统一社会信用代码不能重复!");
}
@ -295,6 +295,59 @@ public class SupManufacturerController {
if (StrUtil.isEmpty(supManufacturerEntity.getManufacturerId()) || StrUtil.isEmpty(supManufacturerEntity.getCustomerId())) {
return ResultVOUtils.error(500, "参数错误!");
}
if(supManufacturerEntity.getAuditStatus()==2){
//查询上传的资质证书
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
filterSupCertRequest.setCustomerId(supManufacturerEntity.getCustomerId());
filterSupCertRequest.setManufacturerIdFk(supManufacturerEntity.getManufacturerId());
filterSupCertRequest.setType(ConstantStatus.CERT_MANUFACTURER);
List<SupCertEntity> supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest);
//查询必须上传的资质证书
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_MANUFACTURER);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
//判断有没有存在必须上传而没有上传的证书
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
while (iterable.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable.next();
if (( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
(
supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
( supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 1
&& supManufacturerEntity.getCompanyType().equals("1"))
||
( supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 3
&& supManufacturerEntity.getCompanyType().equals("1"))) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable.remove();
break;
}
}
}
} else {
iterable.remove();
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
return ResultVOUtils.error(500, "必传证书不齐全!");
}
}
// 查询是否包含审核未通过的证书
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS ||
supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) {

@ -213,7 +213,7 @@ public class SupProductController {
}
}
//提交审核
if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
//判断是否上级供应商是否审核通过
SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supProductEntity.getManufacturerIdFk());
@ -260,7 +260,7 @@ public class SupProductController {
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
}
}
supProductEntity.setUpdateTime(new Date());
SupProductResponse originEntity = supProductService.findByProductId(supProductEntity.getProductId());
supCertService.updateProductId(originEntity.getCustomerId(), supProductEntity.getCustomerId(), originEntity.getManufacturerIdFk(),
@ -281,7 +281,53 @@ public class SupProductController {
if (supProductEntity.getAuditStatus() == null) {
return ResultVOUtils.error(500, "参数错误!");
}
if(supProductEntity.getAuditStatus()==1){
//查询用户上传的证书
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
filterSupCertRequest.setCustomerId(supProductEntity.getCustomerId());
filterSupCertRequest.setManufacturerIdFk(supProductEntity.getManufacturerIdFk());
filterSupCertRequest.setProductIdFk(supProductEntity.getProductId());
filterSupCertRequest.setType(ConstantStatus.CERT_PRODUCT);
List<SupCertEntity> supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest);
//查询用户该上传的证书
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_PRODUCT);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
while (iterable.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable.next();
if (supCertSetEntity.getImports()!=null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部")
|| StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部")
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|| (StrUtil.trimToEmpty(supProductEntity.getProductType()).equals(supCertSetEntity.getCplx()))
|| (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb()))
|| StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode())))
) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable.remove();
break;
}
}
}
} else {
iterable.remove();
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
errMsg = errMsg + "," + supCertSetEntity.getName();
}
return ResultVOUtils.error(500, "必传证书不齐全");
}
}
// 查询是否包含审核未通过的证书
if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS ||

@ -36,4 +36,11 @@ public interface UnitMaintainDao {
*/
UnitMaintainEntity selectByErpId(@Param("erpId") String erpId);
/**
*
*
* @param erpId
* @return
*/
String selectNameByErpId(@Param("erpId") String erpId);
}

@ -0,0 +1,24 @@
package com.glxp.api.admin.dao.info;
import com.glxp.api.admin.entity.info.DbVersionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
@Mapper
public interface DbVersionDao {
int selectVersion(@Param("version") String version);
//查询版本表是否存在
int selectTableExist(@Param("tableName") String tableName);
//新增版本
int insertVersion(DbVersionEntity entity);
//执行sql
@Update("${sql}")
void updateSql(@Param("sql") String sql);
}

@ -60,4 +60,12 @@ public interface OrderDetailDao {
* @return
*/
int countByOrderId(@Param("orderId") String orderId);
/**
*
*
* @param orderIdFk ID
* @param erpOrderId
*/
void updateErpOrderId(@Param("orderIdFk") String orderIdFk, @Param("erpOrderId") String erpOrderId);
}

@ -0,0 +1,40 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DeviceCollectOrderDao {
int deleteByPrimaryKey(Integer id);
int insert(DeviceCollectOrderEntity record);
int insertSelective(DeviceCollectOrderEntity record);
DeviceCollectOrderEntity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(DeviceCollectOrderEntity record);
int updateByPrimaryKey(DeviceCollectOrderEntity record);
List<DeviceCollectOrderResponse> filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest);
/**
* ID
*
* @param id
* @return
*/
String selectOrderIdById(@Param("id") Integer id);
/**
*
*
* @param status
* @param id
*/
void updateStatusById(@Param("status") int status, @Param("id") Integer id);
}

@ -0,0 +1,48 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DeviceCollectOrderDetailDao {
int deleteByPrimaryKey(Integer id);
int insert(DeviceCollectOrderDetailEntity record);
int insertSelective(DeviceCollectOrderDetailEntity record);
DeviceCollectOrderDetailEntity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(DeviceCollectOrderDetailEntity record);
int updateByPrimaryKey(DeviceCollectOrderDetailEntity record);
List<DeviceCollectOrderDetailEntity> selectByOrderId(String orderId);
/**
*
*
* @param detailRequest
* @return
*/
List<DeviceCollectOrderDetailResponse> filterList(FilterDeviceCollectOrderDetailRequest detailRequest);
/**
*
*
* @param orderIdFk
*/
void deleteByOrderId(@Param("orderIdFk") String orderIdFk);
/**
*
*
* @param filterDeviceCollectOrderDetailRequest
* @return
*/
List<DeviceCollectOrderDetailEntity> selectList(FilterDeviceCollectOrderDetailRequest filterDeviceCollectOrderDetailRequest);
}

@ -0,0 +1,23 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import java.util.List;
public interface DeviceMAOrderDao {
int deleteByPrimaryKey(Integer id);
int insert(DeviceMAOrderEntity record);
int insertSelective(DeviceMAOrderEntity record);
DeviceMAOrderEntity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(DeviceMAOrderEntity record);
int updateByPrimaryKey(DeviceMAOrderEntity record);
List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest);
}

@ -0,0 +1,34 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DeviceMaOrderDetailDao {
int deleteByPrimaryKey(Integer id);
int insert(DeviceMAOrderDetailEntity record);
int insertSelective(DeviceMAOrderDetailEntity record);
DeviceMAOrderDetailEntity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(DeviceMAOrderDetailEntity record);
int updateByPrimaryKey(DeviceMAOrderDetailEntity record);
List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest);
void deleteByOrderId(@Param("orderIdFk") String orderIdFk);
/**
*
*
* @param orderId
* @return
*/
List<DeviceMAOrderDetailEntity> selectByOrderId(@Param("orderId") String orderId);
}

@ -81,4 +81,12 @@ public interface InvCountCodesDao {
* @return
*/
List<InvCountCodes> selectByOrderIdAndProductId(@Param("orderIdFk") String orderIdFk, @Param("productId") String productId);
/**
*
*
* @param codesRequest
* @return
*/
List<String> selectCodes(FilterInvCountCodesRequest codesRequest);
}

@ -89,4 +89,12 @@ public interface InvCountOrderDetailDao {
* @param orderId
*/
void resetCountFiledValue(@Param("orderId") String orderId);
/**
*
*
* @param detailRequest
* @return
*/
List<InvCountOrderDetail> selectDetailList(FilterInvCountOrderDetailRequest detailRequest);
}

@ -0,0 +1,12 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceExplanationEntity;
/**
* Dao
*/
public interface InvMaintenanceExplanationDao {
InvMaintenanceExplanationEntity selectByStatus(Integer status);
}

@ -0,0 +1,33 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface InvMaintenanceOrderDao {
int deleteByPrimaryKey(Integer id);
int insert(InvMaintenanceOrderEntity record);
int insertSelective(InvMaintenanceOrderEntity record);
InvMaintenanceOrderEntity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(InvMaintenanceOrderEntity record);
int updateByPrimaryKey(InvMaintenanceOrderEntity record);
List<InvMAOrderResponse> filterList(FilterInvMAOrderRequest filterInvMAOrderRequest);
/**
* ID
*
* @param orderId
* @return
*/
InvMaintenanceOrderEntity selectByOrderId(@Param("orderId") String orderId);
}

@ -0,0 +1,81 @@
package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderDetailRequest;
import com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface InvMaintenanceOrderDetailDao {
int deleteByPrimaryKey(Integer id);
int insert(InvMaintenanceOrderDetailEntity record);
int insertSelective(InvMaintenanceOrderDetailEntity record);
InvMaintenanceOrderDetailEntity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(InvMaintenanceOrderDetailEntity record);
int updateByPrimaryKey(InvMaintenanceOrderDetailEntity record);
/**
* ID
*
* @param orderId
*/
void deleteByOrderId(@Param("orderId") String orderId);
/**
*
*
* @param orderId
* @return
*/
Long countByOrderId(@Param("orderId") String orderId);
/**
*
*
* @param filterInvMAOrderDetailRequest
* @return
*/
List<InvMAOrderDetailResponse> filterList(FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest);
/**
*
*
* @param orderIdFk
* @param code
* @return
*/
InvMaintenanceOrderDetailEntity selectByOrderIdAndCode(@Param("orderIdFk") String orderIdFk, @Param("code") String code);
/**
*
*
* @param orderId
* @return
*/
List<InvMaintenanceOrderDetailEntity> selectByOrderId(@Param("orderId") String orderId);
/**
*
*
* @param id ID
* @param createTime
* @param updateTime
* @return
*/
int updateTime(@Param("id") Integer id, @Param("createTime") String createTime, @Param("updateTime") String updateTime);
/**
* ID
*
* @param orderId
* @return
*/
List<Integer> selectDetailIds(@Param("orderId") String orderId);
}

@ -3,6 +3,7 @@ package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.res.inventory.MAInvProductResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -56,8 +57,17 @@ public interface InvProductDao {
/**
*
*
* @param filterInvProductRequest
* @return
*/
List<InvProductResponse> getCountInvProduct(FilterInvProductRequest filterInvProductRequest);
/**
*
*
* @param filterInvProductRequest
* @return
*/
List<MAInvProductResponse> getMAInvProducts(FilterInvProductRequest filterInvProductRequest);
}

@ -93,4 +93,13 @@ public interface InvProductDetailDao {
* @return
*/
Long countBySpaceCode(@Param("invStorageCode") String invStorageCode, @Param("invWarehouseCode") String invWarehouseCode, @Param("invSpaceCode") String invSpaceCode);
/**
* ID
*
* @param code
* @return
*/
String selectSupIdByCode(String code);
}

@ -21,4 +21,6 @@ public interface SupManufacturerDao {
boolean insertCompany(SupManufacturerEntity supManufacturerEntity);
boolean deleteById(@Param("id") String id);
List<SupManufacturerEntity> getCompanyByNameAndCode(FilterSupManufacturerRequest filterSupManufacturerRequest);
}

@ -17,4 +17,5 @@ public class BasicExportStatusEntity {
private Date startTime;
private Date endTime;
private String remark;
private String receiveStatus;
}

@ -29,7 +29,7 @@ public class UdiInfoEntity {
private String sydycpbs;
private String uuid;
private int versionNumber;
private int diType;
private Integer diType;
private String thirdId;
private String thirdName;
private String ybbm;

@ -0,0 +1,15 @@
package com.glxp.api.admin.entity.info;
import lombok.Data;
import java.util.Date;
@Data
public class DbVersionEntity {
private String id;
private String version;
private String remark;
private Date created;
}

@ -0,0 +1,22 @@
package com.glxp.api.admin.entity.info;
import lombok.Data;
@Data
public class SchemaData {
/**
*
*/
public String version;
/**
*
*/
public String fileName;
public SchemaData(String version, String fileName) {
this.version = version;
this.fileName = fileName;
}
}

@ -82,8 +82,10 @@ public class OrderEntity {
/**
*
*
* <p>
* 01
*/
private String uploadStatus;
private String wzUploadStatus;
private String wzUploadResult;
}

@ -0,0 +1,99 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
/**
*
*/
@Data
public class DeviceCollectOrderDetailEntity {
/**
* id
*/
private Integer id;
/**
*
*/
private String orderIdFk;
/**
*
*/
private String originCode;
/**
*
*/
private String code;
/**
* ID
*/
private String productId;
/**
* DI
*/
private String nameCode;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String serialNo;
/**
*
*/
private String createTime;
/**
*
*/
private String updateTime;
/**
*
*/
private String invStorageCode;
/**
*
*/
private String invWarehouseCode;
/**
*
*/
private String invSpaceCode;
/**
*
*/
private String receiveStorageCode;
/**
*
*/
private String receiveWarehouseCode;
/**
*
*/
private String receiveSpaceCode;
}

@ -0,0 +1,54 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
/**
*
*/
@Data
public class DeviceCollectOrderEntity {
/**
* id
*/
private Integer id;
/**
*
*/
private String orderId;
/**
*
*/
private String deptCode;
/**
*
*/
private String createUser;
/**
*
*/
private String auditUser;
/**
*
*/
private String createTime;
/**
*
*/
private String updateTime;
/**
* 0稿 1 2
*/
private Integer status;
/**
*
*/
private String collectUser;
}

@ -0,0 +1,89 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
/**
*
*/
@Data
public class DeviceMAOrderDetailEntity {
/**
* id
*/
private Integer id;
/**
*
*/
private String orderIdFk;
/**
*
*/
private String code;
/**
* DI
*/
private String nameCode;
/**
* ID
*/
private String productId;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String serialNo;
/**
*
*/
private String createTime;
/**
*
*/
private String updateTime;
/**
* 0 1
*/
private Integer deviceStatus;
/**
* 0 1
*/
private Integer maintenanceStatus;
/**
*
*/
private String createUser;
/**
*
*/
private String remark;
/**
*
*/
private Boolean status;
}

@ -0,0 +1,51 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
/**
*
*/
@Data
public class DeviceMAOrderEntity {
private Integer id;
/**
*
*/
private String orderId;
/**
*
*/
private String collOrderId;
/**
*
*/
private String createTime;
/**
*
*/
private String updateTime;
/**
*
*/
private String createUser;
/**
*
*/
private String auditUser;
/**
*
*/
private String remark;
/**
* 0稿 1
*/
private Integer status;
}

@ -35,4 +35,9 @@ public class InvCountCodes {
*/
private String batchNo;
/**
*
*/
private Integer count;
}

@ -0,0 +1,28 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
/**
*
*/
@Data
public class InvMaintenanceExplanationEntity {
private Integer id;
/**
*
*/
private String name;
/**
* 0 1
*/
private Integer status;
/**
*
*/
private String text;
}

@ -0,0 +1,77 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
/**
*
*/
@Data
public class InvMaintenanceOrderDetailEntity {
private Integer id;
/**
*
*/
private String orderIdFk;
/**
*
*/
private String code;
/**
* ID
*/
private String productId;
/**
* DI
*/
private String nameCode;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private Integer count;
/**
* 0 1
*/
private Integer maintenanceStatus;
/**
* 0 1
*/
private Integer deviceStatus;
/**
*
*/
private String remark;
/**
*
*/
private String createTime;
/**
*
*/
private String updateTime;
}

@ -0,0 +1,62 @@
package com.glxp.api.admin.entity.inventory;
import lombok.Data;
/**
*
*/
@Data
public class InvMaintenanceOrderEntity {
private Integer id;
/**
*
*/
private String orderId;
/**
*
*/
private String invWarehouseCode;
/**
*
*/
private String invSpaceCode;
/**
* 0稿 1 2
*/
private Integer status;
/**
*
*/
private String createTime;
/**
*
*/
private String updateTime;
/**
*
*/
private String auditTime;
/**
*
*/
private String createUser;
/**
*
*/
private String auditUser;
/**
*
*/
private String remark;
}

@ -12,4 +12,5 @@ public class BasicExportStatusRequest extends ListPageRequest {
private Integer scheduleType;
public Integer createType;
private String syncTime;
private String receiveStatus;
}

@ -3,6 +3,8 @@ package com.glxp.api.admin.req.inout;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
import java.util.List;
@Data
public class WarehouseQueryRequest extends ListPageRequest {
@ -15,7 +17,7 @@ public class WarehouseQueryRequest extends ListPageRequest {
private String nameCode;
private String supId;
private String locStorageCode;
private String relId;
List<String> actions;
}

@ -0,0 +1,43 @@
package com.glxp.api.admin.req.inventory;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class AddDeviceCollectOrderDetailRequest {
/**
*
*/
private String orderIdFk;
/**
*
*/
private String code;
/**
* ID
*/
private List<String> invProductIds;
/**
*
*/
private String invStorageCode;
/**
*
*/
private String invWarehouseCode;
/**
*
*/
private String invSpaceCode;
}

@ -0,0 +1,23 @@
package com.glxp.api.admin.req.inventory;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class AddMAOrderDetailRequest {
/**
*
*/
private String orderIdFk;
/**
* ID
*/
List<String> invProductIds;
}

@ -0,0 +1,27 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
/**
*
*/
@Data
public class FilterDeviceCollectOrderDetailRequest extends ListPageRequest {
/**
* ID
*/
private Integer id;
/**
*
*/
private String orderIdFk;
/**
*
*/
private String code;
}

@ -0,0 +1,32 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
/**
*
*/
@Data
public class FilterDeviceCollectOrderRequest extends ListPageRequest {
/**
* ID
*/
private Integer id;
/**
*
*/
private String orderId;
/**
* 0稿 1 2
*/
private Integer status;
/**
*
*/
private String deptCode;
}

@ -0,0 +1,17 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
/**
*
*/
@Data
public class FilterDeviceMAOrderDetailRequest extends ListPageRequest {
/**
*
*/
private String orderIdFk;
}

@ -0,0 +1,29 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class FilterDeviceMAOrderRequest extends ListPageRequest {
/**
* ID
*/
private Integer id;
/**
*
*/
private String orderId;
/**
*
*/
private String collOrderId;
/**
* 0稿 1
*/
private Integer status;
}

@ -16,4 +16,9 @@ public class FilterInvCountOrderDetailRequest extends ListPageRequest {
*/
private String orderIdFk;
/**
* 0 1 2
*/
private Integer status;
}

@ -0,0 +1,29 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
/**
*
*/
@Data
public class FilterInvMAOrderDetailRequest extends ListPageRequest {
private Integer id;
/**
* ID
*/
public String orderIdFk;
/**
* 0 1
*/
public Integer maintenanceStatus;
/**
* 0 1
*/
private Integer deviceStatus;
}

@ -0,0 +1,34 @@
package com.glxp.api.admin.req.inventory;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
/**
*
*/
@Data
public class FilterInvMAOrderRequest extends ListPageRequest {
private Integer id;
/**
* ID
*/
private String orderId;
/**
*
*/
private String invWarehouseCode;
/**
*
*/
private String invSpaceCode;
/**
* 0稿 1 2
*/
private Integer status;
}

@ -32,6 +32,9 @@ public class FilterInvProductDetailRequest extends ListPageRequest {
private String invSpaceCode;
private List<String> invCodes;
//更新时间
private String updateTime;
/**
* ID
*/

@ -6,6 +6,9 @@ import lombok.Data;
@Data
public class InnerOrderRequest extends ListPageRequest {
private String recordKey;
private String startDate;
private String endDate;
}

@ -0,0 +1,21 @@
package com.glxp.api.admin.req.inventory;
import lombok.Data;
/**
*
*/
@Data
public class InvCountOrderPrintRequest {
/**
*
*/
private String orderId;
/**
* ID
*/
private String templateId;
}

@ -32,5 +32,6 @@ public class BussinessTypeFilterRequest extends ListPageRequest {
private String code;
private String ids;
private List<String> actionList;
private Boolean preIn;
}

@ -76,4 +76,8 @@ public class BussinessTypResponse {
private boolean secCheckCopy;
private boolean checkSelect; //判断多选框是否勾选
private boolean checkSp;
private boolean secCheckSp; //自助平台同步
}

@ -0,0 +1,52 @@
package com.glxp.api.admin.res.inventory;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import lombok.Data;
/**
*
*/
@Data
public class DeviceCollectOrderDetailResponse extends DeviceCollectOrderDetailEntity {
/**
*
*/
private String productName;
/**
*
*/
private String invWarehouseName;
/**
*
*/
private String invSpaceName;
/**
*
*/
private String invSpaceCode;
/**
* /
*/
private String zczbhhzbapzbh;
/**
*
*/
private String ylqxzcrbarmc;
/**
*
*/
private String ggxh;
/**
*
*/
private Boolean editSerialNo;
}

@ -0,0 +1,17 @@
package com.glxp.api.admin.res.inventory;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
import lombok.Data;
/**
*
*/
@Data
public class DeviceCollectOrderResponse extends DeviceCollectOrderEntity {
/**
*
*/
private String deptName;
}

@ -0,0 +1,32 @@
package com.glxp.api.admin.res.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
import lombok.Data;
/**
*
*/
@Data
public class DeviceMAOrderDetailResponse extends DeviceMAOrderDetailEntity {
/**
*
*/
private String productName;
/**
*
*/
private String ylqxzcrbarmc;
/**
*
*/
private String zczbhhzbapzbh;
/**
*
*/
private String ggxh;
}

@ -0,0 +1,32 @@
package com.glxp.api.admin.res.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
import lombok.Data;
/**
*
*/
@Data
public class InvMAOrderDetailResponse extends InvMaintenanceOrderDetailEntity {
/**
*
*/
private String productName;
/**
*
*/
private String ggxh;
/**
* /
*/
private String zczbhhzbapzbh;
/**
*
*/
private String ylqxzcrbarmc;
}

@ -0,0 +1,22 @@
package com.glxp.api.admin.res.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
import lombok.Data;
/**
*
*/
@Data
public class InvMAOrderResponse extends InvMaintenanceOrderEntity {
/**
*
*/
private String invWarehouseName;
/**
*
*/
private String invSpaceName;
}

@ -0,0 +1,43 @@
package com.glxp.api.admin.res.inventory;
import lombok.Data;
@Data
public class MAInvProductResponse {
/**
* id
*/
private String id;
/**
*
*/
private String nameCode;
/**
*
*/
private String cpmctymc;
/**
*
*/
private String ggxh;
/**
*
*/
private String batchNo;
/**
*
*/
private String productionDate;
/**
*
*/
private String expireDate;
}

@ -16,6 +16,7 @@ import com.glxp.api.admin.dao.business.StockOrderDao;
import com.glxp.api.admin.dao.business.StockOrderDetailDao;
import com.glxp.api.admin.dao.inout.CodesDao;
import com.glxp.api.admin.dao.inout.OrderDao;
import com.glxp.api.admin.dao.inout.OrderDetailDao;
import com.glxp.api.admin.dao.inventory.InvPreInProductDao;
import com.glxp.api.admin.dao.inventory.InvPreInProductDetailDao;
import com.glxp.api.admin.dao.inventory.InvProductDao;
@ -92,6 +93,8 @@ public class StockOrderServiceImpl implements StockOrderService {
@Resource
BussinessTypeService bussinessTypeService;
@Resource
private OrderDetailDao orderDetailDao;
@Override
@ -330,12 +333,16 @@ public class StockOrderServiceImpl implements StockOrderService {
orderEntity.setErpFk("");
stockOrderDao.updateById(stockOrderEntity);
orderDao.updateOrder(orderEntity);
//置空扫码单据详情关联的业务单据号
orderDetailDao.updateErpOrderId(orderEntity.getId(), null);
} else {
orderEntity.setErpFk("");
stockOrderDao.deleteById(stockOrderEntity.getId());
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
orderDao.updateOrder(orderEntity);
//置空扫码单据详情关联的业务单据号
orderDetailDao.updateErpOrderId(orderEntity.getId(), null);
List<WarehouseEntity> warehouseEntityList = codesDao.findByReceiptId(orderEntity.getId());
if (CollUtil.isNotEmpty(warehouseEntityList)) {
@ -343,8 +350,6 @@ public class StockOrderServiceImpl implements StockOrderService {
codesDao.deleteByOrderId(orderEntity.getId());
}
}
} else {
//回退已完成单据
@ -355,48 +360,52 @@ public class StockOrderServiceImpl implements StockOrderService {
*/
if (isPreInOrder(orderEntity)) {
//查询预验收库库存详情
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOrderIdFk(orderEntity.getId());
List<InvProductDetailEntity> invProductDetailEntities = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
List<InvProductEntity> invPreInProductList = new ArrayList<>();
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
filterInvProductRequest.setRelIdFk(invProductDetailEntity.getProductIdFk());
filterInvProductRequest.setSupId(invProductDetailEntity.getSupId());
filterInvProductRequest.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode());
filterInvProductRequest.setInvStorageCode(invProductDetailEntity.getInvStorageCode());
if (StrUtil.isBlank(invProductDetailEntity.getBatchNo())) {
filterInvProductRequest.setBatchNo("empty");
} else {
filterInvProductRequest.setBatchNo(invProductDetailEntity.getBatchNo());
}
List<InvProductEntity> invProductEntities = invPreInProductDao.filterInvProduct(filterInvProductRequest);
if (CollUtil.isNotEmpty(invProductEntities) && invProductEntities.size() > 0) {
InvProductEntity invProductEntity = invProductEntities.get(0);
calculateInvCount(invProductEntity, invProductDetailEntity);
invPreInProductList.add(invProductEntity);
} else {
return false;
}
}
//删除库存详情
invPreInProductDetailDao.deleteByOrderId(orderEntity.getId());
//更新库存
for (InvProductEntity invProductEntity : invPreInProductList) {
//查询库存码详情,如果库存码详情为空,则删除此库存
FilterInvProductDetailRequest detailParams = new FilterInvProductDetailRequest();
detailParams.setBatchNo(invProductEntity.getBatchNo());
detailParams.setInvCodes(Collections.singletonList(invProductEntity.getInvStorageCode()));
detailParams.setProductIdFk(invProductEntity.getRelIdFk());
int count = invPreInProductDetailDao.statCount(detailParams);
if (count == 0) {
//如果库存码详情为空,则删除此库存
invPreInProductDao.deleteById(String.valueOf(invProductEntity.getId()));
} else {
invPreInProductDao.updateInvProduct(invProductEntity);
}
}
invPreInProductDao.deleteByOrderIdFk(orderEntity.getId());
// //查询预验收库库存详情
// FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// filterInvProductDetailRequest.setOrderIdFk(orderEntity.getId());
// List<InvProductDetailEntity> invProductDetailEntities = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
// List<InvProductEntity> invPreInProductList = new ArrayList<>();
// for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
// FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
// filterInvProductRequest.setRelIdFk(invProductDetailEntity.getProductIdFk());
// filterInvProductRequest.setSupId(invProductDetailEntity.getSupId());
// filterInvProductRequest.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode());
// filterInvProductRequest.setInvStorageCode(invProductDetailEntity.getInvStorageCode());
// if (StrUtil.isBlank(invProductDetailEntity.getBatchNo())) {
// filterInvProductRequest.setBatchNo("empty");
// } else {
// filterInvProductRequest.setBatchNo(invProductDetailEntity.getBatchNo());
// }
// List<InvProductEntity> invProductEntities = invPreInProductDao.filterInvProduct(filterInvProductRequest);
// if (CollUtil.isNotEmpty(invProductEntities) && invProductEntities.size() > 0) {
// InvProductEntity invProductEntity = invProductEntities.get(0);
// calculateInvCount(invProductEntity, invProductDetailEntity);
// invPreInProductList.add(invProductEntity);
// } else {
// return false;
// }
// }
// //删除库存详情
// invPreInProductDetailDao.deleteByOrderId(orderEntity.getId());
// //更新库存
// for (InvProductEntity invProductEntity : invPreInProductList) {
// //查询库存码详情,如果库存码详情为空,则删除此库存
// FilterInvProductDetailRequest detailParams = new FilterInvProductDetailRequest();
// detailParams.setBatchNo(invProductEntity.getBatchNo());
// detailParams.setInvCodes(Collections.singletonList(invProductEntity.getInvStorageCode()));
// detailParams.setProductIdFk(invProductEntity.getRelIdFk());
// int count = invPreInProductDetailDao.statCount(detailParams);
// if (count == 0) {
// //如果库存码详情为空,则删除此库存
// invPreInProductDao.deleteById(String.valueOf(invProductEntity.getId()));
// } else {
// invPreInProductDao.updateInvProduct(invProductEntity);
// }
// }
} else {
//非预验收单据库存,正常扣减库存
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();

@ -44,6 +44,8 @@ public interface OrderService {
List<OrderEntity> filterList(OrderFilterRequest orderFilterRequest);
List<OrderEntity> filterPreInChange(String billNo);
OrderEntity findOne(OrderFilterRequest orderFilterRequest);
OrderEntity findById(String orderId);

@ -205,6 +205,44 @@ public class OrderServiceImpl implements OrderService {
return orderDao.findOne(orderFilterRequest);
}
@Override
public List<OrderEntity> filterPreInChange(String billNo) {
List<OrderEntity> orderEntities = new ArrayList<>();
String orderId = "";
StockOrderEntity stockOrderEntity = stockOrderDao.selectByBillNo(billNo);
if (stockOrderEntity == null) {
orderId = billNo;
} else {
orderId = stockOrderEntity.getOrderIdFk();
}
OrderEntity orderEntity = orderDao.selectByBillNo(orderId);
orderEntities.add(orderEntity);
if (StrUtil.isNotEmpty(orderEntity.getPreInBillNo())) {
String[] priInNo = orderEntity.getPreInBillNo().split(";");
if (priInNo != null) {
for (int i = 0; i < priInNo.length; i++) {
OrderEntity temp = orderDao.selectByBillNo(priInNo[i]);
orderEntities.add(temp);
}
}
}
if (StrUtil.isNotEmpty(orderEntity.getPreOutBillNo())) {
String[] priInNo = orderEntity.getPreOutBillNo().split(";");
if (priInNo != null) {
for (int i = 0; i < priInNo.length; i++) {
OrderEntity temp = orderDao.selectByBillNo(priInNo[i]);
orderEntities.add(temp);
}
}
}
return orderEntities;
}
@Override
public OrderEntity findById(String orderId) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
@ -516,59 +554,63 @@ public class OrderServiceImpl implements OrderService {
try {
//判断单据是否是预验收单据,如果是预验收单据,则删除预验收库库存
if (isPreInOrder(orderEntity)) {
//查询预验收库详情
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOrderIdFk(id);
List<InvProductDetailEntity> invProductDetailEntities = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
Map<String, List<InvProductDetailEntity>> invPreInProductDetailMap = invProductDetailEntities.stream().collect(Collectors.groupingBy(InvProductDetailEntity::getProductIdFk));
List<InvProductEntity> invPreInProductList = new ArrayList<>(invPreInProductDetailMap.keySet().size());
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
filterInvProductRequest.setRelIdFk(invProductDetailEntity.getProductIdFk());
filterInvProductRequest.setSupId(invProductDetailEntity.getSupId());
filterInvProductRequest.setInvStorageCode(invProductDetailEntity.getInvStorageCode());
filterInvProductRequest.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode());
if (StrUtil.isBlank(invProductDetailEntity.getBatchNo())) {
filterInvProductRequest.setBatchNo("empty");
} else {
filterInvProductRequest.setBatchNo(invProductDetailEntity.getBatchNo());
}
List<InvProductEntity> invPerInProductEntities = invPreInProductDao.filterInvProduct(filterInvProductRequest);
InvProductEntity invProductEntity = invPerInProductEntities.get(0);
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
//入库,在原有库存基础上减库存
int count = invProductEntity.getInCount() - invProductDetailEntity.getCount();
invProductEntity.setInCount(count);
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
//出库,在原有库存上增加库存
int count = invProductEntity.getOutCount() - invProductDetailEntity.getCount();
invProductEntity.setOutCount(count);
}
invPreInProductList.add(invProductEntity);
}
//删除库存详情
invPreInProductDetailDao.deleteByOrderId(id);
//删除码详情
codesDao.deleteByOrderId(id);
//更新库存
for (InvProductEntity invProductEntity : invPreInProductList) {
//查询库存码详情,如果库存码详情为空,则删除此库存
FilterInvProductDetailRequest detailParams = new FilterInvProductDetailRequest();
detailParams.setBatchNo(invProductEntity.getBatchNo());
detailParams.setInvCodes(Collections.singletonList(invProductEntity.getInvStorageCode()));
detailParams.setProductIdFk(invProductEntity.getRelIdFk());
int count = invPreInProductDetailDao.statCount(detailParams);
if (count == 0) {
//如果库存码详情为空,则删除此库存
invPreInProductDao.deleteById(String.valueOf(invProductEntity.getId()));
} else {
invPreInProductDao.updateInvProduct(invProductEntity);
}
}
invPreInProductDetailDao.deleteByOrderId(orderEntity.getId());
invPreInProductDao.deleteByOrderIdFk(orderEntity.getId());
// //查询预验收库详情
// FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
// filterInvProductDetailRequest.setOrderIdFk(id);
// List<InvProductDetailEntity> invProductDetailEntities = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
// Map<String, List<InvProductDetailEntity>> invPreInProductDetailMap = invProductDetailEntities.stream().collect(Collectors.groupingBy(InvProductDetailEntity::getProductIdFk));
//
// List<InvProductEntity> invPreInProductList = new ArrayList<>(invPreInProductDetailMap.keySet().size());
//
// for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
// FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
// filterInvProductRequest.setRelIdFk(invProductDetailEntity.getProductIdFk());
// filterInvProductRequest.setSupId(invProductDetailEntity.getSupId());
// filterInvProductRequest.setInvStorageCode(invProductDetailEntity.getInvStorageCode());
// filterInvProductRequest.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode());
// if (StrUtil.isBlank(invProductDetailEntity.getBatchNo())) {
// filterInvProductRequest.setBatchNo("empty");
// } else {
// filterInvProductRequest.setBatchNo(invProductDetailEntity.getBatchNo());
// }
// List<InvProductEntity> invPerInProductEntities = invPreInProductDao.filterInvProduct(filterInvProductRequest);
// InvProductEntity invProductEntity = invPerInProductEntities.get(0);
// if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
// //入库,在原有库存基础上减库存
// int count = invProductEntity.getInCount() - invProductDetailEntity.getCount();
// invProductEntity.setInCount(count);
// } else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
// //出库,在原有库存上增加库存
// int count = invProductEntity.getOutCount() - invProductDetailEntity.getCount();
// invProductEntity.setOutCount(count);
// }
//
// invPreInProductList.add(invProductEntity);
// }
//
// //删除库存详情
// invPreInProductDetailDao.deleteByOrderId(id);
// //删除码详情
// codesDao.deleteByOrderId(id);
// //更新库存
// for (InvProductEntity invProductEntity : invPreInProductList) {
// //查询库存码详情,如果库存码详情为空,则删除此库存
// FilterInvProductDetailRequest detailParams = new FilterInvProductDetailRequest();
// detailParams.setBatchNo(invProductEntity.getBatchNo());
// detailParams.setInvCodes(Collections.singletonList(invProductEntity.getInvStorageCode()));
// detailParams.setProductIdFk(invProductEntity.getRelIdFk());
// int count = invPreInProductDetailDao.statCount(detailParams);
// if (count == 0) {
// //如果库存码详情为空,则删除此库存
// invPreInProductDao.deleteById(String.valueOf(invProductEntity.getId()));
// } else {
// invPreInProductDao.updateInvProduct(invProductEntity);
// }
// }
} else {
//查询库存详情
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();

@ -0,0 +1,55 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.req.inventory.AddDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
import com.glxp.api.common.res.BaseResponse;
import java.util.List;
/**
* Service
*/
public interface DeviceCollectOrderDetailService {
/**
*
*
* @param detailRequest
* @return
*/
List<DeviceCollectOrderDetailResponse> filterList(FilterDeviceCollectOrderDetailRequest detailRequest);
/**
*
*
* @param addDetailRequest
* @return
*/
BaseResponse addOrderDetail(AddDeviceCollectOrderDetailRequest addDetailRequest);
/**
*
*
* @param detailEntity
* @return
*/
BaseResponse updateOrderDetail(DeviceCollectOrderDetailEntity detailEntity);
/**
*
*
* @param detailRequest
* @return
*/
BaseResponse deleteOrderDetail(FilterDeviceCollectOrderDetailRequest detailRequest);
/**
*
*
* @param code
* @return
*/
BaseResponse checkCode(String code);
}

@ -0,0 +1,61 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
import com.glxp.api.common.res.BaseResponse;
import java.util.List;
public interface DeviceCollectOrderService {
/**
*
*
* @param deviceCollectOrderRequest
* @return
*/
List<DeviceCollectOrderResponse> filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest);
/**
*
*
* @param deviceCollectOrderEntity
* @return
*/
BaseResponse addDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity);
/**
*
*
* @param deviceCollectOrderEntity
* @return
*/
BaseResponse updateDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity);
/**
*
*
* @param id
* @return
*/
BaseResponse submitAudit(Integer id);
/**
*
*
* @param id
* @param status
* @return
*/
BaseResponse updateStatus(Integer id, Integer status);
/**
*
*
* @param id
* @return
*/
BaseResponse deleteDeviceCollectOrder(Integer id);
}

@ -0,0 +1,24 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
import com.glxp.api.common.res.BaseResponse;
import java.util.List;
/**
* Service
*/
public interface DeviceMAOrderDetailService {
List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest);
BaseResponse addDetail(DeviceMAOrderDetailEntity detailEntity);
BaseResponse updateDetail(DeviceMAOrderDetailEntity detailEntity);
BaseResponse deleteDetail(DeviceMAOrderDetailEntity detailEntity);
}

@ -0,0 +1,46 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.common.res.BaseResponse;
import java.util.List;
/**
* Service
*/
public interface DeviceMAOrderService {
/**
*
*
* @param filterDeviceMAOrderRequest
* @return
*/
List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest);
/**
*
*
* @param deviceMAOrderEntity
* @return
*/
BaseResponse addDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity);
/**
*
*
* @param deviceMAOrderEntity
* @return
*/
BaseResponse updateDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity);
/**
*
*
* @param id
* @return
*/
BaseResponse deleteDeviceMAOrder(Integer id);
}

@ -42,4 +42,6 @@ public interface InvCountCodesService {
* @return
*/
Long getCountOrderCodesNum(String orderIdFk);
int getActCount(String nameCode);
}

@ -0,0 +1,56 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity;
import com.glxp.api.admin.req.inventory.AddMAOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderDetailRequest;
import com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse;
import com.glxp.api.common.res.BaseResponse;
import java.util.List;
/**
* Service
*/
public interface InvMAOrderDetailService {
/**
*
*
* @param filterInvMAOrderDetailRequest
* @return
*/
List<InvMAOrderDetailResponse> filterList(FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest);
/**
*
*
* @param invMaintenanceOrderDetailEntity
* @return
*/
BaseResponse addOrderDetail(InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity);
/**
* -1
*
* @param id
* @return
*/
BaseResponse delete(Integer id);
/**
*
*
* @param addMAOrderDetailRequest
* @return
*/
BaseResponse batchAddDetail(AddMAOrderDetailRequest addMAOrderDetailRequest);
/**
*
*
* @param invMaintenanceOrderDetailEntity
* @return
*/
BaseResponse update(InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity);
}

@ -0,0 +1,64 @@
package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
import com.glxp.api.common.res.BaseResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Service
*/
public interface InvMAOrderService {
/**
*
*
* @param filterInvMAOrderRequest
* @return
*/
List<InvMAOrderResponse> filterList(FilterInvMAOrderRequest filterInvMAOrderRequest);
/**
*
*
* @param invMaintenanceOrder
* @return
*/
BaseResponse addOrder(InvMaintenanceOrderEntity invMaintenanceOrder);
/**
*
*
* @param invMaintenanceOrder
* @return
*/
BaseResponse update(InvMaintenanceOrderEntity invMaintenanceOrder);
/**
*
*
* @param id
* @return
*/
BaseResponse submitAudit(Integer id);
/**
*
*
* @param id
* @param status
* @return
*/
BaseResponse updateStatus(Integer id, Integer status);
/**
*
*
* @param id
* @return
*/
BaseResponse delete(@Param("id") Integer id);
}

@ -4,6 +4,7 @@ package com.glxp.api.admin.service.inventory;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.res.inventory.MAInvProductResponse;
import java.util.List;
@ -43,6 +44,13 @@ public interface InvProductService {
* @param filterInvProductRequest
* @return
*/
List<InvProductResponse> getCountInvProductProduct(FilterInvProductRequest filterInvProductRequest);
List<InvProductResponse> getCountInvProduct(FilterInvProductRequest filterInvProductRequest);
/**
*
*
* @param filterInvProductRequest
* @return
*/
List<MAInvProductResponse> getMAInvProducts(FilterInvProductRequest filterInvProductRequest);
}

@ -0,0 +1,247 @@
package com.glxp.api.admin.service.inventory.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.constant.ConstantType;
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDetailDao;
import com.glxp.api.admin.dao.inventory.InvProductDao;
import com.glxp.api.admin.dao.inventory.InvProductDetailDao;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.AddDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
import com.glxp.api.admin.service.inventory.DeviceCollectOrderDetailService;
import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.admin.util.FilterUdiUtils;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceCollectOrderDetailServiceImpl implements DeviceCollectOrderDetailService {
@Resource
private DeviceCollectOrderDetailDao deviceCollectOrderDetailDao;
@Resource
private InvProductDetailDao invProductDetailDao;
@Resource
private InvProductDao invProductDao;
@Override
public List<DeviceCollectOrderDetailResponse> filterList(FilterDeviceCollectOrderDetailRequest detailRequest) {
if (null == detailRequest) {
return Collections.emptyList();
}
if (null != detailRequest.getPage() && null != detailRequest.getLimit()) {
PageHelper.offsetPage((detailRequest.getPage() - 1) * detailRequest.getLimit(), detailRequest.getLimit());
}
List<DeviceCollectOrderDetailResponse> list = deviceCollectOrderDetailDao.filterList(detailRequest);
//设置是否可以自定义序列号标识
list.forEach(item -> {
item.setEditSerialNo(StrUtil.isBlank(item.getCode()) ? true : false);
});
return list;
}
@Override
public BaseResponse addOrderDetail(AddDeviceCollectOrderDetailRequest addDetailRequest) {
if (null == addDetailRequest || StrUtil.isBlank(addDetailRequest.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (StrUtil.isBlank(addDetailRequest.getCode()) && CollUtil.isEmpty(addDetailRequest.getInvProductIds())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请添加领用设备!");
}
if (StrUtil.isNotBlank(addDetailRequest.getCode())) {
//通过条码添加
//解析此条码,判断此条码是否已经存在
UdiEntity udi = FilterUdiUtils.getUdi(addDetailRequest.getCode());
if (StrUtil.isNotBlank(udi.getSerialNo())) {
//条码为完整码,查询此条码在当前领用记录中是否存在,如果存在则无法添加
FilterDeviceCollectOrderDetailRequest detailRequest = new FilterDeviceCollectOrderDetailRequest();
detailRequest.setOrderIdFk(addDetailRequest.getOrderIdFk());
detailRequest.setCode(addDetailRequest.getCode());
List<DeviceCollectOrderDetailResponse> list = deviceCollectOrderDetailDao.filterList(detailRequest);
if (CollUtil.isNotEmpty(list)) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "条码重复!");
}
}
//设置库存详情查询参数
FilterInvProductDetailRequest invProductDetailRequest = new FilterInvProductDetailRequest();
invProductDetailRequest.setCode(addDetailRequest.getCode());
//判断是否有选入的仓库信息,如果没有,说明此条码仅存在一条仓库信息,直接使用即可
if (StrUtil.isNotBlank(addDetailRequest.getInvStorageCode())) {
invProductDetailRequest.setInvStorageCode(addDetailRequest.getInvStorageCode());
invProductDetailRequest.setInvWarehouseCode(addDetailRequest.getInvWarehouseCode());
invProductDetailRequest.setInvSpaceCode(addDetailRequest.getInvSpaceCode());
}
//查询库存详情
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(invProductDetailRequest);
InvProductDetailEntity invProductDetailEntity = invProductDetailEntities.get(0);
DeviceCollectOrderDetailEntity orderDetail = getDeviceCollectOrderDetailEntity(addDetailRequest.getOrderIdFk(), addDetailRequest.getCode(), invProductDetailEntity);
deviceCollectOrderDetailDao.insert(orderDetail);
} else {
//通过选库存添加
//查询选中的库存信息
for (String invProductId : addDetailRequest.getInvProductIds()) {
InvProductEntity invProductEntity = invProductDao.selectById(invProductId);
//查询库存详情
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setProductIdFk(invProductEntity.getRelIdFk());
filterInvProductDetailRequest.setBatchNo(invProductEntity.getBatchNo());
filterInvProductDetailRequest.setInvStorageCode(invProductEntity.getInvStorageCode());
filterInvProductDetailRequest.setInvWarehouseCode(invProductEntity.getInvWarehouseCode());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
//计算出在仓库中的设备
//提取库存详情中不同的码
List<String> codesList = invProductDetailEntities.stream().map(InvProductDetailEntity::getOriginCode).distinct().collect(Collectors.toList());
//初始化所有码数量集合
Map<String, Integer> codeMap = new HashMap<>(codesList.size());
codesList.forEach(code -> codeMap.put(code, 0));
//计算库存详情中的码明细,得出所有存在于库存中的码
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
Integer count = codeMap.get(invProductDetailEntity.getOriginCode());
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
//入库,数量 +1
count = count + 1;
} else {
//出库, 数量 -1
count = count - 1;
}
codeMap.put(invProductDetailEntity.getOriginCode(), count);
}
//根据计算得出的,所有存在于库存中的码明细,生成设备领用记录详情
for (String code : codeMap.keySet()) {
if (codeMap.get(code) > 0) {
//查找此条码对应的库存详情数据,根据此库存详情数据,查找仓库货位等信息
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
for (InvProductDetailEntity detailEntity : invProductDetailEntities) {
if (detailEntity.getCode().equals(code)) {
invProductDetailEntity = detailEntity;
break;
}
}
//此条码存在于库存中,解析条码生成设备领用记录详情
Integer count = codeMap.get(code);
if (count > 1) {
for (int i = 0; i < count; i++) {
DeviceCollectOrderDetailEntity orderDetail = getDeviceCollectOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity);
//插入设备领用记录详情
deviceCollectOrderDetailDao.insert(orderDetail);
}
} else {
DeviceCollectOrderDetailEntity orderDetail = getDeviceCollectOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity);
deviceCollectOrderDetailDao.insert(orderDetail);
}
}
}
}
}
return ResultVOUtils.success("添加成功!");
}
/**
*
*
* @param orderIdFk
* @param code
* @param invProductDetailEntity
* @return
*/
private static DeviceCollectOrderDetailEntity getDeviceCollectOrderDetailEntity(String orderIdFk, String code, InvProductDetailEntity invProductDetailEntity) {
//此条码数量为多个,生成多条养护记录
UdiEntity udi = FilterUdiUtils.getUdi(code);
DeviceCollectOrderDetailEntity orderDetail = new DeviceCollectOrderDetailEntity();
orderDetail.setOrderIdFk(orderIdFk);
orderDetail.setOriginCode(code);
orderDetail.setProductId(invProductDetailEntity.getProductIdFk());
orderDetail.setNameCode(udi.getUdi());
orderDetail.setBatchNo(udi.getBatchNo());
orderDetail.setProduceDate(udi.getProduceDate());
orderDetail.setExpireDate(udi.getExpireDate());
//判断有无序列号如果有序列号则可以通过udi码来判定唯一直接使用udi码做唯一码
if (StrUtil.isNotBlank(udi.getSerialNo())) {
orderDetail.setSerialNo(udi.getSerialNo());
orderDetail.setCode(code);
}
String date = DateUtil.getDateTime();
orderDetail.setCreateTime(date);
orderDetail.setUpdateTime(date);
orderDetail.setInvStorageCode(invProductDetailEntity.getInvStorageCode());
orderDetail.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode());
orderDetail.setInvSpaceCode(invProductDetailEntity.getInvSpaceCode());
return orderDetail;
}
@Override
public BaseResponse updateOrderDetail(DeviceCollectOrderDetailEntity detailEntity) {
if (null == detailEntity || null == detailEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
//判断新的条码是否重复
WarehouseEntity warehouseEntity = new WarehouseEntity();
BeanUtil.copyProperties(detailEntity, warehouseEntity);
String code = FilterUdiUtils.transGlxpHasSerStr(warehouseEntity);
FilterDeviceCollectOrderDetailRequest detailRequest = new FilterDeviceCollectOrderDetailRequest();
detailRequest.setOrderIdFk(detailEntity.getOrderIdFk());
detailRequest.setCode(code);
List<DeviceCollectOrderDetailResponse> list = deviceCollectOrderDetailDao.filterList(detailRequest);
if (CollUtil.isNotEmpty(list)) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "条码重复!");
}
deviceCollectOrderDetailDao.updateByPrimaryKey(detailEntity);
return ResultVOUtils.success("更新成功!");
}
@Override
public BaseResponse deleteOrderDetail(FilterDeviceCollectOrderDetailRequest detailRequest) {
if (null == detailRequest.getId() && StrUtil.isBlank(detailRequest.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null != detailRequest.getId()) {
deviceCollectOrderDetailDao.deleteByPrimaryKey(detailRequest.getId());
} else if (StrUtil.isNotBlank(detailRequest.getOrderIdFk())) {
deviceCollectOrderDetailDao.deleteByOrderId(detailRequest.getOrderIdFk());
}
return ResultVOUtils.success("删除成功!");
}
@Override
public BaseResponse checkCode(String code) {
//校验码在库存中是否存在
//查询此条码是否在库存中存在
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(code);
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
if (invProductDetailEntities.size() > 1) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "此设备记录存在于多个仓库,请选择此设备当前所处仓库!");
} else {
return ResultVOUtils.success("校验成功!");
}
}
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此条码在库存中不存在,无法领用!");
}
}

@ -0,0 +1,145 @@
package com.glxp.api.admin.service.inventory.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDao;
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDetailDao;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.inventory.DeviceCollectOrderService;
import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.admin.util.FilterUdiUtils;
import com.glxp.api.admin.util.GennerOrderUtils;
import com.glxp.api.admin.util.OrderNoTypeBean;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceCollectOrderServiceImpl implements DeviceCollectOrderService {
@Resource
private DeviceCollectOrderDao deviceCollectOrderDao;
@Resource
private DeviceCollectOrderDetailDao deviceCollectOrderDetailDao;
@Resource
private GennerOrderUtils gennerOrderUtils;
@Resource
private CustomerService customerService;
@Override
public List<DeviceCollectOrderResponse> filterList(FilterDeviceCollectOrderRequest deviceCollectOrderRequest) {
if (null == deviceCollectOrderRequest) {
return Collections.emptyList();
}
if (null != deviceCollectOrderRequest.getPage() && null != deviceCollectOrderRequest.getLimit()) {
PageHelper.offsetPage((deviceCollectOrderRequest.getPage() - 1) * deviceCollectOrderRequest.getLimit(), deviceCollectOrderRequest.getLimit());
}
return deviceCollectOrderDao.filterList(deviceCollectOrderRequest);
}
@Override
public BaseResponse addDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity) {
if (null == deviceCollectOrderEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
//生成单号
String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_COLLECT_ORDER, "yyyyMMdd"));
deviceCollectOrderEntity.setOrderId(orderId);
deviceCollectOrderEntity.setCreateTime(DateUtil.getDateTime());
deviceCollectOrderEntity.setStatus(0);
deviceCollectOrderEntity.setUpdateTime(DateUtil.getDateTime());
String userName = customerService.getUserBean().getUserName();
deviceCollectOrderEntity.setCreateUser(userName);
deviceCollectOrderDao.insert(deviceCollectOrderEntity);
return ResultVOUtils.success(deviceCollectOrderEntity);
}
@Override
public BaseResponse updateDeviceCollectOrder(DeviceCollectOrderEntity deviceCollectOrderEntity) {
if (null == deviceCollectOrderEntity || null == deviceCollectOrderEntity.getId() || StrUtil.isBlank(deviceCollectOrderEntity.getOrderId())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
deviceCollectOrderEntity.setUpdateTime(DateUtil.getDateTime());
deviceCollectOrderDao.updateByPrimaryKey(deviceCollectOrderEntity);
return ResultVOUtils.success("更新成功");
}
@Override
public BaseResponse submitAudit(Integer id) {
if (null == id) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
//查询设备领用记录详情,判断是否每个设备都可以分辨唯一,如果不能,则无法提交审核
String orderId = deviceCollectOrderDao.selectOrderIdById(id);
if (StrUtil.isBlank(orderId)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用记录不存在!");
}
List<DeviceCollectOrderDetailEntity> detailList = deviceCollectOrderDetailDao.selectByOrderId(orderId);
if (CollUtil.isEmpty(detailList)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请添加领用设备!");
}
for (DeviceCollectOrderDetailEntity deviceCollectOrderDetailEntity : detailList) {
if (StrUtil.isBlank(deviceCollectOrderDetailEntity.getSerialNo())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用设备中存在无序列号设备,无法提交审核,请完善设备信息!");
}
}
//更新领用记录状态为待审核
deviceCollectOrderDao.updateStatusById(1, id);
return ResultVOUtils.success("提交成功!");
}
@Override
public BaseResponse updateStatus(Integer id, Integer status) {
if (null == id || null == status) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "");
}
DeviceCollectOrderEntity deviceCollectOrderEntity = deviceCollectOrderDao.selectByPrimaryKey(id);
if (null == deviceCollectOrderEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用记录不出存在!");
}
//查询此领用记录详情中定义序列号的记录,重新生成码
List<DeviceCollectOrderDetailEntity> detailEntityList = deviceCollectOrderDetailDao.selectByOrderId(deviceCollectOrderEntity.getOrderId());
detailEntityList.forEach(detailEntity -> {
if (StrUtil.isBlank(detailEntity.getCode())) {
WarehouseEntity warehouseEntity = new WarehouseEntity();
BeanUtil.copyProperties(detailEntity, warehouseEntity);
String code = FilterUdiUtils.transGlxpHasSerStr(warehouseEntity);
detailEntity.setCode(code);
//更新详情的条码信息
deviceCollectOrderDetailDao.updateByPrimaryKey(detailEntity);
}
});
String auditUser = customerService.getUserBean().getUserName();
deviceCollectOrderEntity.setAuditUser(auditUser);
deviceCollectOrderEntity.setStatus(status);
deviceCollectOrderDao.updateByPrimaryKey(deviceCollectOrderEntity);
return ResultVOUtils.success("更新成功!");
}
@Override
public BaseResponse deleteDeviceCollectOrder(Integer id) {
if (null == id) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
deviceCollectOrderDao.deleteByPrimaryKey(id);
return ResultVOUtils.success("删除成功!");
}
}

@ -0,0 +1,74 @@
package com.glxp.api.admin.service.inventory.impl;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.inventory.DeviceMaOrderDetailDao;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceMAOrderDetailResponse;
import com.glxp.api.admin.service.inventory.DeviceMAOrderDetailService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import groovy.util.logging.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceMAOrderDetailServiceImpl implements DeviceMAOrderDetailService {
@Resource
private DeviceMaOrderDetailDao deviceMaOrderDetailDao;
@Override
public List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest) {
if (null == detailRequest) {
return Collections.emptyList();
}
if (null != detailRequest.getPage() && null != detailRequest.getLimit()) {
PageHelper.offsetPage((detailRequest.getPage() - 1) * detailRequest.getLimit(), detailRequest.getLimit());
}
return deviceMaOrderDetailDao.filterList(detailRequest);
}
@Override
public BaseResponse addDetail(DeviceMAOrderDetailEntity detailEntity) {
if (null == detailEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
deviceMaOrderDetailDao.insert(detailEntity);
return ResultVOUtils.success("添加成功!");
}
@Override
public BaseResponse updateDetail(DeviceMAOrderDetailEntity detailEntity) {
if (null == detailEntity || null == detailEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
deviceMaOrderDetailDao.updateByPrimaryKey(detailEntity);
return ResultVOUtils.success("更新成功");
}
@Override
public BaseResponse deleteDetail(DeviceMAOrderDetailEntity detailEntity) {
if (null == detailEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null == detailEntity.getId() && StrUtil.isBlank(detailEntity.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null != detailEntity.getId()) {
deviceMaOrderDetailDao.deleteByPrimaryKey(detailEntity.getId());
} else {
//删除整单数据
deviceMaOrderDetailDao.deleteByOrderId(detailEntity.getOrderIdFk());
}
return ResultVOUtils.success("删除成功");
}
}

@ -0,0 +1,127 @@
package com.glxp.api.admin.service.inventory.impl;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDetailDao;
import com.glxp.api.admin.dao.inventory.DeviceMAOrderDao;
import com.glxp.api.admin.dao.inventory.DeviceMaOrderDetailDao;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.admin.util.GennerOrderUtils;
import com.glxp.api.admin.util.OrderNoTypeBean;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
@Resource
private DeviceMAOrderDao deviceMAOrderDao;
@Resource
private CustomerService customerService;
@Resource
private GennerOrderUtils gennerOrderUtils;
@Resource
private DeviceCollectOrderDetailDao deviceCollectOrderDetailDao;
@Resource
private DeviceMaOrderDetailDao deviceMaOrderDetailDao;
@Override
public List<DeviceMAOrderEntity> filterList(FilterDeviceMAOrderRequest filterDeviceMAOrderRequest) {
if (null == filterDeviceMAOrderRequest) {
return Collections.emptyList();
}
if (null != filterDeviceMAOrderRequest.getPage() && null != filterDeviceMAOrderRequest.getLimit()) {
PageHelper.offsetPage((filterDeviceMAOrderRequest.getPage() - 1) * filterDeviceMAOrderRequest.getLimit(), filterDeviceMAOrderRequest.getLimit());
}
return deviceMAOrderDao.filterList(filterDeviceMAOrderRequest);
}
@Override
public BaseResponse addDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity) {
if (null == deviceMAOrderEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (StrUtil.isBlank(deviceMAOrderEntity.getCollOrderId())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请选择养护设备!");
}
deviceMAOrderEntity.setOrderId(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_MA_ORDER, "yyyyMMdd")));
deviceMAOrderEntity.setCreateUser(customerService.getUserBean().getUserName());
deviceMAOrderEntity.setCreateTime(DateUtil.getDateTime());
deviceMAOrderEntity.setStatus(0);
deviceMAOrderEntity.setUpdateTime(DateUtil.getDateTime());
deviceMAOrderDao.insert(deviceMAOrderEntity);
//查询此设备领用单据的设备列表,生成养护清单
List<DeviceCollectOrderDetailEntity> deviceCollectOrderDetailList = deviceCollectOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getCollOrderId());
deviceCollectOrderDetailList.forEach(collectOrderDetail -> {
DeviceMAOrderDetailEntity detailEntity = new DeviceMAOrderDetailEntity();
detailEntity.setOrderIdFk(deviceMAOrderEntity.getOrderId());
detailEntity.setCode(collectOrderDetail.getCode());
detailEntity.setNameCode(collectOrderDetail.getNameCode());
detailEntity.setBatchNo(collectOrderDetail.getBatchNo());
detailEntity.setProduceDate(collectOrderDetail.getProduceDate());
detailEntity.setExpireDate(collectOrderDetail.getExpireDate());
detailEntity.setProductId(collectOrderDetail.getProductId());
detailEntity.setSerialNo(collectOrderDetail.getSerialNo());
detailEntity.setCreateUser(deviceMAOrderEntity.getCreateUser());
detailEntity.setCreateTime(deviceMAOrderEntity.getCreateTime());
detailEntity.setMaintenanceStatus(0);
detailEntity.setDeviceStatus(1);
deviceMaOrderDetailDao.insert(detailEntity);
});
return ResultVOUtils.success(deviceMAOrderEntity);
}
@Override
public BaseResponse updateDeviceMAOrder(DeviceMAOrderEntity deviceMAOrderEntity) {
if (null == deviceMAOrderEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null == deviceMAOrderEntity.getId() || StrUtil.isBlank(deviceMAOrderEntity.getOrderId())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (deviceMAOrderEntity.getStatus() == 1) {
//完成养护记录更新,查询此条养护记录详情中是否存在未养护完成设备
List<DeviceMAOrderDetailEntity> detailList = deviceMaOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getOrderId());
for (DeviceMAOrderDetailEntity deviceMAOrderDetailEntity : detailList) {
if (deviceMAOrderDetailEntity.getMaintenanceStatus() == 0) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "存在未养护设备,请完成该设备养护!");
}
}
}
deviceMAOrderDao.updateByPrimaryKey(deviceMAOrderEntity);
return ResultVOUtils.success("更新成功");
}
@Override
public BaseResponse deleteDeviceMAOrder(Integer id) {
if (null == id) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
DeviceMAOrderEntity deviceMAOrderEntity = deviceMAOrderDao.selectByPrimaryKey(id);
if (null == deviceMAOrderEntity) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录已被删除!");
}
deviceMAOrderDao.deleteByPrimaryKey(id);
//删除此养护记录的详情数据
deviceCollectOrderDetailDao.deleteByOrderId(deviceMAOrderEntity.getOrderId());
return ResultVOUtils.success("删除成功!");
}
}

@ -58,16 +58,20 @@ public class InvCountCodesServiceImpl implements InvCountCodesService {
UdiEntity udi = FilterUdiUtils.getUdi(list.get(0).getCode());
InvCountOrderDetail invCountOrderDetail = invCountOrderDetailDao.selectOrderDetail(list.get(0).getOrderIdFk(), udi.getUdi(), udi.getBatchNo(), udi.getProduceDate(), udi.getExpireDate());
if (invCountOrderDetail.getCountNum() == 1) {
//条码数量为1删除此产品的盘点单据详情
invCountOrderDetailDao.deleteByPrimaryKey(invCountOrderDetail.getId());
InvCountCodes countCodes = list.get(0);
if (countCodes.getCount() == 1) {
//条码数量等于1删除条码
invCountCodesDao.deleteByPrimaryKey(list.get(0).getId());
} else {
//条码数量大于1将此单据详情的盘点数量 - 1
invCountOrderDetail.setCountNum(invCountOrderDetail.getCountNum() - getActCount(udi.getUdi()));
invCountOrderDetailDao.updateByPrimaryKey(invCountOrderDetail);
//条码数量大于1条码数量 -1
countCodes.setCount(countCodes.getCount() - 1);
invCountCodesDao.updateByPrimaryKey(countCodes);
}
//删除此条码
invCountCodesDao.deleteByPrimaryKey(list.get(0).getId());
//将此单据详情的盘点数量 - 1
invCountOrderDetail.setCountNum(invCountOrderDetail.getCountNum() - getActCount(udi.getUdi()));
invCountOrderDetailDao.updateByPrimaryKey(invCountOrderDetail);
return ResultVOUtils.success();
}
@ -75,27 +79,41 @@ public class InvCountCodesServiceImpl implements InvCountCodesService {
public BaseResponse addCode(InvCountCodes invCountCodes) {
//解析条码
UdiEntity udi = FilterUdiUtils.getUdi(invCountCodes.getCode());
//查询此条码是否重复
//判断此产品是否有批次号如果没有批次号则直接在单据详情的盘点数量上加1
if (StrUtil.isNotBlank(udi.getBatchNo()) && StrUtil.isNotBlank(udi.getSerialNo())) {
Long count = invCountCodesDao.selectCountByCodeAndOrderId(invCountCodes.getCode(), invCountCodes.getOrderIdFk());
if (count > 0) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "条码重复!");
}
}
//查询单据详情,单据详情添加
InvCountOrderDetail invCountOrderDetail = invCountOrderDetailDao.selectOrderDetail(invCountCodes.getOrderIdFk(), udi.getUdi(), udi.getBatchNo(), udi.getProduceDate(),udi.getExpireDate());
//查询单据详情,是否包含此产品
InvCountOrderDetail invCountOrderDetail = invCountOrderDetailDao.selectOrderDetail(invCountCodes.getOrderIdFk(), udi.getUdi(), udi.getBatchNo(), udi.getProduceDate(), udi.getExpireDate());
if (null == invCountOrderDetail) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "当前仓库或货位不存在此产品");
}
//判断条码是否重复
FilterInvCountCodesRequest codesRequest = new FilterInvCountCodesRequest();
codesRequest.setOrderIdFk(invCountCodes.getOrderIdFk());
codesRequest.setCode(invCountCodes.getCode());
List<InvCountCodes> codesList = invCountCodesDao.filterList(codesRequest);
if (CollUtil.isEmpty(codesList)) {
//新增条码
invCountCodes.setProductId(invCountOrderDetail.getProductId());
invCountCodes.setBatchNo(udi.getBatchNo());
invCountCodes.setCount(1);
invCountCodesDao.insert(invCountCodes);
} else {
if (StrUtil.isNotBlank(udi.getBatchNo()) && StrUtil.isNotBlank(udi.getSerialNo())) {
//条码为标准条码,批次号和序列号都存在,条码重复
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "条码重复!");
} else if ((StrUtil.isBlank(udi.getBatchNo()) && StrUtil.isBlank(udi.getSerialNo()) || (StrUtil.isNotBlank(udi.getBatchNo()) && StrUtil.isBlank(udi.getSerialNo())))) {
//批次号或序列号,其中一个字段为空,直接修改数量
InvCountCodes countCodes = codesList.get(0);
countCodes.setCount(countCodes.getCount() + 1);
invCountCodesDao.updateByPrimaryKey(countCodes);
} else {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "条码重复!");
}
}
//修改码明细
invCountOrderDetail.setCountNum(invCountOrderDetail.getCountNum() + getActCount(udi.getUdi()));
invCountCodes.setProductId(invCountOrderDetail.getProductId());
invCountCodes.setBatchNo(udi.getBatchNo());
invCountOrderDetailDao.updateByPrimaryKey(invCountOrderDetail);
invCountCodesDao.insert(invCountCodes);
return ResultVOUtils.success();
}
@ -104,6 +122,7 @@ public class InvCountCodesServiceImpl implements InvCountCodesService {
return invCountCodesDao.countByOrderId(orderIdFk);
}
@Override
public int getActCount(String nameCode) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(nameCode);

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.constant.Constant;
@ -22,10 +23,7 @@ import com.glxp.api.admin.entity.basic.UnitMaintainEntity;
import com.glxp.api.admin.entity.inout.OrderEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.entity.inventory.*;
import com.glxp.api.admin.req.inventory.FilterInvCountCodesRequest;
import com.glxp.api.admin.req.inventory.FilterInvCountOrderRequest;
import com.glxp.api.admin.req.inventory.FilterInvCountOrderSaveRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.req.inventory.*;
import com.glxp.api.admin.res.inventory.InvCountOrderResponse;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.inventory.InvCountCodesService;
@ -110,12 +108,14 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
}
//封装相关数据
invCountOrder.setStatus(0); //未提交
//未提交
invCountOrder.setStatus(0);
if (StrUtil.isBlank(invCountOrder.getOrderId())) {
//生成单据号
String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.COUNT_ORDER, "yyyyMMdd"));
invCountOrder.setOrderId(orderId); //盘点单号
//盘点单号
invCountOrder.setOrderId(orderId);
AuthAdmin user = customerService.getUserBean();
invCountOrder.setCreateUser(user.getUserName());
invCountOrder.setCreateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
@ -158,29 +158,15 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
int diff = invCountOrderDetail.getInvNum() - invCountOrderDetail.getCountNum();
if (diff > 0) {
invCountOrderDetail.setLossNum(Math.abs(diff));
invCountOrderDetail.setStatus(0); //盘亏
//盘亏
invCountOrderDetail.setStatus(0);
} else if (diff < 0) {
invCountOrderDetail.setProfitNum(Math.abs(diff));
invCountOrderDetail.setStatus(1); //盘盈
//盘盈
invCountOrderDetail.setStatus(1);
} else {
invCountOrderDetail.setStatus(2); //平
}
//查询此产品的条码列表,判断此产品在库存中是多还是少
List<InvCountCodes> codesList = invCountCodesDao.selectByOrderIdAndProductId(invCountOrderDetail.getOrderIdFk(), invCountOrderDetail.getProductId());
//判断盘点的码中是否有次产品的码
if (CollUtil.isNotEmpty(codesList)) {
//查询库存中此产品的码数据,用来判断盘单据条码是多码还是少码
List<String> invDetailCodes = invProductDetailDao.selectCodeByInvCodeAndProductId(invCountOrder.getInvStorageCode(), invCountOrder.getInvWarehouseCode(), invCountOrder.getInvSpaceCode(), invCountOrderDetail.getProductId());
for (InvCountCodes invCountCodes : codesList) {
//查询此条码在库存中是否存在
boolean contains = invDetailCodes.contains(invCountCodes.getCode());
if (!contains) {
invCountCodes.setStatus(1);
}
}
//批量更新条码信息
invCountCodesDao.updateBatch(codesList);
//平衡
invCountOrderDetail.setStatus(2);
}
}
//更新单据信息
@ -201,12 +187,13 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
//审核不通过
//查询盘点单据详情,清空盘盈/盘亏数值
invCountOrderDetailDao.resetCountFiledValue(invCountOrder.getOrderId());
//清空条码的状态
invCountCodesDao.resetCountFiledValue(invCountOrder.getOrderId());
} else {
//审核通过
//根据单据详情生成相关单据
countOrderTransfer(invCountOrder);
log.info("单据审核通过,开始生成扫码单据");
ThreadUtil.execAsync(() -> {
countOrderTransfer(invCountOrder);
});
}
invCountOrderDao.updateByPrimaryKey(invCountOrder);
return ResultVOUtils.success();
@ -234,8 +221,6 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
/**
*
*
* @param invCountOrder
*/
private void countOrderTransfer(InvCountOrder invCountOrder) {
List<InvCountSettingEntity> list = invCountSettingDao.filterList(null);
@ -244,48 +229,156 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
return;
}
//根据盘点单据号,查询此盘点单的条码信息
FilterInvCountCodesRequest codesRequest = new FilterInvCountCodesRequest();
codesRequest.setOrderIdFk(invCountOrder.getOrderId());
List<InvCountCodes> codesList = invCountCodesDao.filterList(codesRequest);
List<String> countProductIds = codesList.stream().map(InvCountCodes::getProductId).collect(Collectors.toList());
//出入库单据条码
//出入库码明细列表
List<WarehouseEntity> inOrderCodes = new ArrayList<>();
List<WarehouseEntity> outOrderCodes = new ArrayList<>();
//查询库存详情表此产品的条码信息
for (String productId : countProductIds) {
FilterInvProductDetailRequest invProductDetailRequest = new FilterInvProductDetailRequest();
invProductDetailRequest.setProductIdFk(productId);
invProductDetailRequest.setInvStorageCode(invCountOrder.getInvStorageCode());
invProductDetailRequest.setInvWarehouseCode(invCountOrder.getInvWarehouseCode());
if (invCountOrder.getCountType() == 1) {
//按照货位盘点,查询库存详情添加货位条件
invProductDetailRequest.setInvSpaceCode(invCountOrder.getInvSpaceCode());
}
/**
*
* 1
* 2 / =
* 3
*
* 1
* 2 / =
* 3
*/
//构造库存详情查询参数
FilterInvProductDetailRequest invProductDetailRequest = new FilterInvProductDetailRequest();
invProductDetailRequest.setInvStorageCode(invCountOrder.getInvStorageCode());
invProductDetailRequest.setInvWarehouseCode(invCountOrder.getInvWarehouseCode());
//库存早于或等于盘点时间的库存数据,锁库存
invProductDetailRequest.setUpdateTime(invCountOrder.getCreateTime());
if (invCountOrder.getCountType() == 1) {
//按照货位盘点,查询库存详情添加货位条件
invProductDetailRequest.setInvSpaceCode(invCountOrder.getInvSpaceCode());
}
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(invProductDetailRequest);
if (CollUtil.isEmpty(invProductDetailEntities)) {
log.info("产品:" + productId + " 非当前仓库产品,添加到盘点入库单条码中");
//将此条码添加到入库单据条码中
codesList.forEach(invCountCodes -> {
if (invCountCodes.getProductId().equals(productId) && !verifyCodeExist(outOrderCodes, invCountCodes.getCode())) {
WarehouseEntity warehouseEntity = buildWarehouse(invCountOrder, invCountCodes.getCode(), invCountCodes.getProductId());
inOrderCodes.add(warehouseEntity);
FilterInvCountOrderDetailRequest detailRequest = new FilterInvCountOrderDetailRequest();
detailRequest.setOrderIdFk(invCountOrder.getOrderId());
//查询亏损单据详情
detailRequest.setStatus(0);
List<InvCountOrderDetail> lossDetailList = invCountOrderDetailDao.selectDetailList(detailRequest);
if (CollUtil.isNotEmpty(lossDetailList)) {
log.info("开始生成盘亏单据码明细");
log.info("查询盘亏产品码详情");
for (InvCountOrderDetail invCountOrderDetail : lossDetailList) {
//查询库存详情
invProductDetailRequest.setProductIdFk(invCountOrderDetail.getProductId());
invProductDetailRequest.setBatchNo(invCountOrderDetail.getBatchNo());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(invProductDetailRequest);
//查询盘点码明细
FilterInvCountCodesRequest codesRequest = new FilterInvCountCodesRequest();
codesRequest.setOrderIdFk(invCountOrder.getOrderId());
codesRequest.setProductId(invCountOrderDetail.getProductId());
codesRequest.setBatchNo(invCountOrderDetail.getBatchNo());
List<String> countCodesList = invCountCodesDao.selectCodes(codesRequest);
List<String> invProductCodes = invProductDetailEntities.stream().map(InvProductDetailEntity::getOriginCode).collect(Collectors.toList());
List<String> lossCodes = CollUtil.subtractToList(invProductCodes, countCodesList);
if (CollUtil.isNotEmpty(countCodesList) && CollUtil.isEmpty(lossCodes)) {
//盘点的码不为空,但是盘点数量和库存数量不一样,比对差集结果为空,说明是同一个条码,数量不同,直接根据盘亏数量计算生成一个扫码单据的码明细
//生成码详情
WarehouseEntity warehouseEntity = buildWarehouse(invCountOrder, invProductDetailEntities.get(0).getCode(), invProductDetailEntities.get(0).getProductIdFk());
//判断此条码,是否有批次号和序列号
UdiEntity udi = FilterUdiUtils.getUdi(invProductDetailEntities.get(0).getOriginCode());
//修改码数量
int actCount = invCountCodesService.getActCount(udi.getUdi());
//使用此盘点单据详情的盘亏数量 / 实际数量,计算得出扫码数量
int codeNum = invCountOrderDetail.getLossNum() / actCount;
warehouseEntity.setCount(codeNum);
warehouseEntity.setReCount(codeNum);
//设置供应商信息
setSupInfo(warehouseEntity);
outOrderCodes.add(warehouseEntity);
} else {
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
if (!countCodesList.contains(invProductDetailEntity.getOriginCode()) && !verifyCodeExist(outOrderCodes, invProductDetailEntity.getCode())) {
//生成码详情
WarehouseEntity warehouseEntity = buildWarehouse(invCountOrder, invProductDetailEntity.getCode(), invProductDetailEntity.getProductIdFk());
//判断此条码,是否有批次号和序列号
UdiEntity udi = FilterUdiUtils.getUdi(invProductDetailEntity.getOriginCode());
if ((StrUtil.isBlank(udi.getBatchNo()) && StrUtil.isBlank(udi.getSerialNo())) || (StrUtil.isBlank(udi.getSerialNo()) && StrUtil.isNotBlank(udi.getBatchNo()))) {
//修改码数量
int actCount = invCountCodesService.getActCount(udi.getUdi());
//使用此盘点单据详情的盘亏数量 / 实际数量,计算得出扫码数量
int codeNum = invCountOrderDetail.getLossNum() / actCount;
warehouseEntity.setCount(codeNum);
warehouseEntity.setReCount(codeNum);
}
//设置供应商信息
setSupInfo(warehouseEntity);
outOrderCodes.add(warehouseEntity);
}
}
});
} else {
//库存中存在此产品,筛选出盘点中不存在的条码,添加到盘点出库条码中
List<String> countCodes = codesList.stream().map(InvCountCodes::getCode).collect(Collectors.toList());
invProductDetailEntities.forEach(invProductDetailEntity -> {
if (!countCodes.contains(invProductDetailEntity.getOriginCode()) && !verifyCodeExist(outOrderCodes, invProductDetailEntity.getCode())) {
WarehouseEntity warehouseEntity = buildWarehouse(invCountOrder, invProductDetailEntity.getCode(), invProductDetailEntity.getProductIdFk());
outOrderCodes.add(warehouseEntity);
}
}
log.info("盘亏单据码明细生成完毕");
}
//生成盘盈单据的条码
//查询盘盈的单据详情
detailRequest.setStatus(1);
List<InvCountOrderDetail> profitDetailList = invCountOrderDetailDao.selectDetailList(detailRequest);
if (CollUtil.isNotEmpty(profitDetailList)) {
log.info("开始生成盘盈单据码明细");
//查询盘盈产品的库存详情
for (InvCountOrderDetail invCountOrderDetail : profitDetailList) {
//查询库存详情
invProductDetailRequest.setProductIdFk(invCountOrderDetail.getProductId());
invProductDetailRequest.setBatchNo(invCountOrderDetail.getBatchNo());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(invProductDetailRequest);
//查询盘点码明细
FilterInvCountCodesRequest codesRequest = new FilterInvCountCodesRequest();
codesRequest.setOrderIdFk(invCountOrder.getOrderId());
codesRequest.setProductId(invCountOrderDetail.getProductId());
codesRequest.setBatchNo(invCountOrderDetail.getBatchNo());
List<String> countCodesList = invCountCodesDao.selectCodes(codesRequest);
List<String> invProductCodeList = invProductDetailEntities.stream().map(InvProductDetailEntity::getOriginCode).collect(Collectors.toList());
List<String> profitCodes = CollUtil.subtractToList(countCodesList, invProductCodeList); //计算盘盈的条码
if (CollUtil.isNotEmpty(invProductCodeList) && CollUtil.isEmpty(profitCodes)) {
/**
*
*
*/
WarehouseEntity warehouseEntity = buildWarehouse(invCountOrder, countCodesList.get(0), invCountOrderDetail.getProductId());
//判断此条码,是否有批次号和序列号
UdiEntity udi = FilterUdiUtils.getUdi(countCodesList.get(0));
//修改码数量
int actCount = invCountCodesService.getActCount(udi.getUdi());
//使用此盘点单据详情的盘亏数量 / 实际数量,计算得出扫码数量
int codeNum = invCountOrderDetail.getProfitNum() / actCount;
warehouseEntity.setCount(codeNum);
warehouseEntity.setReCount(codeNum);
setSupInfo(warehouseEntity);
inOrderCodes.add(warehouseEntity);
} else {
for (String code : profitCodes) {
if (!verifyCodeExist(inOrderCodes, code)) {
//生成码详情
WarehouseEntity warehouseEntity = buildWarehouse(invCountOrder, code, invCountOrderDetail.getProductId());
//判断此条码,是否有批次号和序列号
UdiEntity udi = FilterUdiUtils.getUdi(code);
if ((StrUtil.isBlank(udi.getBatchNo()) && StrUtil.isBlank(udi.getSerialNo())) || (StrUtil.isBlank(udi.getSerialNo()) && StrUtil.isNotBlank(udi.getBatchNo()))) {
//修改码数量
int actCount = invCountCodesService.getActCount(udi.getUdi());
//使用此盘点单据详情的盘亏数量 / 实际数量,计算得出扫码数量
int codeNum = invCountOrderDetail.getProfitNum() / actCount;
warehouseEntity.setCount(codeNum);
warehouseEntity.setReCount(codeNum);
}
setSupInfo(warehouseEntity);
inOrderCodes.add(warehouseEntity);
}
}
});
}
}
log.info("盘盈单据码详情生成完毕");
}
InvCountSettingEntity invCountSettingEntity = list.get(0);
@ -300,11 +393,9 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
warehouseEntity.setFromCorp(order.getFromCorp());
warehouseEntity.setFromCorpId(order.getFromCorpId());
warehouseEntity.setCorpOrderId(order.getCorpOrderId());
//设置供应商信息
warehouseEntity.setSupId("");
});
invCountOrder.setInOrderIds(order.getId());
orderDao.insertOrder(order);
codesTempDao.insertCodesTemp(inOrderCodes);
log.info("盘盈入库单据生成成功");
@ -323,6 +414,8 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
String supId = codesDao.selectSupIdByCode(warehouseEntity.getCode());
warehouseEntity.setSupId(supId);
});
invCountOrder.setOutOrderIds(order.getId());
orderDao.insertOrder(order);
codesTempDao.insertCodesTemp(outOrderCodes);
log.info("盘亏入库单据生成成功");
@ -332,6 +425,22 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
invCountOrderDao.updateByOrderId(invCountOrder);
}
/**
*
*
* @param warehouseEntity
*/
private void setSupInfo(WarehouseEntity warehouseEntity) {
//设置供应商参数
String supId = invProductDetailDao.selectSupIdByCode(warehouseEntity.getCode());
if (StrUtil.isNotEmpty(supId)) {
warehouseEntity.setSupId(supId);
//查询供应商名称
String name = unitMaintainDao.selectNameByErpId(supId);
warehouseEntity.setSupName(name);
}
}
/**
*
*
@ -340,9 +449,10 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
* @return
*/
private boolean verifyCodeExist(List<WarehouseEntity> codes, String code) {
List<String> codesList = codes.stream().map(WarehouseEntity::getCode).collect(Collectors.toList());
if (codesList.contains(code)) {
return true;
for (WarehouseEntity warehouseEntity : codes) {
if (warehouseEntity.getCode().equals(code)) {
return true;
}
}
return false;
}
@ -387,8 +497,8 @@ public class InvCountOrderServiceImpl implements InvCountOrderService {
//构造单据数据
OrderEntity orderEntity = new OrderEntity();
orderEntity.setMainAction(type);
orderEntity.setAction(invCountSettingEntity.getInAction());
orderEntity.setMainAction(bussinessTypeEntity.getMainAction());
orderEntity.setAction(bussinessTypeEntity.getAction());
orderEntity.setActDate(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
orderEntity.setCreateTime(orderEntity.getActDate());
orderEntity.setInvStorageCode(invCountOrder.getInvStorageCode());

@ -0,0 +1,200 @@
package com.glxp.api.admin.service.inventory.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.constant.ConstantType;
import com.glxp.api.admin.dao.inventory.*;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.inventory.*;
import com.glxp.api.admin.req.inventory.AddMAOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse;
import com.glxp.api.admin.service.inventory.InvMAOrderDetailService;
import com.glxp.api.admin.util.FilterUdiUtils;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class InvMAOrderDetailServiceImpl implements InvMAOrderDetailService {
@Resource
private InvMaintenanceOrderDetailDao invMAOrderDetailDao;
@Resource
private InvMaintenanceOrderDao invMaintenanceOrderDao;
@Resource
private InvProductDetailDao invProductDetailDao;
@Resource
private InvMaintenanceExplanationDao invMaExplanationDao;
@Resource
private InvProductDao invProductDao;
@Override
public List<InvMAOrderDetailResponse> filterList(FilterInvMAOrderDetailRequest filterInvMAOrderDetailRequest) {
if (null == filterInvMAOrderDetailRequest) {
return Collections.emptyList();
}
if (null != filterInvMAOrderDetailRequest.getPage() && null != filterInvMAOrderDetailRequest.getLimit()) {
PageHelper.offsetPage((filterInvMAOrderDetailRequest.getPage() - 1) * filterInvMAOrderDetailRequest.getLimit(), filterInvMAOrderDetailRequest.getLimit());
}
return invMAOrderDetailDao.filterList(filterInvMAOrderDetailRequest);
}
@Override
public BaseResponse addOrderDetail(InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity) {
//解析条码
UdiEntity udi = FilterUdiUtils.getUdi(invMaintenanceOrderDetailEntity.getCode());
//查询此条码是否重复
InvMaintenanceOrderDetailEntity maintenanceOrderDetailEntity = invMAOrderDetailDao.selectByOrderIdAndCode(invMaintenanceOrderDetailEntity.getOrderIdFk(), invMaintenanceOrderDetailEntity.getCode());
//查询养护说明
InvMaintenanceExplanationEntity invMaintenanceExplanation = invMaExplanationDao.selectByStatus(1);
if (null != maintenanceOrderDetailEntity) {
if (StrUtil.isBlank(udi.getSerialNo()) || (StrUtil.isBlank(udi.getBatchNo()) && StrUtil.isBlank(udi.getSerialNo()))) {
maintenanceOrderDetailEntity.setCount(maintenanceOrderDetailEntity.getCount() + 1);
maintenanceOrderDetailEntity.setUpdateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
invMAOrderDetailDao.updateByPrimaryKey(maintenanceOrderDetailEntity);
} else {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "条码重复!");
}
} else {
//查询养护记录信息
InvMaintenanceOrderEntity maOrder = invMaintenanceOrderDao.selectByOrderId(invMaintenanceOrderDetailEntity.getOrderIdFk());
//查询此产品库存详情是否存在
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(invMaintenanceOrderDetailEntity.getCode());
filterInvProductDetailRequest.setBatchNo(udi.getBatchNo());
filterInvProductDetailRequest.setInvWarehouseCode(maOrder.getInvWarehouseCode());
filterInvProductDetailRequest.setInvSpaceCode(maOrder.getInvSpaceCode());
filterInvProductDetailRequest.setProductionDate(udi.getProduceDate());
filterInvProductDetailRequest.setExpireDate(udi.getExpireDate());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
log.info("库存中存在,添加到库存养护记录详情中");
//设置养护状态为未养护
invMaintenanceOrderDetailEntity.setMaintenanceStatus(0);
//设置设备养护状态为正常
invMaintenanceOrderDetailEntity.setDeviceStatus(1);
invMaintenanceOrderDetailEntity.setCount(1);
invMaintenanceOrderDetailEntity.setBatchNo(udi.getBatchNo());
invMaintenanceOrderDetailEntity.setProduceDate(udi.getProduceDate());
invMaintenanceOrderDetailEntity.setExpireDate(udi.getExpireDate());
invMaintenanceOrderDetailEntity.setNameCode(udi.getUdi());
invMaintenanceOrderDetailEntity.setProductId(invProductDetailEntities.get(0).getProductIdFk());
if (null != invMaintenanceExplanation) {
invMaintenanceOrderDetailEntity.setRemark(invMaintenanceExplanation.getText());
}
invMaintenanceOrderDetailEntity.setCreateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
invMAOrderDetailDao.insert(invMaintenanceOrderDetailEntity);
} else {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "当前仓库中不存在此产品,无法进行养护!");
}
}
return ResultVOUtils.success("添加库存养护详情成功!");
}
@Override
public BaseResponse delete(Integer id) {
//查询养护记录详情
InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity = invMAOrderDetailDao.selectByPrimaryKey(id);
if (invMaintenanceOrderDetailEntity.getCount() > 1) {
invMaintenanceOrderDetailEntity.setCount(invMaintenanceOrderDetailEntity.getCount() - 1);
invMAOrderDetailDao.updateByPrimaryKey(invMaintenanceOrderDetailEntity);
}
//养护数量为1直接删除养护记录详情
invMAOrderDetailDao.deleteByPrimaryKey(id);
return ResultVOUtils.success();
}
@Override
public BaseResponse batchAddDetail(AddMAOrderDetailRequest addMAOrderDetailRequest) {
//查询库存养护记录说明
InvMaintenanceExplanationEntity invMaintenanceExplanation = invMaExplanationDao.selectByStatus(1);
//遍历库存ID查找库存详情的条码信息生成库存养护记录详情
addMAOrderDetailRequest.getInvProductIds().forEach(invProductId -> {
//查询库存信息
InvProductEntity invProductEntity = invProductDao.selectById(invProductId);
//查询库存详情码信息
FilterInvProductDetailRequest detailRequest = new FilterInvProductDetailRequest();
detailRequest.setProductIdFk(invProductEntity.getRelIdFk());
detailRequest.setBatchNo(invProductEntity.getBatchNo());
detailRequest.setInvStorageCode(invProductEntity.getInvStorageCode());
detailRequest.setInvWarehouseCode(invProductEntity.getInvWarehouseCode());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(detailRequest);
//提取去重后的码集合
List<String> codeList = invProductDetailEntities.stream().map(InvProductDetailEntity::getOriginCode).distinct().collect(Collectors.toList());
//初始化码数量计算集合数据
Map<String, Integer> codeMap = new HashMap<>(codeList.size());
codeList.forEach(code -> codeMap.put(code, 0));
//计算当前在库存中的码明细
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
Integer count = codeMap.get(invProductDetailEntity.getOriginCode());
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
//出库
count = count - 1;
} else {
//入库
count = count + 1;
}
codeMap.put(invProductDetailEntity.getOriginCode(), count);
}
//根据库存中的码明细,生成库存养护记录详情
for (String code : codeMap.keySet()) {
if (codeMap.get(code) > 0) {
//获取库存详情
InvProductDetailEntity invProductDetailEntity = null;
for (InvProductDetailEntity detailEntity : invProductDetailEntities) {
if (detailEntity.getOriginCode().equals(code)) {
invProductDetailEntity = detailEntity;
break;
}
}
//生成库存养护记录详情
InvMaintenanceOrderDetailEntity maOrderDetail = new InvMaintenanceOrderDetailEntity();
maOrderDetail.setOrderIdFk(addMAOrderDetailRequest.getOrderIdFk());
maOrderDetail.setCode(invProductDetailEntity.getOriginCode());
maOrderDetail.setProductId(invProductDetailEntity.getProductIdFk());
UdiEntity udi = FilterUdiUtils.getUdi(invProductDetailEntity.getOriginCode());
maOrderDetail.setNameCode(udi.getUdi());
maOrderDetail.setProduceDate(udi.getProduceDate());
maOrderDetail.setExpireDate(udi.getExpireDate());
maOrderDetail.setBatchNo(udi.getBatchNo());
maOrderDetail.setCount(codeMap.get(code));
maOrderDetail.setMaintenanceStatus(0);
maOrderDetail.setDeviceStatus(1);
maOrderDetail.setCreateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
if (null != invMaintenanceExplanation) {
maOrderDetail.setRemark(invMaintenanceExplanation.getText());
}
invMAOrderDetailDao.insert(maOrderDetail);
}
}
});
return ResultVOUtils.success("添加成功");
}
@Override
public BaseResponse update(InvMaintenanceOrderDetailEntity invMaintenanceOrderDetailEntity) {
invMaintenanceOrderDetailEntity.setUpdateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
invMAOrderDetailDao.updateByPrimaryKey(invMaintenanceOrderDetailEntity);
return ResultVOUtils.success("更新成功!");
}
}

@ -0,0 +1,132 @@
package com.glxp.api.admin.service.inventory.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.dao.inventory.InvMaintenanceOrderDao;
import com.glxp.api.admin.dao.inventory.InvMaintenanceOrderDetailDao;
import com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity;
import com.glxp.api.admin.req.inventory.FilterInvMAOrderRequest;
import com.glxp.api.admin.res.inventory.InvMAOrderResponse;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.inventory.InvMAOrderService;
import com.glxp.api.admin.util.GennerOrderUtils;
import com.glxp.api.admin.util.OrderNoTypeBean;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class InvMAOrderServiceImpl implements InvMAOrderService {
@Resource
private InvMaintenanceOrderDao invMAOrderDao;
@Resource
private GennerOrderUtils gennerOrderUtils;
@Resource
private CustomerService customerService;
@Resource
private InvMaintenanceOrderDetailDao invMAOrderDetailDao;
@Override
public List<InvMAOrderResponse> filterList(FilterInvMAOrderRequest filterInvMAOrderRequest) {
if (null == filterInvMAOrderRequest) {
return Collections.emptyList();
}
if (null != filterInvMAOrderRequest.getPage() && null != filterInvMAOrderRequest.getLimit()) {
PageHelper.offsetPage((filterInvMAOrderRequest.getPage() - 1) * filterInvMAOrderRequest.getLimit(), filterInvMAOrderRequest.getLimit());
}
return invMAOrderDao.filterList(filterInvMAOrderRequest);
}
@Override
public BaseResponse addOrder(InvMaintenanceOrderEntity invMaintenanceOrder) {
if (null == invMaintenanceOrder || StrUtil.isBlank(invMaintenanceOrder.getInvWarehouseCode())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
//生成养护记录
//生成单据号
invMaintenanceOrder.setOrderId(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.MA_ORDER, "yyyyMMdd")));
//创建时间
invMaintenanceOrder.setCreateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
//创建人
String createUser = customerService.getUserBean().getUserName();
invMaintenanceOrder.setCreateUser(createUser);
//设置状态为草稿
invMaintenanceOrder.setStatus(0);
invMAOrderDao.insert(invMaintenanceOrder);
return ResultVOUtils.success(invMaintenanceOrder);
}
@Override
public BaseResponse update(InvMaintenanceOrderEntity invMaintenanceOrder) {
//查找此单据是否存在
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByOrderId(invMaintenanceOrder.getOrderId());
if (null == maintenanceOrder) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此单据不存在!");
}
//复制新数据
BeanUtil.copyProperties(invMaintenanceOrder, maintenanceOrder, "id", "createTime", "createUser");
invMAOrderDao.updateByPrimaryKey(maintenanceOrder);
return ResultVOUtils.success("更新成功");
}
@Override
public BaseResponse submitAudit(Integer id) {
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByPrimaryKey(id);
if (null == maintenanceOrder) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录不存在!");
}
if (maintenanceOrder.getStatus() != 0) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录已提交审核,请勿重复提交!");
}
//查询此养护记录是否添加详情
Long count = invMAOrderDetailDao.countByOrderId(maintenanceOrder.getOrderId());
if (count == 0) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请添加养护产品!");
}
maintenanceOrder.setStatus(1);
maintenanceOrder.setUpdateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
invMAOrderDao.updateByPrimaryKey(maintenanceOrder);
return ResultVOUtils.success("提交成功");
}
@Override
public BaseResponse updateStatus(Integer id, Integer status) {
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByPrimaryKey(id);
if (null == maintenanceOrder || maintenanceOrder.getStatus() != 1) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
maintenanceOrder.setStatus(status);
maintenanceOrder.setAuditTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
maintenanceOrder.setUpdateTime(DateUtil.date().toString(DatePattern.NORM_DATETIME_PATTERN));
invMAOrderDao.updateByPrimaryKey(maintenanceOrder);
return ResultVOUtils.success("更新成功");
}
@Override
public BaseResponse delete(Integer id) {
InvMaintenanceOrderEntity maintenanceOrder = invMAOrderDao.selectByPrimaryKey(id);
if (null == maintenanceOrder) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此记录不存在!");
}
//删除养护记录和详情
invMAOrderDao.deleteByPrimaryKey(id);
invMAOrderDetailDao.deleteByOrderId(maintenanceOrder.getOrderId());
return ResultVOUtils.success("删除成功");
}
}

@ -7,6 +7,7 @@ import com.glxp.api.admin.dao.inventory.InvProductDao;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.res.inventory.MAInvProductResponse;
import com.glxp.api.admin.service.inventory.InvProductService;
import org.springframework.stereotype.Service;
@ -145,7 +146,7 @@ public class InvProductServiceImpl implements InvProductService {
}
@Override
public List<InvProductResponse> getCountInvProductProduct(FilterInvProductRequest filterInvProductRequest) {
public List<InvProductResponse> getCountInvProduct(FilterInvProductRequest filterInvProductRequest) {
if (null == filterInvProductRequest) {
return Collections.emptyList();
}
@ -155,4 +156,15 @@ public class InvProductServiceImpl implements InvProductService {
return invProductDao.getCountInvProduct(filterInvProductRequest);
}
@Override
public List<MAInvProductResponse> getMAInvProducts(FilterInvProductRequest filterInvProductRequest) {
if (null == filterInvProductRequest) {
return Collections.emptyList();
}
if (null != filterInvProductRequest.getPage() && null != filterInvProductRequest.getLimit()) {
PageHelper.offsetPage((filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit(), filterInvProductRequest.getLimit());
}
return invProductDao.getMAInvProducts(filterInvProductRequest);
}
}

@ -23,4 +23,7 @@ public interface SupManufacturerService {
boolean deleteById(String id);
List<SupManufacturerEntity> getCompanyByNameAndCode(FilterSupManufacturerRequest filterSupManufacturerRequest);
}

@ -72,4 +72,9 @@ public class SupManufacturerServiceImpl implements SupManufacturerService {
public boolean deleteById(String id) {
return supManufacturerDao.deleteById(id);
}
@Override
public List<SupManufacturerEntity> getCompanyByNameAndCode(FilterSupManufacturerRequest filterSupManufacturerRequest) {
return supManufacturerDao.getCompanyByNameAndCode(filterSupManufacturerRequest);
}
}

@ -479,7 +479,7 @@ public class InvProductsTrService {
//寄售出库生成单据
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setActDate(DateUtil.getBeforeDay(fromDate(orderEntity), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setCreateTime(outOrder.getActDate());
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_OUT);
@ -550,7 +550,7 @@ public class InvProductsTrService {
temps = filterSupMaps.get(corpName);
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setActDate(DateUtil.getBeforeDay(fromDate(orderEntity), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setCreateTime(outOrder.getActDate());
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
@ -598,7 +598,7 @@ public class InvProductsTrService {
for (WarehouseEntity warehouseEntity : unkonwCorpList) {
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setActDate(DateUtil.getBeforeDay(fromDate(orderEntity), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setCreateTime(outOrder.getActDate());
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
@ -674,7 +674,7 @@ public class InvProductsTrService {
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setSupplementNo(null);//补单需置空
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setActDate(DateUtil.getBeforeDay(fromDate(orderEntity), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setCreateTime(outOrder.getActDate());
outOrder.setAction(bussinessTypeEntity.getAction());
outOrder.setMainAction(bussinessTypeEntity.getMainAction());
@ -756,7 +756,7 @@ public class InvProductsTrService {
temps = filterSupMaps.get(corpName);
OrderEntity outOrder = new OrderEntity();
BeanUtils.copyProperties(orderEntity, outOrder);
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setActDate(DateUtil.getBeforeDay(fromDate(orderEntity), bussinessChangeTypeEntity.getBeforeTime()));
outOrder.setCreateTime(outOrder.getActDate());
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
outOrder.setMainAction(ConstantType.TYPE_PUT);
@ -1116,4 +1116,17 @@ public class InvProductsTrService {
} else return false;
}
String fromDate(OrderEntity orderEntity) {
String time = "";
if (orderEntity.getAuditTime() != null) {
time = DateUtil.formatDateTime(orderEntity.getAuditTime());
} else {
time = orderEntity.getActDate();
}
return time;
}
}

@ -11,6 +11,7 @@ import com.glxp.api.admin.util.gs1.Gs1128Decoder;
import com.glxp.api.admin.util.gs1.Gs1128Engine;
import java.util.Map;
import java.util.Optional;
/**
* @author
@ -308,4 +309,18 @@ public class FilterUdiUtils {
"#" + warehouseEntity.getBatchNo() + "#" + "#" + "#";
return udiCode;
}
/**
* UDI
* @param warehouseEntity
* @return
*/
public static String transGlxpHasSerStr(WarehouseEntity warehouseEntity) {
String udiCode = "#" + warehouseEntity.getNameCode()
+ "#" + Optional.ofNullable(warehouseEntity.getProduceDate()).orElse("")
+ "#" + Optional.ofNullable(warehouseEntity.getExpireDate()).orElse("")
+ "#" + Optional.ofNullable(warehouseEntity.getBatchNo()).orElse("")
+ "#" + Optional.ofNullable(warehouseEntity.getSerialNo()).orElse("") + "#" + "#";
return udiCode;
}
}

@ -1,8 +1,8 @@
server.port=9991
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms_ph1?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.66:3364/udiwms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.password=Glxp@6066
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.maximum-pool-size=60
spring.datasource.hikari.minimum-idle=10

@ -1,7 +1,7 @@
# \u672C\u5730\u73AF\u5883
server.port=9991
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.148:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.148:3306/udiwms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=Glxp@6066
#spring.datasource.password=89083fb2fc145533

@ -1,7 +1,7 @@
# \u672C\u5730\u73AF\u5883
server.port=9991
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.66:3360/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.66:3360/udiwms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=root
#spring.datasource.password=89083fb2fc145533

@ -1,7 +1,7 @@
# \u672C\u5730\u73AF\u5883
server.port=9991
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.66:3361/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.66:3361/udiwms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=root
#spring.datasource.password=89083fb2fc145533

@ -25,6 +25,9 @@
<if test="syncTime != null and syncTime != ''">
and #{syncTime} >= startTime and #{syncTime} &lt;= endTime
</if>
<if test="receiveStatus != null">
and receiveStatus = #{receiveStatus}
</if>
</where>
order by updateTime desc
</select>
@ -33,7 +36,7 @@
<insert id="insertExportStatus" keyProperty="id"
parameterType="com.glxp.api.admin.entity.basic.BasicExportStatusEntity">
replace
INTO basic_export_status(id,idDatas,status,type,updateTime,scheduleType,startTime,endTime,remark)
INTO basic_export_status(id,idDatas,status,`type`,updateTime,scheduleType,startTime,endTime,remark,receiveStatus)
values(
#{id},
#{idDatas},
@ -43,7 +46,8 @@
#{scheduleType},
#{startTime},
#{endTime},
#{remark}
#{remark},
#{receiveStatus}
)
</insert>

@ -327,12 +327,14 @@
<if test="checkPc != null">checkPc=#{checkPc},</if>
<if test="checkWebNew != null">checkWebNew=#{checkWebNew},</if>
<if test="checkChange != null">checkChange=#{checkChange},</if>
<if test="checkSp != null">checkSp=#{checkSp},</if>
<if test="secCheckUdims != null">secCheckUdims=#{secCheckUdims},</if>
<if test="secCheckPdaEd != null">secCheckPdaEd=#{secCheckPdaEd},</if>
<if test="secCheckPdaUn != null">secCheckPdaUn=#{secCheckPdaUn},</if>
<if test="secCheckPc != null">secCheckPc=#{secCheckPc},</if>
<if test="secCheckWebNew != null">secCheckWebNew=#{secCheckWebNew},</if>
<if test="secCheckChange != null">secCheckChange=#{secCheckChange},</if>
<if test="secCheckSp != null">secCheckSp=#{secCheckSp},</if>
<if test="checkBalacne != null">checkBalacne=#{checkBalacne},</if>
<if test="secCheckBalacne != null">secCheckBalacne=#{secCheckBalacne},</if>
<if test="index != null">index=#{index},</if>

@ -67,4 +67,8 @@
from basic_corp
where erpId = #{erpId}
</select>
<select id="selectNameByErpId" resultType="java.lang.String">
select name from basic_corp where erpId = #{erpId}
</select>
</mapper>

@ -0,0 +1,26 @@
<?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.admin.dao.info.DbVersionDao">
<select id="selectVersion" resultType="int">
selecT count(1)
from db_version
where version = #{version}
</select>
<select id="selectTableExist" resultType="int">
select count(*) count
from information_schema.TABLES
where TABLE_NAME = #{tableName} and table_schema = (select database())
</select>
<insert id="insertVersion">
insert into db_version(id, version, remark, created)
values (uuid(), #{version}, #{remark}, #{created})
</insert>
</mapper>

@ -33,6 +33,13 @@
<if test="relId != '' and relId!=null">
and relId =#{relId}
</if>
<if test="actions!=null">
and
`action` in
<foreach collection="actions" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
ORDER BY actDate
</select>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save