diff --git a/cf-module-infra/cf-module-infra-biz/pom.xml b/cf-module-infra/cf-module-infra-biz/pom.xml index 3f53410dc..c8ac36b85 100644 --- a/cf-module-infra/cf-module-infra-biz/pom.xml +++ b/cf-module-infra/cf-module-infra-biz/pom.xml @@ -169,6 +169,46 @@ + + org.apache.maven.plugins + maven-dependency-plugin + ${maven.dependency.plugin.version} + + + prepare-package + + copy-dependencies + + + + target/lib + + com.cf.imes + + + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven.assembly.plugin.version} + + false + + + src/main/build/assembly.xml + + + + + bundle + package + + single + + + + diff --git a/cf-module-infra/cf-module-infra-biz/src/main/build/assembly.xml b/cf-module-infra/cf-module-infra-biz/src/main/build/assembly.xml new file mode 100644 index 000000000..6569531ff --- /dev/null +++ b/cf-module-infra/cf-module-infra-biz/src/main/build/assembly.xml @@ -0,0 +1,39 @@ + + bundle + + tar.gz + + false + + + + + ${basedir}/src/main/resources + config + + application-${profileActive}.yaml + bootstrap-${profileActive}.yaml + bootstrap.yaml + + + + + + ${basedir}/target/lib + + *.jar + + + lib + + + + ${project.build.directory} + / + + ${project.artifactId}.jar + + + + + \ No newline at end of file diff --git a/cf-module-infra/cf-module-infra-biz/src/main/resources/application-test.yaml b/cf-module-infra/cf-module-infra-biz/src/main/resources/application-test.yaml new file mode 100644 index 000000000..110cf76c9 --- /dev/null +++ b/cf-module-infra/cf-module-infra-biz/src/main/resources/application-test.yaml @@ -0,0 +1,4 @@ +spring: + main: + allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 + allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务 \ No newline at end of file diff --git a/cf-module-infra/cf-module-infra-biz/src/main/resources/bootstrap-test.yaml b/cf-module-infra/cf-module-infra-biz/src/main/resources/bootstrap-test.yaml new file mode 100644 index 000000000..90fc424cd --- /dev/null +++ b/cf-module-infra/cf-module-infra-biz/src/main/resources/bootstrap-test.yaml @@ -0,0 +1,23 @@ +--- #################### 注册中心相关配置 #################### + +spring: + cloud: + nacos: + server-addr: 192.168.1.204:8848 + discovery: + namespace: imes-test # 命名空间。这里使用 dev 开发环境 + metadata: + version: 1.0.0 # 服务实例的版本号,可用于灰度发布 + +--- #################### 配置中心相关配置 #################### + +spring: + cloud: + nacos: + # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 + config: + server-addr: 192.168.1.204:8848 # Nacos 服务器地址 + namespace: imes-test # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 + group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP + name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name + file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java index 1dce77e80..7a41e5b66 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java @@ -70,14 +70,14 @@ public class OrderController { @PostMapping("/create") @Operation(summary = "创建生产单") - @PreAuthorize("@ss.hasPermission('executor:order:create')") + @PreAuthorize("@ss.hasPermission('production:manager-list:create')") public CommonResult createOrder(@Valid @RequestBody OrderSaveReqVO createReqVO) { return success(orderService.createOrder(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新生产单") - @PreAuthorize("@ss.hasPermission('executor:order:update')") + @PreAuthorize("@ss.hasPermission('production:manager-list:edit')") public CommonResult updateOrder(@Valid @RequestBody OrderSaveReqVO updateReqVO) { orderService.updateOrder(updateReqVO); return success(true); @@ -90,7 +90,7 @@ public class OrderController { @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024"), @Parameter(name = "bodyIds", description = "柜体编号集合", required = true, example = "1,2") }) - @PreAuthorize("@ss.hasPermission('executor:order:delete')") + @PreAuthorize("@ss.hasPermission('production:manager-list:deleteCabinet')") public CommonResult deleteBody(@RequestParam("orderId") Long orderId, @RequestParam("bodyIds") Set bodyIds) { orderService.deleteBodyByOrder(orderId, bodyIds); return success(true); @@ -99,7 +99,7 @@ public class OrderController { @DeleteMapping("/delete") @Operation(summary = "作废") @Parameter(name = "orderId", description = "生产单id", required = true, example = "1") - @PreAuthorize("@ss.hasPermission('executor:order:delete')") + @PreAuthorize("@ss.hasPermission('production:manager-list:nullify')") public CommonResult deleteOrder(@RequestParam("orderId") Long orderId) { orderService.deleteOrder(orderId); return success(true); @@ -108,7 +108,7 @@ public class OrderController { @PutMapping("/restore") @Operation(summary = "还原") @Parameter(name = "orderId", description = "生产单id", required = true, example = "1") - @PreAuthorize("@ss.hasPermission('executor:order:update')") + @PreAuthorize("@ss.hasPermission('production:manager-list:backOrder')") public CommonResult restoreOrder(@RequestBody JSONObject jsonObject) { Long orderId = jsonObject.getLong("orderId"); orderService.restoreOrder(orderId); @@ -118,7 +118,7 @@ public class OrderController { @GetMapping("/get") @Operation(summary = "获得(单个)生产单") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:detail')") public CommonResult getOrder(@RequestParam("id") Long id) { OrderDO order = orderService.getOrder(id); return success(BeanUtils.toBean(order, OrderRespVO.class)); @@ -126,7 +126,7 @@ public class OrderController { @GetMapping("/page") @Operation(summary = "获得生产单分页") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('productManager:List')") public CommonResult> getOrderPage(@Valid OrderPageReqVO pageReqVO) { PageResult pageResult = orderService.getOrderPage(pageReqVO); return success(BeanUtils.toBean(pageResult, OrderRespVO.class)); @@ -142,7 +142,7 @@ public class OrderController { @GetMapping("/get-room") @Operation(summary = "生产单详情-房间和柜体id") @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:detail')") public CommonResult> getRoom(@RequestParam("orderId") Long orderId) { List orderBodyMap = orderService.getOrderBody(orderId); return success(orderBodyMap); @@ -151,7 +151,7 @@ public class OrderController { @GetMapping("/get-module") @Operation(summary = "生产单详情-数量信息") @Parameter(name = "orderId", description = "生产单编号", example = "1024") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:detail')") public CommonResult>> getModule(@RequestParam("orderId") Long orderId) { Map> moduleDOList = orderService.getModule(orderId); return success(moduleDOList); @@ -166,7 +166,7 @@ public class OrderController { @Parameter(name = "groupId", description = "加工组编号", example = "1024"), @Parameter(name = "groupName", description = "加工组名称", example = "弧形") }) - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:detail')") public CommonResult> platesDetails(@RequestParam("orderId") Long orderId, @RequestParam(value = "roomId", required = false) Long roomId, @RequestParam(value = "bodyId", required = false) Long bodyId, @@ -184,7 +184,7 @@ public class OrderController { @Parameter(name = "bodyId", description = "柜体编号", example = "1024"), @Parameter(name = "name", description = "配件名称", example = "1024") }) - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:detail')") public CommonResult> partsDetails(@RequestParam("orderId") Long orderId, @RequestParam(value = "roomId", required = false) Long roomId, @RequestParam(value = "bodyId", required = false) Long bodyId, @@ -197,14 +197,14 @@ public class OrderController { @GetMapping("/get-body") @Operation(summary = "生产单柜体数据获取") @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:detail')") public CommonResult> getBody(@RequestParam("orderId") Long orderId) { return success(BeanUtils.toBean(orderService.getBody(orderId), OrderBodyRespVO.class)); } @GetMapping("getApiData") @Operation(summary = "生产单api数据导入新增") - @PreAuthorize("@ss.hasPermission('executor:order:getApiData')") + @PreAuthorize("@ss.hasPermission('production:manager-list:create')") public CommonResult test(@RequestParam(value = "orderNo", required = false, defaultValue = "20230809027818") String orderNo) throws InterruptedException, ExecutionException { // return success(orderService.importApiData(orderNo)); @@ -235,7 +235,7 @@ public class OrderController { @Parameter(name = "file", description = "文件", required = true), @Parameter(name = "type", description = "文件类型", required = true) }) - @PreAuthorize("@ss.hasPermission('executor:order:importExcel')") + @PreAuthorize("@ss.hasPermission('production:manager-list:create')") @OperateLog(type = EXPORT) public void exportTest(@RequestPart("file") MultipartFile file, @RequestParam(value = "type", required = false, defaultValue = "true") Integer type, @@ -274,7 +274,7 @@ public class OrderController { @GetMapping("/get-goodsList") @Operation(summary = "生产单所用板材商品信息") @Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:detail')") public CommonResult> getGoodsList(@RequestParam("orderId") Long orderId) { List goodsDOS = orderService.getGoodsList(orderId); return success(goodsDOS); @@ -286,7 +286,7 @@ public class OrderController { @Parameter(name = "file", description = "文件", required = true), @Parameter(name = "type", description = "是否强制上传", required = false) }) - @PreAuthorize("@ss.hasPermission('executor:order:upload')") + @PreAuthorize("@ss.hasPermission('production:manager-list:create')") public CommonResult uploadOrderType(@RequestPart("file") MultipartFile file, @RequestParam(value = "type", required = false, defaultValue = "false") Boolean type) { return success(orderService.importTemplate(file,type)); @@ -295,7 +295,7 @@ public class OrderController { @GetMapping("/printing") @Operation(summary = "打印/导出 数据文件") @Parameter(name = "type", description = "文件类型", required = true, example = "0") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @PreAuthorize("@ss.hasPermission('production:manager-list:export')") @OperateLog(type = EXPORT) public CommonResult> getOrderPrintData( @RequestParam("orderId") Long orderId, diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/OptimizePlanController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/OptimizePlanController.java index 6d128e0db..e211d2d53 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/OptimizePlanController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/OptimizePlanController.java @@ -90,7 +90,7 @@ public class OptimizePlanController { @GetMapping("/getOrderSource") @Operation(summary = "获取生产单源数据") - @PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')") + @PreAuthorize("@ss.hasPermission('production:manager-list:calculate')") public CommonResult getOrderSource(@Schema(description = "生产单id") @RequestParam(required = false) Long orderId, @Schema(description = "排单id") @RequestParam(required = false) Long planId, @Schema(description = "机台Id") @RequestParam("machineId") Long machineId diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java index 23175db65..f19e7e73d 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java @@ -37,14 +37,14 @@ public class PlanController { @PostMapping("/create") @Operation(summary = "创建排单") - @PreAuthorize("@ss.hasPermission('executor:plan:create')") + @PreAuthorize("@ss.hasPermission('placeorder:create')") public CommonResult createPlan(@Validated(CreateGroup.class) @RequestBody PlanSaveReqVO createReqVO) { return success(planService.createPlan(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新排单") - @PreAuthorize("@ss.hasPermission('executor:plan:update')") + @PreAuthorize("@ss.hasPermission('placeorder:update')") public CommonResult updatePlan(@Validated(UpdateGroup.class) @RequestBody PlanSaveReqVO updateReqVO) { planService.updatePlan(updateReqVO); return success(true); @@ -53,7 +53,7 @@ public class PlanController { @DeleteMapping("/delete") @Operation(summary = "删除排单") @Parameter(name = "id", description = "排单id", required = true) - @PreAuthorize("@ss.hasPermission('executor:plan:delete')") + @PreAuthorize("@ss.hasPermission('placeorder:delete')") public CommonResult deletePlan(@RequestParam("id") Long id) { return success(planService.deletePlan(id)); } @@ -70,7 +70,7 @@ public class PlanController { @GetMapping("/get") @Operation(summary = "获得排单") @Parameter(name = "id", description = "排单id", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('executor:plan:query')") + @PreAuthorize("@ss.hasPermission('placeorder:query')") public CommonResult getPlan(@RequestParam("id") Long id) { PlanRespVO plan = planService.getPlan(id); return success(BeanUtils.toBean(plan, PlanRespVO.class)); @@ -85,14 +85,14 @@ public class PlanController { @GetMapping("getOrderByPlan") @Operation(summary = "根据排单获取生产单分页") - @PreAuthorize("@ss.hasPermission('executor:plan:query')") + @PreAuthorize("@ss.hasPermission('placeorder:orderlist')") public CommonResult> getOrderByPlanId(@Valid PlanOrderPageReqVO pageReqVO) { return success(planService.getOrderByPlanId(pageReqVO)); } @GetMapping("/page") @Operation(summary = "获得排单分页") - @PreAuthorize("@ss.hasPermission('executor:plan:query')") + @PreAuthorize("@ss.hasPermission('placeorder:query')") public CommonResult> getPlanPage(@Valid PlanPageReqVO pageReqVO) { PageResult pageResult = planService.getPlanPage(pageReqVO); return success(BeanUtils.toBean(pageResult, PlanRespVO.class)); @@ -100,14 +100,14 @@ public class PlanController { @PostMapping("/setSort") @Operation(summary = "设置排单优先级") - @PreAuthorize("@ss.hasPermission('executor:plan:query')") + @PreAuthorize("@ss.hasPermission('placeorder:priority')") public CommonResult setSort(@Valid @NotEmpty(message = "参数不能空") @RequestBody List list) { return success(planService.setSort(list)); } @GetMapping("getNotPlanOrderListPage") @Operation(summary = "获取未排单的板材生产单板材分页列表") - @PreAuthorize("@ss.hasPermission('executor:plan:query')") + @PreAuthorize("@ss.hasPermission('placeorder:query')") public CommonResult> getOrderPage(@Valid OrderPageReqVOCopy pageReqVO) { return success(planService.getOrderPage(pageReqVO)); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/process/OrderProcessController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/process/OrderProcessController.java index eef28213a..b16ab1778 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/process/OrderProcessController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/process/OrderProcessController.java @@ -8,23 +8,12 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import javax.validation.constraints.*; import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; -import com.cf.imes.framework.common.pojo.PageParam; -import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.framework.common.pojo.CommonResult; import com.cf.imes.framework.common.util.object.BeanUtils; import static com.cf.imes.framework.common.pojo.CommonResult.success; -import com.cf.imes.framework.excel.core.util.ExcelUtils; - -import com.cf.imes.framework.operatelog.core.annotations.OperateLog; -import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*; - import com.cf.imes.module.executor.controller.admin.process.vo.*; import com.cf.imes.module.executor.dal.dataobject.process.OrderProcessDO; import com.cf.imes.module.executor.service.process.OrderProcessService; @@ -40,7 +29,7 @@ public class OrderProcessController { @PostMapping("/create") @Operation(summary = "创建生产单工序组") - @PreAuthorize("@ss.hasPermission('executor:order-process:create')") + @PreAuthorize("@ss.hasPermission('production:manager-list:putInto')") public CommonResult createOrderProcess(@Valid @RequestBody OrderProcessSaveReqVO createReqVO) { return success(orderProcessService.createOrderProcess(createReqVO)); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/goods/GoodsDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/goods/GoodsDO.java index 9f298c123..92ce8b1c8 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/goods/GoodsDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/goods/GoodsDO.java @@ -40,11 +40,11 @@ public class GoodsDO extends BaseDO { /** * 设计端商品ID */ - private Long rawGoodsId; + private String rawGoodsId; /** * 商品 ID */ - private Long goodsId; + private String goodsId; /** * 商品名称 */ diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateGoodMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateGoodMapper.java index a2ea240fa..5f7228172 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateGoodMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateGoodMapper.java @@ -6,6 +6,8 @@ import com.cf.imes.module.executor.dal.dataobject.order.OrderDO; import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO; import org.apache.ibatis.annotations.Mapper; +import java.math.BigDecimal; + /** * 板材信息 Mapper plate * @@ -14,12 +16,28 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface PlateGoodMapper extends BaseMapperX { - // 查询单个生产单中信息 - default PlateGoodDO selectGoodOne(Long id, Long organId) { + // goodsId匹配 + default PlateGoodDO selectGoodOne(String id, Long organId) { return selectOne(new LambdaQueryWrapper() .eq(PlateGoodDO::getGoodsId, id) .eq(PlateGoodDO::getDeleted, 0) .eq(PlateGoodDO::getOrganId, organId)); } + // 其他信息匹配 + default PlateGoodDO selectGood(String goodsName, String material, String color, Integer texture, BigDecimal width, + BigDecimal thickness, BigDecimal height, String brand, String spec, Long organId) { + return selectOne(new LambdaQueryWrapper() + .eq(PlateGoodDO::getGoodsName, goodsName) + .eq(PlateGoodDO::getMaterial, material) + .eq(PlateGoodDO::getColor, color) + .eq(PlateGoodDO::getTexture, texture) + .eq(PlateGoodDO::getWidth, width) + .eq(PlateGoodDO::getHeight, height) + .eq(PlateGoodDO::getThickness, thickness) + .eq(PlateGoodDO::getBrand, brand) + .eq(PlateGoodDO::getSpec, spec) + .eq(PlateGoodDO::getDeleted, 0) + .eq(PlateGoodDO::getOrganId, organId)); + } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java index 5881d3e35..eaa033b07 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java @@ -305,6 +305,7 @@ public class OrderServiceImpl implements OrderService { } @Override + @Transactional(rollbackFor = Exception.class) public void deleteBodyByOrder(Long orderId, Collection bodyIds) { validateOrderExists(orderId, OrganContextHolder.getOrganId()); // 校验生产单的状态 1 为新单状态,才可以修改 @@ -373,26 +374,38 @@ public class OrderServiceImpl implements OrderService { List plateGoodLists = new ArrayList<>(); for (GoodsDO goodsDO : goodsLists) { + PlateGoodDO plateGoodDO; if (goodsDO.getGoodsId() != null) { // 有goodsId - PlateGoodDO plateGoodDO = plateGoodMapper.selectGoodOne(goodsDO.getGoodsId(), SecurityFrameworkUtils.getLoginUser().getOrganId()); - if (plateGoodDO != null) {//存在 - goodsDO.setGoodsId(plateGoodDO.getId()); - } - + plateGoodDO = plateGoodMapper.selectGoodOne(goodsDO.getGoodsId(), SecurityFrameworkUtils.getLoginUser().getOrganId()); }else { // 没有goodsId 其他信息匹配 + plateGoodDO = plateGoodMapper.selectGood(goodsDO.getGoodsName(), goodsDO.getMaterial(), goodsDO.getColor(), + goodsDO.getTexture(), goodsDO.getWidth(), goodsDO.getWidth(), goodsDO.getHeight(), goodsDO.getSpec(), + goodsDO.getBrand(), SecurityFrameworkUtils.getLoginUser().getOrganId()); + } - + if (plateGoodDO != null) {//存在板材 + goodsDO.setGoodsId(plateGoodDO.getGoodsId()); + break; + }else { // 不存在板材 + Long plateGoods = (Long) identifierGenerator.nextId(null); + Long goodsId = (Long) identifierGenerator.nextId(null); + plateGoodDO = BeanUtils.toBean(goodsDO, PlateGoodDO.class) + .setId(plateGoods) + .setGoodsId(String.valueOf(goodsId)); + // 判断是否存在raw_goods_id + System.out.println("goodsDO.getGoodsId() " + goodsDO.getGoodsId()); + if (goodsDO.getGoodsId() != null) { + plateGoodDO.setGoodsId(goodsDO.getGoodsId()); + }else { + goodsDO.setGoodsId(plateGoodDO.getGoodsId()); + } + plateGoodLists.add(plateGoodDO); } - Long plateGoods = (Long) identifierGenerator.nextId(null); - PlateGoodDO plateGoodDO = BeanUtils.toBean(goodsDO, PlateGoodDO.class) - .setId(plateGoods) - .setGoodsId(String.valueOf(goodsDO.getGoodsId())); - goodsDO.setGoodsId(plateGoodDO.getId()); - plateGoodLists.add(plateGoodDO); } map.put("goodsDO", goodsLists); map.put("plateGoodDOLists", plateGoodLists); + System.err.println(" map " + map); return map; } @@ -501,13 +514,18 @@ public class OrderServiceImpl implements OrderService { Map> listMap = excelTypeRealize.changeDate(list, orderDO.getId()); List rawGoodsDO = (List) listMap.get("rawGoodsDOS"); List goodsDO = (List) listMap.get("goodsDOS"); - List plateGoodDOS = (List) listMap.get("plateGoodDOS"); +// List plateGoodDOS = (List) listMap.get("plateGoodDOS"); List bodyDO = (List) listMap.get("orderBodyDOS"); List groupDO = (List) listMap.get("orderGroupDOS"); List plateDO = (List) listMap.get("plateDOS"); List partsDO = (List) listMap.get("orderPartsDOS"); List itemDO = (List) listMap.get("orderItemDOS"); List orderModelDOS = (List) listMap.get("orderModelDOS"); + // 板材库匹配 + Map> map = getPlateGoods(goodsDO);// 检验商品板材信息是否存在 + goodsDO = (List) map.get("goodsDO"); + List plateGoodDOS = (List) map.get("plateGoodDOLists"); + validateCustomOrderNoExists(orderDO.getCustomOrderNo()); orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, orderDO, goodsDO, plateGoodDOS); orderInputProcessor.batchSaveModel(orderModelDOS); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/MinuteCounter.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/MinuteCounter.java new file mode 100644 index 000000000..0868a5f90 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/MinuteCounter.java @@ -0,0 +1,25 @@ +package com.cf.imes.module.executor.util; + +import java.util.concurrent.atomic.AtomicInteger; + +public class MinuteCounter { + private static final int MASK = 0x7FFFFFFF; + private final AtomicInteger atom; + + public MinuteCounter() { + atom = new AtomicInteger(0); + } + + public final int incrementAndGet() { + return atom.incrementAndGet() & MASK; + } + + public int get() { + return atom.get() & MASK; + } + + public void set(int newValue) { + atom.set(newValue & MASK); + } + +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/SnowflakeIdWorker3rd.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/SnowflakeIdWorker3rd.java new file mode 100644 index 000000000..6aba6b6c4 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/SnowflakeIdWorker3rd.java @@ -0,0 +1,131 @@ +package com.cf.imes.module.executor.util.fileConversion.admin; + + +import com.cf.imes.module.executor.util.MinuteCounter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.time.LocalDate; + +/** + * @ClassName: SnowflakeIdWorker3rd + * @Description:snowflake算法改进 + * @author: yonnie + * @date: 2024/06/18 14:10:47 + * @version V1.0 + * + * 将产生的Id类型更改为Integer 32bit
+ * 把时间戳的单位改为分钟,使用25bit的时间戳 + * 7bit作为自增值即 2^7 = 128 + */ +@Slf4j +@Component +public class SnowflakeIdWorker3rd { + /** 初始时间 (2024-01-01: 1704038400) */ + // private final int twepoch = 28400640;// 1704038400000L/1000/60; + private final int twepoch = 1704038400; + /** 序列在id中占位数 */ + private final long sequenceBits = 7L; + /** 时间截向左移7bit */ + private final long timestampLeftShift = sequenceBits; + /** 生成序列的MASK (0x7F) */ + private final int sequenceMask = -1 ^ (-1 << sequenceBits); + /** 分钟内序 (0~127) */ + private int sequence = 0; + private int laterSequence = 0; + /** 上次生成ID的时间戳 */ + private int lastTimestamp = -1; + private final MinuteCounter counter = new MinuteCounter(); + /** 预支时间标志 */ + boolean isAdvance = false; + + // ==============================Constructors===================================== + + public SnowflakeIdWorker3rd() { + } + + // ==============================Test============================================= + + /** 测试 */ + public static void main(String[] args) { + SnowflakeIdWorker3rd idWorker = new SnowflakeIdWorker3rd(); + for (int i = 0; i < 1000; i++) { + long id = idWorker.nextId(); + System.out.println(i + ": " + id + " " + "2406" + Long.toString(id).substring(2)); + } + // long id = idWorker.nextId(); + // System.out.println(id); + } + + // ==============================Methods========================================== + /** + * 获取当前年月 + * @return null + */ + public static int obtainingTime() { + LocalDate now = LocalDate.now(); + int year = now.getYear(); + String year_last_two_digits = String.valueOf(year).substring(2); + int month = now.getMonthValue(); + String formatted_date = year_last_two_digits + String.format("%02d", month); + return Integer.parseInt(formatted_date); + } + + /** + * 获得下一个ID (该方法是线程安全) + * + * @return SnowflakeId + */ + public synchronized int nextId() { + int timestamp = timeGen(); + // 如果当前时间小于上一次ID生成的时间戳,说明系统时钟修改过 + if (timestamp < lastTimestamp) { + throw new RuntimeException(String.format( + "Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp)); + } + + if (timestamp > counter.get()) { + counter.set(timestamp); + isAdvance = false; + } + + // 如果是同时间生成的,则进行分钟内序列 + if (lastTimestamp == timestamp || isAdvance) { + if (!isAdvance) { + sequence = (sequence + 1) & sequenceMask; + } + + // 分钟内自增列溢出 + if (sequence == 0) { + // 预支下一分获得新的时间戳 + isAdvance = true; + int laterTimestamp = counter.get(); + if (laterSequence == 0) { + laterTimestamp = counter.incrementAndGet(); + } + int nextId = ((laterTimestamp - twepoch) << timestampLeftShift) | laterSequence; + laterSequence = (laterSequence + 1) & sequenceMask; + return nextId; + } + } else { // 时间戳改变,分钟内序列置0 + sequence = 0; + laterSequence = 0; + } + // 上次生成ID的时间截 + lastTimestamp = timestamp; + // 移位并或运算拼成32位的ID + return ((timestamp - twepoch) << timestampLeftShift) | sequence; + } + + /** + * 返回以分钟为单位的当前时 + * + * @return 当前时间(分钟) + */ + protected int timeGen() { + // String timestamp = String.valueOf(System.currentTimeMillis() / 1000 / 60); + String timestamp = String.valueOf(System.currentTimeMillis() / 1000); + return Integer.valueOf(timestamp); + } + +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java index bfd9ddf29..2b39982c2 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java @@ -13,6 +13,7 @@ import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO; import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO; import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO; import com.cf.imes.module.executor.enums.*; +import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd; import com.cf.imes.module.executor.util.deviseData.dataTwo.*; import com.cf.imes.module.system.api.dict.DictDataApi; import lombok.extern.slf4j.Slf4j; @@ -39,6 +40,9 @@ public class ApiTypeRealize { @Resource private DictDataApi dictDataApi; + @Resource + SnowflakeIdWorker3rd idWorker; + private Integer num = 0; private Integer groupNum = 0; @@ -85,7 +89,9 @@ public class ApiTypeRealize { Map bodyInfoChange = bodyInfoChange(dataBody, orderId); // System.out.println(" bodyInfoChange " + bodyInfoChange); // 加工组 少异形数量、板材数量 - Map> group = groupInfoChange(dataModule, orderId, bodyInfoChange); + Map> group = + + groupInfoChange(dataModule, orderId, bodyInfoChange); Map orderGroupDO = (Map) group.get("orderGroup"); map.put("groupDO", orderGroupDO.values().stream().collect(Collectors.toList())); Map> groupLists = (Map>) group.get("lists"); @@ -276,7 +282,7 @@ public class ApiTypeRealize { RawGoodsDO rawGoodsDO = RawGoodsDO.builder() .id((Long) identifierGenerator.nextId(null)) .orderId(orderId) - .rawGoodsId(String.valueOf(goods.getLong("GoodsID"))) + .rawGoodsId(goods.getString("GoodsID")) .goodsName(goods.getString("GoodsName")) .material(goods.getString("Material")) .color(goods.getString("Color")) @@ -291,8 +297,8 @@ public class ApiTypeRealize { GoodsDO goodsDO = GoodsDO.builder() .id((Long) identifierGenerator.nextId(null)) .orderId(orderId) - .rawGoodsId(rawGoodsDO.getId()) - .goodsId(goods.getLong("GoodsID")) + .rawGoodsId(String.valueOf(rawGoodsDO.getId())) + .goodsId(goods.getString("GoodsID")) // 先填这个,后面改 .goodsName(goods.getString("GoodsName")) .material(goods.getString("Material")) .color(goods.getString("Color")) @@ -401,7 +407,7 @@ public class ApiTypeRealize { .unit(parts.getString("Units")) .price(parts.getDouble("Price")) .isComposite(parts.getBoolean("IsComposite")) - .remark(partsRemarkChange(parts)) + .remark(parts.getString("Remark")) .build(); partsInfos.put(parts.getInteger("DataID"), partsInfo); @@ -443,6 +449,7 @@ public class ApiTypeRealize { String remark = JSON.toJSONString(mapList); return remark; } + /** * 板材信息转换 写表 Integer指板材的ItemID板id 加一个板材自定义编号 */ @@ -462,6 +469,9 @@ public class ApiTypeRealize { if (dataPlates != null && !dataPlates.isEmpty()) { JSONArray plateLists = dataPlates.getJSONArray("List"); for (int i = 0; i < plateLists.size(); i++) { + long plateNo = idWorker.nextId(); + long obtainingTime = idWorker.obtainingTime(); + JSONObject plate = plateLists.getJSONObject(i); Integer type = Integer.valueOf(dictDataApi.parseDictData("order_plate_type", @@ -472,8 +482,10 @@ public class ApiTypeRealize { .id(plateId) .orderId(orderId) .name(plate.getString("BoardName")) - .plateNo(plate.getString("CustBlockNo")) +// .plateNo(plate.getString("CustBlockNo")) + .plateNo((obtainingTime)+ Long.toString(plateNo).substring(2)) .type(type) + .goodsId(goodsDOMap.get(plate.getInteger("GoodsID")) != null ? goodsDOMap.get(plate.getInteger("GoodsID")).getId() : plate.getInteger("GoodsID")) // .width(BigDecimal.valueOf(plate.getDouble("CutWidth"))) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java index 53497107c..193a48fda 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java @@ -12,8 +12,9 @@ import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO; import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO; import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO; import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO; -import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper; import com.cf.imes.module.executor.enums.OrderItemTypeEnum; +import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd; +import io.swagger.v3.oas.models.security.SecurityScheme; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -22,8 +23,6 @@ import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; -import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.cf.imes.module.executor.enums.ErrorCodeConstants.FILE_UPLOAD_ERR; /** * 实现数据格式转换 @@ -37,7 +36,7 @@ public class ExcelTypeRealize { private SnowFlakeGenerator snowFlakeGenerator; @Resource - private PlateGoodMapper plateGoodMapper; + SnowflakeIdWorker3rd idWorker; // 数据转换 + 错误验证 public Map> changeDate(List list, Long orderId) { @@ -74,50 +73,45 @@ public class ExcelTypeRealize { Map, List> goodsMap = value.stream() .collect(Collectors.groupingBy( p -> Arrays.asList(p.getGoodsName(), + p.getGoodsName(), + p.getThickness(), p.getMaterial(), p.getColor(), p.getSpec(), - p.getThickness()), + p.getTexture(), + p.getModel(), + p.getBrand()), Collectors.toList() )); goodsMap.forEach((goodKey, goodValue) -> { - Long plateGoodId = (Long) snowFlakeGenerator.nextId(null); - PlateGoodDO plateGoodDO = setPlateGoodDO(goodValue.get(0)).setId(plateGoodId).setOrganId(organId); - plateGoodDOS.add(plateGoodDO); -// 板材信息合集,添加生产单id,添加生产单板材设计端商品编码,板材信息写入order_raw_goods - Long rawGoodsId = (Long) snowFlakeGenerator.nextId(null); - RawGoodsDO rawGoodsDO = setRawGoodsDO(goodValue.get(0)).setId(rawGoodsId).setOrderId(orderId); +// 板材信息合集,添加生产单id,添加生产单板材设计端商品编码,板材信息写入order_raw_goods +// 规格分解 + List specList = spec(goodValue.get(0).getSpec()); + RawGoodsDO rawGoodsDO = setRawGoodsDO(goodValue.get(0)).setId((Long) snowFlakeGenerator.nextId(null)).setOrderId(orderId); rawGoodsDOS.add(rawGoodsDO); Long goodId = (Long) snowFlakeGenerator.nextId(null); GoodsDO plateDO = setGoodsDO(goodValue.get(0)).setId(goodId).setOrderId(orderId) - .setRawGoodsId(rawGoodsId).setGoodsId(plateGoodId); + .setRawGoodsId(String.valueOf(rawGoodsDO.getId())) + .setHeight(BigDecimal.valueOf(specList.get(0))).setWidth(BigDecimal.valueOf(specList.get(1))); // 在good_id为空的时候,首先赋值为空值 goodsDOS.add(plateDO); -// 赋值给板件未对应前order_raw_goods的id +// 赋值给板件未对应前order_raw_goods的id for (OrderPlateImportExcelVO reqVO : goodValue) { reqVO.setGoodId(goodId); } }); } else { // 商品编码有的 - // 判断商品是否存在板材库中 - PlateGoodDO plateGoodDO = plateGoodMapper.selectOne(PlateGoodDO::getGoodsId, value.get(0).getGoodsId()); - Long plateGoodId = null; - if (plateGoodDO != null) {//存在 - plateGoodId = plateGoodDO.getId(); - } else { - plateGoodId = (Long) snowFlakeGenerator.nextId(null); - PlateGoodDO plateGoodDONew = setPlateGoodDO(value.get(0)).setId(plateGoodId).setOrganId(organId); - plateGoodDOS.add(plateGoodDONew); - } - // 板材信息合集,添加生产单id,添加生产单板材设计端商品编码,板材信息写入order_raw_goods - Long rawGoodsId = (Long) snowFlakeGenerator.nextId(null); - RawGoodsDO rawGoodsDO = setRawGoodsDO(value.get(0)).setId(rawGoodsId).setOrderId(orderId); + List specList = spec(value.get(0).getSpec()); +// 板材信息合集,添加生产单id,添加生产单板材设计端商品编码,板材信息写入order_raw_goods + RawGoodsDO rawGoodsDO = setRawGoodsDO(value.get(0)).setId((Long) snowFlakeGenerator.nextId(null)).setOrderId(orderId); rawGoodsDOS.add(rawGoodsDO); Long goodId = (Long) snowFlakeGenerator.nextId(null); GoodsDO plateDO = setGoodsDO(value.get(0)).setId(goodId).setOrderId(orderId) - .setRawGoodsId(rawGoodsId).setGoodsId(plateGoodId); + .setRawGoodsId(String.valueOf(rawGoodsDO.getId())).setGoodsId(String.valueOf(rawGoodsDO.getRawGoodsId())) + .setHeight(BigDecimal.valueOf(specList.get(0))).setWidth(BigDecimal.valueOf(specList.get(1))); goodsDOS.add(plateDO); -// 赋值给板件未对应前order_raw_goods的id + +// 赋值给板件未对应前order_raw_goods的id for (OrderPlateImportExcelVO reqVO : value) { reqVO.setGoodId(goodId); } @@ -179,10 +173,14 @@ public class ExcelTypeRealize { //板材 plateCountByCombination[0] = plateCountByCombination[0] + Double.parseDouble(combination.getGoodsNumber()); for (int i = 0; i < Integer.parseInt(combination.getGoodsNumber()); i++) { + long plateNo = idWorker.nextId(); + long obtainingTime = idWorker.obtainingTime(); + Long plateId = (Long) snowFlakeGenerator.nextId(null); PlateDO plateDO = PlateDO.builder() .id(plateId).orderId(orderId).name(combination.getName()).plateNo(combination.getPlateNo()) .goodsId(combination.getGoodId()).width(BigDecimal.valueOf(Double.parseDouble(combination.getWidth()))) + .plateNo(((obtainingTime)+ Long.toString(plateNo).substring(2))) .height(BigDecimal.valueOf(Double.parseDouble(combination.getHeight()))) .thickness(BigDecimal.valueOf(Double.parseDouble(combination.getThickness()))) .splitWidth(BigDecimal.valueOf(Double.parseDouble(combination.getSplitWidth()))) @@ -300,15 +298,22 @@ public class ExcelTypeRealize { } // spec分离数据 - public List spec(String spec) { - List list = null; + public List spec(String spec) { + List list = new ArrayList<>(); String[] parts = spec.split("\\×"); if (parts.length <= 1) { return null; } - for (int i = 0; i < parts.length; i++) { - list.add(parts[i]); + for (int i = 0; i < 3; i++) { + Double num = 0.0; + try { + if (i < parts.length) + num = Double.parseDouble(parts[i]); + } catch (NumberFormatException e) { + // 转换失败,保持num为0 + } + list.add(num); } return list; } diff --git a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/RemainPlateController.java b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/RemainPlateController.java index e2a61cf88..1d41fb990 100644 --- a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/RemainPlateController.java +++ b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/plate/RemainPlateController.java @@ -102,7 +102,7 @@ public class RemainPlateController { @GetMapping("/page") @Operation(summary = "获得生产单余料板表分页") - @PreAuthorize("@ss.hasPermission('manage:remain-plate:query')") + @PreAuthorize("@ss.hasPermission('placeorder:remain')") public CommonResult> getRemainPlatePage(@Valid RemainPlatePageReqVO pageReqVO) { PageResult pageResult = remainPlateService.getRemainPlatePage(pageReqVO); return success(BeanUtils.toBean(pageResult, RemainPlateRespVO.class)); diff --git a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/query/ProductionStatusController.java b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/query/ProductionStatusController.java index 62191f4f7..3eeabfd63 100644 --- a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/query/ProductionStatusController.java +++ b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/query/ProductionStatusController.java @@ -65,7 +65,7 @@ public class ProductionStatusController { @GetMapping("/select") @Operation(summary = "查看生产单下的工序组工序") @Parameter(name = "orderNo", description = "生产单Id", required = true) - @PreAuthorize("@ss.hasPermission('manage:query:select')") + @PreAuthorize("@ss.hasPermission('production:manager-list:processStatus')") public CommonResult> selectProduction(@Valid @RequestParam("orderNo") Long orderNo){ List orderProcessById = productionStatusService.selectProduction(orderNo); diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/pom.xml b/cf-module-prod-plan/cf-module-prod-plan-biz/pom.xml index a62954849..27daed935 100644 --- a/cf-module-prod-plan/cf-module-prod-plan-biz/pom.xml +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/pom.xml @@ -146,6 +146,46 @@ + + org.apache.maven.plugins + maven-dependency-plugin + ${maven.dependency.plugin.version} + + + prepare-package + + copy-dependencies + + + + target/lib + + com.cf.imes + + + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven.assembly.plugin.version} + + false + + + src/main/build/assembly.xml + + + + + bundle + package + + single + + + + diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/build/assembly.xml b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/build/assembly.xml new file mode 100644 index 000000000..6569531ff --- /dev/null +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/build/assembly.xml @@ -0,0 +1,39 @@ + + bundle + + tar.gz + + false + + + + + ${basedir}/src/main/resources + config + + application-${profileActive}.yaml + bootstrap-${profileActive}.yaml + bootstrap.yaml + + + + + + ${basedir}/target/lib + + *.jar + + + lib + + + + ${project.build.directory} + / + + ${project.artifactId}.jar + + + + + \ No newline at end of file diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/resources/application-test.yaml b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/resources/application-test.yaml new file mode 100644 index 000000000..110cf76c9 --- /dev/null +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/resources/application-test.yaml @@ -0,0 +1,4 @@ +spring: + main: + allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 + allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务 \ No newline at end of file diff --git a/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/resources/bootstrap-test.yaml b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/resources/bootstrap-test.yaml new file mode 100644 index 000000000..90fc424cd --- /dev/null +++ b/cf-module-prod-plan/cf-module-prod-plan-biz/src/main/resources/bootstrap-test.yaml @@ -0,0 +1,23 @@ +--- #################### 注册中心相关配置 #################### + +spring: + cloud: + nacos: + server-addr: 192.168.1.204:8848 + discovery: + namespace: imes-test # 命名空间。这里使用 dev 开发环境 + metadata: + version: 1.0.0 # 服务实例的版本号,可用于灰度发布 + +--- #################### 配置中心相关配置 #################### + +spring: + cloud: + nacos: + # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 + config: + server-addr: 192.168.1.204:8848 # Nacos 服务器地址 + namespace: imes-test # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 + group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP + name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name + file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties \ No newline at end of file diff --git a/cf-module-report/cf-module-report-biz/pom.xml b/cf-module-report/cf-module-report-biz/pom.xml index c753997a8..b783e6727 100644 --- a/cf-module-report/cf-module-report-biz/pom.xml +++ b/cf-module-report/cf-module-report-biz/pom.xml @@ -133,6 +133,46 @@ + + org.apache.maven.plugins + maven-dependency-plugin + ${maven.dependency.plugin.version} + + + prepare-package + + copy-dependencies + + + + target/lib + + com.cf.imes + + + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven.assembly.plugin.version} + + false + + + src/main/build/assembly.xml + + + + + bundle + package + + single + + + + diff --git a/cf-module-report/cf-module-report-biz/src/main/build/assembly.xml b/cf-module-report/cf-module-report-biz/src/main/build/assembly.xml new file mode 100644 index 000000000..6569531ff --- /dev/null +++ b/cf-module-report/cf-module-report-biz/src/main/build/assembly.xml @@ -0,0 +1,39 @@ + + bundle + + tar.gz + + false + + + + + ${basedir}/src/main/resources + config + + application-${profileActive}.yaml + bootstrap-${profileActive}.yaml + bootstrap.yaml + + + + + + ${basedir}/target/lib + + *.jar + + + lib + + + + ${project.build.directory} + / + + ${project.artifactId}.jar + + + + + \ No newline at end of file diff --git a/cf-module-report/cf-module-report-biz/src/main/resources/application-test.yaml b/cf-module-report/cf-module-report-biz/src/main/resources/application-test.yaml new file mode 100644 index 000000000..110cf76c9 --- /dev/null +++ b/cf-module-report/cf-module-report-biz/src/main/resources/application-test.yaml @@ -0,0 +1,4 @@ +spring: + main: + allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 + allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务 \ No newline at end of file diff --git a/cf-module-report/cf-module-report-biz/src/main/resources/bootstrap-test.yaml b/cf-module-report/cf-module-report-biz/src/main/resources/bootstrap-test.yaml new file mode 100644 index 000000000..90fc424cd --- /dev/null +++ b/cf-module-report/cf-module-report-biz/src/main/resources/bootstrap-test.yaml @@ -0,0 +1,23 @@ +--- #################### 注册中心相关配置 #################### + +spring: + cloud: + nacos: + server-addr: 192.168.1.204:8848 + discovery: + namespace: imes-test # 命名空间。这里使用 dev 开发环境 + metadata: + version: 1.0.0 # 服务实例的版本号,可用于灰度发布 + +--- #################### 配置中心相关配置 #################### + +spring: + cloud: + nacos: + # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 + config: + server-addr: 192.168.1.204:8848 # Nacos 服务器地址 + namespace: imes-test # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 + group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP + name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name + file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties \ No newline at end of file diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/process/ProcessController.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/process/ProcessController.java index 01bfaba21..46c893a24 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/process/ProcessController.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/controller/admin/process/ProcessController.java @@ -119,7 +119,7 @@ public class ProcessController { @GetMapping("/select") @Operation(summary = "查看当前登录用户的组织的工序信息") @Parameter(name = "userId", description = "当前登录的用户ID", required = true, example = "1") - @PreAuthorize("@ss.hasPermission('manage:process:select')") + @PreAuthorize("@ss.hasPermission('manage:process:query')") public CommonResult> getUserPage(@Valid @RequestParam("userId") Long userId) { return success(processService.getUserProcess(userId));