diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/OpFactoryPackageDataVO.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/OpFactoryPackageDataVO.java new file mode 100644 index 000000000..4fb5d9d11 --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/OpFactoryPackageDataVO.java @@ -0,0 +1,47 @@ +package com.logpm.factory.oupai.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class OpFactoryPackageDataVO implements Serializable { + + + private Long id; + /** 车次号 */ + @ApiModelProperty(name = "车次号",notes = "") + private String carNumber; + /** 合同号 */ + @ApiModelProperty(name = "包条码",notes = "") + private String selfCode; + /** 服务号 */ + @ApiModelProperty(name = "服务号",notes = "") + private String serviceNumber; + /** 收货单位 */ + @ApiModelProperty(name = "收货单位",notes = "") + private String shopName; + /** 包条码 */ + @ApiModelProperty(name = "包条码",notes = "") + private String orderPackCode; + /** 一级品 */ + @ApiModelProperty(name = "一级品",notes = "") + private String firstClassName; + /** 二级品 */ + @ApiModelProperty(name = "二级品",notes = "") + private String secondClassName; + /** 三级品 */ + @ApiModelProperty(name = "三级品",notes = "") + private String thirdClassName; + /** + * 推送状态 + * 1 推送 0 未推送 + * 3 收货推送完成 4 出库推送完成 + */ + private String pushStatus; + + + + +} diff --git a/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/PackageArgsVo.java b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/PackageArgsVo.java new file mode 100644 index 000000000..ea2d20968 --- /dev/null +++ b/blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/vo/PackageArgsVo.java @@ -0,0 +1,21 @@ +package com.logpm.factory.oupai.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class PackageArgsVo implements Serializable { + + /** + * 选择的ID + */ + private List ids; + + /** + * 推送状态 + */ + private Integer pushStatus; + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java index e2be9678b..ff731e65d 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java @@ -75,6 +75,27 @@ public class BasicdataFactoryCategoryController extends BladeController { } } + + @ResponseBody + @PostMapping("/update") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "修改工厂物料", notes = "传入basicdataFactoryCategoryDTO") + public R update(@RequestBody BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) { + String method = "############save: "; + log.info(method + "请求参数{}", basicdataFactoryCategoryDTO); + try { + return R.status(basicdataFactoryCategoryService.updateById(basicdataFactoryCategoryDTO)) ; + } catch (CustomerException e) { + log.error(e.message, e); + return R.fail(e.code, e.message); + } catch (Exception e) { + log.error(method + "系统异常", e); + return R.fail(500, method + "系统异常"); + } + } + + + @ResponseBody @PostMapping("/remove") @ApiOperationSupport(order = 1) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java index f5e5580bf..41996f965 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java @@ -38,7 +38,8 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer { .excludePathPatterns("/factory/common/**").order(2); interceptorRegistry.addInterceptor(new ZbFactoryAccountsInterceptor(zbFactoryProperties)) .addPathPatterns("/factory/zb/**").order(3); - interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,redisLockClient,mockLoginService)).addPathPatterns("/**").order(1); + + interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,redisLockClient,mockLoginService)).addPathPatterns("/**").order(1).excludePathPatterns("/ouPai/factoryPackage/**"); } } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/controller/FactoryPackageController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/controller/FactoryPackageController.java index 8e5c9404d..bb7404b81 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/controller/FactoryPackageController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/controller/FactoryPackageController.java @@ -23,6 +23,8 @@ import com.logpm.factory.oupai.entity.FactoryPackageEntity; import com.logpm.factory.oupai.service.IFactoryPackageService; import com.logpm.factory.oupai.service.IOuPaiFactoryService; import com.logpm.factory.oupai.vo.FactoryPackageVO; +import com.logpm.factory.oupai.vo.OpFactoryPackageDataVO; +import com.logpm.factory.oupai.vo.PackageArgsVo; import com.logpm.factory.oupai.wrapper.FactoryPackageWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -31,12 +33,14 @@ import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid; +import java.util.List; import java.util.Map; /** @@ -47,12 +51,13 @@ import java.util.Map; */ @RestController @AllArgsConstructor -@RequestMapping("logpm-factory/factoryPackage") +@RequestMapping("/ouPai/factoryPackage") @Api(value = "欧派工厂包件", tags = "欧派工厂包件接口") public class FactoryPackageController extends BladeController { private final IFactoryPackageService factoryPackageService; private IOuPaiFactoryService ouPaiFactoryService; + /** * 欧派工厂包件 详情 */ @@ -63,6 +68,7 @@ public class FactoryPackageController extends BladeController { FactoryPackageEntity detail = factoryPackageService.getOne(Condition.getQueryWrapper(factoryPackage)); return R.data(FactoryPackageWrapper.build().entityVO(detail)); } + /** * 欧派工厂包件 分页 */ @@ -80,11 +86,67 @@ public class FactoryPackageController extends BladeController { @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入factoryPackage") - public R> page(FactoryPackageVO factoryPackage, Query query) { - IPage pages = factoryPackageService.selectFactoryPackagePage(Condition.getPage(query), factoryPackage); + public R> page(OpFactoryPackageDataVO factoryPackage, Query query) { + IPage pages = factoryPackageService.selectFactoryPackagePage(Condition.getPage(query), factoryPackage); return R.data(pages); } + + // 需要实现勾选包件进行推送入库 出库节点 + @PostMapping("/sendDataByChoes") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入factoryPackage") + public R sendDataByChoes(@Valid @RequestBody PackageArgsVo packageArgs) { + + + List ids = packageArgs.getIds(); + + // 判断当前选择的包条状态是否符合用户作业状态 + + String dataPush ="1"; + + + List factoryPackageEntities = factoryPackageService.listByIds(ids); + + // 选择推送为 3 不能包含 状态为4 的数据 + if(packageArgs.getPushStatus()==3){ + for (FactoryPackageEntity factoryPackageEntity : factoryPackageEntities) { + if (factoryPackageEntity.getPackageStatus() == 4) { + return R.fail("包条码:"+factoryPackageEntity.getCode()+",包件状态为已推送出库,不能进行推送操作"); + } + } + } + + if(packageArgs.getPushStatus()==4){ + dataPush = "7"; + // 选择推送 4 不能包含 0 的状态数据 + for (FactoryPackageEntity factoryPackageEntity : factoryPackageEntities) { + if (factoryPackageEntity.getPackageStatus() == 0) { + return R.fail("包条码:"+factoryPackageEntity.getCode()+",包件状态为未推送,需要推送入库后在进行出库推送"); + } + } + } + + + + try { + for (FactoryPackageEntity factoryPackageEntity : factoryPackageEntities) { + OrderStatusDTO orderStatusDTO = new OrderStatusDTO(); + orderStatusDTO.setUnitNo(factoryPackageEntity.getCode()); + orderStatusDTO.setStatus(dataPush); + // 查询老系统的操作人 + orderStatusDTO.setUsername(AuthUtil.getNickName());// 操作人 + ouPaiFactoryService.handleStatusData(orderStatusDTO); + } + return R.success("操作成功!"); + } catch (Exception e) { + return R.fail("操作失败"); + } + + + } + + /** * 欧派工厂包件 新增 */ diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.java index 6c0b186e9..e06b5229f 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.java @@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.factory.oupai.entity.FactoryPackageEntity; import com.logpm.factory.oupai.vo.FactoryPackageVO; +import com.logpm.factory.oupai.vo.OpFactoryPackageDataVO; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -41,5 +43,5 @@ public interface FactoryPackageMapper extends BaseMapper { List selectFactoryPackagePage(IPage page, FactoryPackageVO factoryPackage); - + List selectFactoryPackagePageByPushStatus(IPage page, @Param("factoryPackage") OpFactoryPackageDataVO factoryPackage); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.xml b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.xml index 5875259d8..4f24799f4 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.xml +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageMapper.xml @@ -10,7 +10,37 @@ + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryPackageService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryPackageService.java index 483aa73f6..9b7186ddc 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryPackageService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryPackageService.java @@ -19,6 +19,7 @@ package com.logpm.factory.oupai.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.factory.oupai.entity.FactoryPackageEntity; import com.logpm.factory.oupai.vo.FactoryPackageVO; +import com.logpm.factory.oupai.vo.OpFactoryPackageDataVO; import org.springblade.core.mp.base.BaseService; @@ -36,7 +37,7 @@ public interface IFactoryPackageService extends BaseService selectFactoryPackagePage(IPage page, FactoryPackageVO factoryPackage); + IPage selectFactoryPackagePage(IPage page, OpFactoryPackageDataVO factoryPackage); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryPackageServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryPackageServiceImpl.java index 2f65adf29..7b2a33a17 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryPackageServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryPackageServiceImpl.java @@ -21,6 +21,7 @@ import com.logpm.factory.oupai.entity.FactoryPackageEntity; import com.logpm.factory.oupai.mapper.FactoryPackageMapper; import com.logpm.factory.oupai.service.IFactoryPackageService; import com.logpm.factory.oupai.vo.FactoryPackageVO; +import com.logpm.factory.oupai.vo.OpFactoryPackageDataVO; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; @@ -35,8 +36,8 @@ import org.springframework.stereotype.Service; public class FactoryPackageServiceImpl extends BaseServiceImpl implements IFactoryPackageService { @Override - public IPage selectFactoryPackagePage(IPage page, FactoryPackageVO factoryPackage) { - return page.setRecords(baseMapper.selectFactoryPackagePage(page, factoryPackage)); + public IPage selectFactoryPackagePage(IPage page, OpFactoryPackageDataVO factoryPackage) { + return page.setRecords(baseMapper.selectFactoryPackagePageByPushStatus(page, factoryPackage)); }