diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteDeviceService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteDeviceService.java index bcda8719..95aa6590 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteDeviceService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteDeviceService.java @@ -2,9 +2,11 @@ package com.op.system.api; import com.op.common.core.constant.ServiceNameConstants; import com.op.common.core.domain.R; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.factory.RemoteDeviceFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -33,4 +35,10 @@ public interface RemoteDeviceService { @PostMapping("/deviceTask/equipmentBKTask") public R equipmentBKTask(); + + @PostMapping("/deviceTask/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + + @PostMapping("/deviceTask/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java index dea44c1f..99b4b6e6 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java @@ -3,10 +3,9 @@ package com.op.system.api; import com.op.common.core.constant.ServiceNameConstants; import com.op.common.core.domain.BaseFileData; import com.op.common.core.domain.R; - +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.factory.RemoteMesFallbackFactory; -import com.op.system.api.model.SapProOrder; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; @@ -41,4 +40,9 @@ public interface RemoteMesService { @PostMapping("/wcsInterface/dataBKTask") public R dataBKTask(); + + @PostMapping("/reportWork/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + @PostMapping("/reportWork/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java index e2095be2..74e0b1df 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java @@ -1,7 +1,9 @@ package com.op.system.api; import com.op.common.core.constant.ServiceNameConstants; +import com.op.common.core.domain.R; import com.op.common.core.web.domain.AjaxResult; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.factory.RemoteOpenFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; @@ -35,4 +37,10 @@ public interface RemoteOpenService { /**获取HR岗位信息**/ @GetMapping("/openInterface/GetHrDeptInfo") public AjaxResult GetHrDeptInfo(); + + @PostMapping("/openInterface/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + + @PostMapping("/openInterface/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java index 92e89e1d..02778f6f 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java @@ -3,6 +3,7 @@ package com.op.system.api; import com.op.common.core.constant.ServiceNameConstants; import com.op.common.core.domain.BaseFileData; import com.op.common.core.domain.R; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.factory.RemotePlanFallbackFactory; import com.op.system.api.model.SapProOrder; import org.springframework.cloud.openfeign.FeignClient; @@ -32,4 +33,9 @@ public interface RemotePlanService { @PostMapping("/order/syncSAPOrders") public R syncSAPOrders(); + @PostMapping("/order/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + + @PostMapping("/order/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteQualityService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteQualityService.java index 768b7b65..f62f615f 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteQualityService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteQualityService.java @@ -2,6 +2,7 @@ package com.op.system.api; import com.op.common.core.constant.ServiceNameConstants; import com.op.common.core.domain.R; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO; import com.op.system.api.domain.quality.QcCheckTaskWarehousingDTO; import com.op.system.api.factory.RemoteQualityFallbackFactory; @@ -31,4 +32,10 @@ public interface RemoteQualityService { @PostMapping("/qcIncome/createIncomeBatchTask") public R createIncomeBatchTask(); + + @PostMapping("/qcIncome/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + + @PostMapping("/qcIncome/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java index 6a1b114b..dfd7d205 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java @@ -2,6 +2,7 @@ package com.op.system.api; import com.op.common.core.constant.ServiceNameConstants; import com.op.common.core.domain.R; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.sap.*; import com.op.system.api.factory.RemoteSapFallbackFactory; import com.op.system.api.model.SapProOrder; @@ -119,4 +120,9 @@ public interface RemoteSapService { @PostMapping("/sap/FPinventory") public R FPinventory(@RequestBody(required = false) Map mapList); + @PostMapping("/sap/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + + @PostMapping("/sap/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteTechnologyService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteTechnologyService.java index a5743e07..3ba966b1 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteTechnologyService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteTechnologyService.java @@ -2,6 +2,7 @@ package com.op.system.api; import com.op.common.core.constant.ServiceNameConstants; import com.op.common.core.domain.R; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.factory.RemoteTechnologyFallbackFactory; import com.op.system.api.model.SapProOrder; import org.springframework.cloud.openfeign.FeignClient; @@ -22,4 +23,9 @@ public interface RemoteTechnologyService { @PostMapping("/order/sapAddOrder") public R sapAddOrder(@RequestBody SapProOrder sapProOrder); + @PostMapping("/pro/proroute/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + + @PostMapping("/pro/proroute/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteWmsService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteWmsService.java new file mode 100644 index 00000000..12f7f808 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteWmsService.java @@ -0,0 +1,29 @@ +package com.op.system.api; + +import com.op.common.core.constant.ServiceNameConstants; +import com.op.common.core.domain.R; +import com.op.system.api.domain.DataSourcePropertyDTO; +import com.op.system.api.factory.RemoteWmsFallbackFactory; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * 用户服务 + * + * @author OP + */ +@FeignClient(contextId = "remoteWmsService", value = ServiceNameConstants.WMS_SERVICE, fallbackFactory = RemoteWmsFallbackFactory.class) + + + +public interface RemoteWmsService { + + @PostMapping("/area/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); + + @PostMapping("/area/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); +} diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/DataSourcePropertyDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/DataSourcePropertyDTO.java new file mode 100644 index 00000000..17004e90 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/DataSourcePropertyDTO.java @@ -0,0 +1,80 @@ +package com.op.system.api.domain; + +/** + * @author zxl + * @date 2024年04月12日 11:57 + */ +public class DataSourcePropertyDTO { + private String poolName; + private String driverClassName; + private String url; + private String username; + private String password; + private String jndiName; + private Boolean seata = true; + private Boolean lazy; + + public String getPoolName() { + return poolName; + } + + public void setPoolName(String poolName) { + this.poolName = poolName; + } + + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getJndiName() { + return jndiName; + } + + public void setJndiName(String jndiName) { + this.jndiName = jndiName; + } + + public Boolean getSeata() { + return seata; + } + + public void setSeata(Boolean seata) { + this.seata = seata; + } + + public Boolean getLazy() { + return lazy; + } + + public void setLazy(Boolean lazy) { + this.lazy = lazy; + } +} diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteDeviceFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteDeviceFallbackFactory.java index 9868e0fb..866b659c 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteDeviceFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteDeviceFallbackFactory.java @@ -1,8 +1,8 @@ package com.op.system.api.factory; - import com.op.common.core.domain.R; import com.op.system.api.RemoteDeviceService; +import com.op.system.api.domain.DataSourcePropertyDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; @@ -47,6 +47,16 @@ public class RemoteDeviceFallbackFactory implements FallbackFactory { + private static final Logger log = LoggerFactory.getLogger(RemoteWmsFallbackFactory.class); + + @Override + public RemoteWmsService create(Throwable throwable) { + log.error("Wms服务调用失败:{}", throwable.getMessage()); + return new RemoteWmsService() { + @Override + public R addDatasource(DataSourcePropertyDTO dataSourceProperty) { + return R.fail("mes数据源创建失败:" + throwable.getMessage()); + } + + @Override + public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) { + return R.fail("mes数据源删除失败:" + throwable.getMessage()); + } + }; + } +} + diff --git a/op-api/op-api-system/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/op-api/op-api-system/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 113093cf..3bff05e2 100644 --- a/op-api/op-api-system/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/op-api/op-api-system/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -8,3 +8,4 @@ com.op.system.api.factory.RemoteSapFallbackFactory com.op.system.api.factory.RemoteDeviceFallbackFactory com.op.system.api.factory.RemoteQualityFallbackFactory com.op.system.api.factory.RemoteOpenFallbackFactory +com.op.system.api.factory.RemoteWmsFallbackFactory diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceTaskController.java b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceTaskController.java index 228bf576..e6ec6d70 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceTaskController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceTaskController.java @@ -1,17 +1,18 @@ package com.op.device.controller; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.op.common.core.domain.R; import com.op.common.core.web.domain.AjaxResult; -import com.op.device.domain.EquOrder; -import com.op.device.domain.EquPlan; -import com.op.device.domain.EquRepairOrder; -import com.op.device.domain.EquRepairWorkOrder; -import com.op.device.service.IDevicePDAService; +import com.op.common.datasource.creator.DynamicDatasourceCreator; import com.op.device.service.IDeviceTaskService; -import com.op.device.service.IEquRepairOrderService; +import com.op.system.api.domain.DataSourcePropertyDTO; +import com.op.common.core.utils.bean.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; + /** * DeviceTaskController * @@ -24,7 +25,10 @@ public class DeviceTaskController { @Autowired private IDeviceTaskService taskService; - + @Resource + private DynamicDatasourceCreator dynamicDatasourceCreator; + @Resource + private DynamicRoutingDataSource dynamicRoutingDataSource; /** * 点检计划生成 * @@ -96,4 +100,20 @@ public class DeviceTaskController { } return R.fail("设备运行记录数据库备份失败"); } + + @PostMapping("/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicDatasourceCreator.createDynamicDataSource(dataSourceProperty); + return R.ok(); + } + + @PostMapping("/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicRoutingDataSource.removeDataSource(dataSourceProperty.getPoolName()); + return R.ok(); + } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineController.java new file mode 100644 index 00000000..55951d6f --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineController.java @@ -0,0 +1,109 @@ +package com.op.mes.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.nacos.shaded.com.google.protobuf.Internal; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.mes.domain.MesLine; +import com.op.mes.service.IMesLineService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 线体管理Controller + * + * @author Open Platform + * @date 2024-04-02 + */ +@RestController +@RequestMapping("/mesLine") +public class MesLineController extends BaseController { + @Autowired + private IMesLineService mesLineService; + +/** + * 查询线体管理列表 + */ +@RequiresPermissions("mes:mesLine:list") +@GetMapping("/list") + public TableDataInfo list(MesLine mesLine) { + startPage(); + List list = mesLineService.selectMesLineList(mesLine); + return getDataTable(list); + } + + /** + * 导出线体管理列表 + */ + @RequiresPermissions("mes:mesLine:export") + @Log(title = "线体管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesLine mesLine) { + List list = mesLineService.selectMesLineList(mesLine); + ExcelUtil util = new ExcelUtil(MesLine. class); + util.exportExcel(response, list, "线体管理数据"); + } + + /** + * 获取线体管理详细信息 + */ + @RequiresPermissions("mes:mesLine:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(mesLineService.selectMesLineById(id)); + } + + /** + * 新增线体管理 + */ + @RequiresPermissions("mes:mesLine:add") + @Log(title = "线体管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesLine mesLine) { + return toAjax(mesLineService.insertMesLine(mesLine)); + } + + /** + * 修改线体管理 + */ + @RequiresPermissions("mes:mesLine:edit") + @Log(title = "线体管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesLine mesLine) { + return toAjax(mesLineService.updateMesLine(mesLine)); + } + + /** + * 删除线体管理 + */ + @RequiresPermissions("mes:mesLine:remove") + @Log(title = "线体管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(mesLineService.deleteMesLineByIds(ids)); + } + /** + * 选择线体 + */ + @GetMapping("/selectLineBody") + public TableDataInfo selectLineBody(MesLine mesLine) { + startPage(); + List list = mesLineService.selectLineBody(mesLine); + return getDataTable(list); + } +} + diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index 4f1c22df..92ea2b92 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -6,28 +6,30 @@ import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.*; +import javax.annotation.Resource; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; + +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.op.common.core.domain.ExcelCol; import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.core.utils.uuid.IdUtils; -import com.op.common.security.utils.SecurityUtils; +import com.op.common.datasource.creator.DynamicDatasourceCreator; import com.op.mes.domain.*; import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.SysFactoryDto; -import com.op.system.api.RemoteSapService; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.device.EquEquipmentDTO; -import com.op.system.api.domain.dto.MesPrepareDTO; import com.op.system.api.domain.dto.MesPrepareDetailDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; -import com.op.system.api.domain.sap.SapMaterialPreparation; import org.apache.commons.lang.StringUtils; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -36,8 +38,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.op.common.log.annotation.Log; -import com.op.common.log.enums.BusinessType; import com.op.common.security.annotation.RequiresPermissions; import com.op.mes.service.IMesReportWorkService; import com.op.common.core.web.controller.BaseController; @@ -56,7 +56,10 @@ import com.op.common.core.utils.poi.ExcelUtilDailyReport; public class MesReportWorkController extends BaseController { @Autowired private IMesReportWorkService mesReportWorkService; - + @Resource + private DynamicDatasourceCreator dynamicDatasourceCreator; + @Resource + private DynamicRoutingDataSource dynamicRoutingDataSource; /** * 查询报工报表列表 */ @@ -467,7 +470,21 @@ public class MesReportWorkController extends BaseController { List rlist = mesReportWorkService.getWarehouseList(workConsume); return rlist; } + @PostMapping("/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicDatasourceCreator.createDynamicDataSource(dataSourceProperty); + return R.ok(); + } + @PostMapping("/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicRoutingDataSource.removeDataSource(dataSourceProperty.getPoolName()); + return R.ok(); + } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLine.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLine.java new file mode 100644 index 00000000..498fc898 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLine.java @@ -0,0 +1,202 @@ +package com.op.mes.domain; + +import java.math.BigDecimal; +import java.util.List; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 线体管理对象 mes_line + * + * @author Open Platform + * @date 2024-04-02 + */ +public class MesLine extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 线体编码 + */ + @Excel(name = "线体编码") + private String lineCode; + + /** + * 线体名称 + */ + @Excel(name = "线体名称") + private String lineName; + + /** + * 标准用人 + */ + @Excel(name = "标准用人") + private Long useMan; + + /** + * 标准效率 + */ + @Excel(name = "标准效率") + private BigDecimal efficiency; + + /** + * 检验工具 + */ + @Excel(name = "检验工具") + private String attr1; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String attr2; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String attr3; + + /** + * 预留字段1 + */ + @Excel(name = "预留字段1") + private String attr4; + + /** + * 工厂编码 + */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** + * 删除标识1删除0正常 + */ + private String delFlag; + + private List processList; + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public void setLineCode(String lineCode) { + this.lineCode = lineCode; + } + + public String getLineCode() { + return lineCode; + } + + public void setLineName(String lineName) { + this.lineName = lineName; + } + + public String getLineName() { + return lineName; + } + + public void setUseMan(Long useMan) { + this.useMan = useMan; + } + + public Long getUseMan() { + return useMan; + } + + public void setEfficiency(BigDecimal efficiency) { + this.efficiency = efficiency; + } + + public BigDecimal getEfficiency() { + return efficiency; + } + + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + + public void setAttr4(String attr4) { + this.attr4 = attr4; + } + + public String getAttr4() { + return attr4; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + public List getProcessList() { + return processList; + } + + public void setProcessList(List processList) { + this.processList = processList; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("lineCode", getLineCode()) + .append("lineName", getLineName()) + .append("useMan", getUseMan()) + .append("efficiency", getEfficiency()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineProcess.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineProcess.java new file mode 100644 index 00000000..7679fe84 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineProcess.java @@ -0,0 +1,182 @@ +package com.op.mes.domain; + +import java.math.BigDecimal; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 线体管理对象 mes_line_process + * + * @author Open Platform + * @date 2024-04-07 + */ +public class MesLineProcess extends BaseEntity { +private static final long serialVersionUID=1L; + + /** id */ + private String id; + + /** 父级id */ + @Excel(name = "父级id") + private String belongTo; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String processCode; + + /** 工艺名称 */ + @Excel(name = "工艺名称") + private String processName; + + /** 数量 */ + @Excel(name = "数量") + private BigDecimal quality; + + /** 检验工具 */ + @Excel(name = "检验工具") + private String attr1; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String attr2; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String attr3; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr4; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + /** 所属线体编码 */ + @Excel(name = "所属线体编码") + private String lineCode; + + /** 所属线体名称 */ + @Excel(name = "所属线体名称") + private String lineName; + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return id; + } + public void setBelongTo(String belongTo){ + this.belongTo = belongTo; + } + + public String getBelongTo(){ + return belongTo; + } + public void setProcessCode(String processCode){ + this.processCode = processCode; + } + + public String getProcessCode(){ + return processCode; + } + public void setProcessName(String processName){ + this.processName = processName; + } + + public String getProcessName(){ + return processName; + } + public void setQuality(BigDecimal quality){ + this.quality = quality; + } + + public BigDecimal getQuality(){ + return quality; + } + public void setAttr1(String attr1){ + this.attr1 = attr1; + } + + public String getAttr1(){ + return attr1; + } + public void setAttr2(String attr2){ + this.attr2 = attr2; + } + + public String getAttr2(){ + return attr2; + } + public void setAttr3(String attr3){ + this.attr3 = attr3; + } + + public String getAttr3(){ + return attr3; + } + public void setAttr4(String attr4){ + this.attr4 = attr4; + } + + public String getAttr4(){ + return attr4; + } + public void setFactoryCode(String factoryCode){ + this.factoryCode = factoryCode; + } + + public String getFactoryCode(){ + return factoryCode; + } + public void setDelFlag(String delFlag){ + this.delFlag = delFlag; + } + + public String getDelFlag(){ + return delFlag; + } + public void setLineCode(String lineCode){ + this.lineCode = lineCode; + } + + public String getLineCode(){ + return lineCode; + } + public void setLineName(String lineName){ + this.lineName = lineName; + } + + public String getLineName(){ + return lineName; + } + +@Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id",getId()) + .append("belongTo",getBelongTo()) + .append("processCode",getProcessCode()) + .append("processName",getProcessName()) + .append("quality",getQuality()) + .append("attr1",getAttr1()) + .append("attr2",getAttr2()) + .append("attr3",getAttr3()) + .append("attr4",getAttr4()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .append("factoryCode",getFactoryCode()) + .append("delFlag",getDelFlag()) + .append("lineCode",getLineCode()) + .append("lineName",getLineName()) + .toString(); + } + } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineMapper.java new file mode 100644 index 00000000..97da4096 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineMapper.java @@ -0,0 +1,67 @@ +package com.op.mes.mapper; + +import java.util.List; + +import com.op.mes.domain.MesLine; +import org.apache.ibatis.annotations.Mapper; + +/** + * 线体管理Mapper接口 + * + * @author Open Platform + * @date 2024-04-02 + */ +@Mapper +public interface MesLineMapper { + /** + * 查询线体管理 + * + * @param id 线体管理主键 + * @return 线体管理 + */ + public MesLine selectMesLineById(String id); + + /** + * 查询线体管理列表 + * + * @param mesLine 线体管理 + * @return 线体管理集合 + */ + public List selectMesLineList(MesLine mesLine); + + /** + * 新增线体管理 + * + * @param mesLine 线体管理 + * @return 结果 + */ + public int insertMesLine(MesLine mesLine); + + /** + * 修改线体管理 + * + * @param mesLine 线体管理 + * @return 结果 + */ + public int updateMesLine(MesLine mesLine); + + /** + * 删除线体管理 + * + * @param id 线体管理主键 + * @return 结果 + */ + public int deleteMesLineById(String id); + + /** + * 批量删除线体管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesLineByIds(String[] ids); + /** + * 选择线体 + */ + public List selectLineBody(MesLine mesLine); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineProcessMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineProcessMapper.java new file mode 100644 index 00000000..74d67f63 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineProcessMapper.java @@ -0,0 +1,67 @@ +package com.op.mes.mapper; + +import java.util.List; + +import com.op.mes.domain.MesLineProcess; +import org.apache.ibatis.annotations.Mapper; + +/** + * 线体管理Mapper接口 + * + * @author Open Platform + * @date 2024-04-07 + */ +@Mapper +public interface MesLineProcessMapper { + /** + * 查询线体管理 + * + * @param id 线体管理主键 + * @return 线体管理 + */ + public MesLineProcess selectMesLineProcessById(String id); + + public List selectMesLineProcessByBelongTo(String belongTo); + + /** + * 查询线体管理列表 + * + * @param mesLineProcess 线体管理 + * @return 线体管理集合 + */ + public List selectMesLineProcessList(MesLineProcess mesLineProcess); + + /** + * 新增线体管理 + * + * @param mesLineProcess 线体管理 + * @return 结果 + */ + public int insertMesLineProcess(MesLineProcess mesLineProcess); + + /** + * 修改线体管理 + * + * @param mesLineProcess 线体管理 + * @return 结果 + */ + public int updateMesLineProcess(MesLineProcess mesLineProcess); + + /** + * 删除线体管理 + * + * @param id 线体管理主键 + * @return 结果 + */ + public int deleteMesLineProcessById(String id); + + /** + * 批量删除线体管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesLineProcessByIds(String[] ids); + + public int deleteMesLineProcessByBelongTo(String belongTo); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineProcessService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineProcessService.java new file mode 100644 index 00000000..9fc677f8 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineProcessService.java @@ -0,0 +1,64 @@ +package com.op.mes.service; + +import java.util.List; + +import com.op.mes.domain.MesLineProcess; + +/** + * 线体管理Service接口 + * + * @author Open Platform + * @date 2024-04-07 + */ +public interface IMesLineProcessService { + /** + * 查询线体管理 + * + * @param id 线体管理主键 + * @return 线体管理 + */ + public MesLineProcess selectMesLineProcessById(String id); + public List selectMesLineProcessByBelongTo(String belongTo); + + /** + * 查询线体管理列表 + * + * @param mesLineProcess 线体管理 + * @return 线体管理集合 + */ + public List selectMesLineProcessList(MesLineProcess mesLineProcess); + + /** + * 新增线体管理 + * + * @param mesLineProcess 线体管理 + * @return 结果 + */ + public int insertMesLineProcess(MesLineProcess mesLineProcess); + + /** + * 修改线体管理 + * + * @param mesLineProcess 线体管理 + * @return 结果 + */ + public int updateMesLineProcess(MesLineProcess mesLineProcess); + + /** + * 批量删除线体管理 + * + * @param ids 需要删除的线体管理主键集合 + * @return 结果 + */ + public int deleteMesLineProcessByIds(String[] ids); + + /** + * 删除线体管理信息 + * + * @param id 线体管理主键 + * @return 结果 + */ + public int deleteMesLineProcessById(String id); + + public int deleteMesLineProcessByBelongTo(String belongTo); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineService.java new file mode 100644 index 00000000..7c8cd0fe --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineService.java @@ -0,0 +1,66 @@ +package com.op.mes.service; + +import java.util.List; + +import com.op.mes.domain.MesLine; + +/** + * 线体管理Service接口 + * + * @author Open Platform + * @date 2024-04-02 + */ +public interface IMesLineService { + /** + * 查询线体管理 + * + * @param id 线体管理主键 + * @return 线体管理 + */ + public MesLine selectMesLineById(String id); + + /** + * 查询线体管理列表 + * + * @param mesLine 线体管理 + * @return 线体管理集合 + */ + public List selectMesLineList(MesLine mesLine); + + /** + * 新增线体管理 + * + * @param mesLine 线体管理 + * @return 结果 + */ + public int insertMesLine(MesLine mesLine); + + /** + * 修改线体管理 + * + * @param mesLine 线体管理 + * @return 结果 + */ + public int updateMesLine(MesLine mesLine); + + /** + * 批量删除线体管理 + * + * @param ids 需要删除的线体管理主键集合 + * @return 结果 + */ + public int deleteMesLineByIds(String[] ids); + + /** + * 删除线体管理信息 + * + * @param id 线体管理主键 + * @return 结果 + */ + public int deleteMesLineById(String id); + + /** + * 选择线体 + */ + public List selectLineBody(MesLine mesLine); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index a11e4b73..43e7de7c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -375,11 +375,6 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { } //查询base_product的report_rate//箱子-大盒-小盒 BigDecimal reportRate = mesReportWorkMapper.getReportRate(workOrders.get(0).getProductCode()); - if(reportRate != null){ - BigDecimal newQuantity = sHzWorks.getQuantityFeedback().divide(reportRate,2, RoundingMode.HALF_UP); - sHzWorks.setQuantityFeedback(newQuantity); - } - //子工单报工 logger.info("==========================子工单报工开始"); sapRson = this.reportHzToSap(sHzWorks); @@ -398,7 +393,13 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { } //母工单报工 logger.info("==========================母工单报工开始"); - pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback()); + if(reportRate != null){ + BigDecimal newQuantity = sHzWorks.getQuantityFeedback().divide(reportRate,2, RoundingMode.HALF_UP); + pHzWork.setQuantityFeedback(newQuantity); + }else{ + pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback()); + } + //pHzWork.setSac2("4");//母单报工固定值(上位机插入数据时候默认4) R sapR = this.reportHzToSap(pHzWork); logger.info("==========================母工单报工结束"+JSONObject.toJSONString(sapR)); diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineProcessServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineProcessServiceImpl.java new file mode 100644 index 00000000..b6480efb --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineProcessServiceImpl.java @@ -0,0 +1,110 @@ +package com.op.mes.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.MesLineProcessMapper; +import com.op.mes.domain.MesLineProcess; +import com.op.mes.service.IMesLineProcessService; + +/** + * 线体管理Service业务层处理 + * + * @author Open Platform + * @date 2024-04-07 + */ +@Service +public class MesLineProcessServiceImpl implements IMesLineProcessService { + @Autowired + private MesLineProcessMapper mesLineProcessMapper; + + /** + * 查询线体管理 + * + * @param id 线体管理主键 + * @return 线体管理 + */ + @Override + @DS("#header.poolName") + public MesLineProcess selectMesLineProcessById(String id) { + return mesLineProcessMapper.selectMesLineProcessById(id); + } + + @Override + public List selectMesLineProcessByBelongTo(String belongTo) { + return mesLineProcessMapper.selectMesLineProcessByBelongTo(belongTo); + } + + /** + * 查询线体管理列表 + * + * @param mesLineProcess 线体管理 + * @return 线体管理 + */ + @Override + @DS("#header.poolName") + public List selectMesLineProcessList(MesLineProcess mesLineProcess) { + return mesLineProcessMapper.selectMesLineProcessList(mesLineProcess); + } + + /** + * 新增线体管理 + * + * @param mesLineProcess 线体管理 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertMesLineProcess(MesLineProcess mesLineProcess) { + mesLineProcess.setId(IdUtils.fastSimpleUUID()); + mesLineProcess.setCreateTime(DateUtils.getNowDate()); + mesLineProcess.setCreateBy(SecurityUtils.getUsername()); + return mesLineProcessMapper.insertMesLineProcess(mesLineProcess); + } + + /** + * 修改线体管理 + * + * @param mesLineProcess 线体管理 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateMesLineProcess(MesLineProcess mesLineProcess) { + mesLineProcess.setUpdateTime(DateUtils.getNowDate()); + return mesLineProcessMapper.updateMesLineProcess(mesLineProcess); + } + + /** + * 批量删除线体管理 + * + * @param ids 需要删除的线体管理主键 + * @return 结果 + */ + @Override + public int deleteMesLineProcessByIds(String[] ids) { + return mesLineProcessMapper.deleteMesLineProcessByIds(ids); + } + + /** + * 删除线体管理信息 + * + * @param id 线体管理主键 + * @return 结果 + */ + @Override + public int deleteMesLineProcessById(String id) { + return mesLineProcessMapper.deleteMesLineProcessById(id); + } + + @Override + @DS("#header.poolName") + public int deleteMesLineProcessByBelongTo(String belongTo) { + return mesLineProcessMapper.deleteMesLineProcessByBelongTo(belongTo); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineServiceImpl.java new file mode 100644 index 00000000..862e8220 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineServiceImpl.java @@ -0,0 +1,164 @@ +package com.op.mes.service.impl; + +import java.util.List; +import java.util.stream.Collectors; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import com.op.mes.domain.MesLineProcess; +import com.op.mes.service.IMesLineProcessService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.MesLineMapper; +import com.op.mes.domain.MesLine; +import com.op.mes.service.IMesLineService; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 线体管理Service业务层处理 + * + * @author Open Platform + * @date 2024-04-02 + */ +@Service +public class MesLineServiceImpl implements IMesLineService { + @Autowired + private MesLineMapper mesLineMapper; + + @Autowired + private IMesLineProcessService mesLineProcessService; + + /** + * 查询线体管理 + * + * @param id 线体管理主键 + * @return 线体管理 + */ + @Override + @DS("#header.poolName") + public MesLine selectMesLineById(String id) { + //查询时回显线体工艺数据 + List mesList = mesLineProcessService.selectMesLineProcessByBelongTo(id); + List processList = mesList.stream().map(MesLineProcess::getProcessName).collect(Collectors.toList()); + MesLine mesLine = mesLineMapper.selectMesLineById(id); + //设置线体数据 + if (!CollectionUtils.isEmpty(processList)) { + mesLine.setProcessList(processList); + } + return mesLine; + } + + /** + * 查询线体管理列表 + * + * @param mesLine 线体管理 + * @return 线体管理 + */ + @Override + @DS("#header.poolName") + public List selectMesLineList(MesLine mesLine) { + return mesLineMapper.selectMesLineList(mesLine); + } + + /** + * 新增线体管理 + * + * @param mesLine 线体管理 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertMesLine(MesLine mesLine) { + mesLine.setCreateTime(DateUtils.getNowDate()); + mesLine.setCreateBy(SecurityUtils.getUsername()); + mesLine.setId(IdUtils.fastSimpleUUID()); + // 获取工厂编码 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String factoryCode = request.getHeader(key.substring(8)).replace("ds_", ""); + mesLine.setFactoryCode(factoryCode); + return mesLineMapper.insertMesLine(mesLine); + } + + /** + * 修改线体管理 + * + * @param mesLine 线体管理 + * @return 结果 + */ + @Override + @DS("#header.poolName") + @Transactional(propagation = Propagation.REQUIRED) + public int updateMesLine(MesLine mesLine) { + mesLine.setUpdateTime(DateUtils.getNowDate()); + mesLine.setUpdateBy(SecurityUtils.getUsername()); + List processList = mesLine.getProcessList(); + int flag = 0; + if (!CollectionUtils.isEmpty(processList)) { + //删除旧的工艺项 + mesLineProcessService.deleteMesLineProcessByBelongTo(mesLine.getId()); + + String belongTo = mesLine.getId(); + String lineCode = mesLine.getLineCode(); + String lineName = mesLine.getLineName(); + // 获取工厂编码 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String factoryCode = request.getHeader(key.substring(8)).replace("ds_", ""); + + for (String processName : processList ) { + MesLineProcess mesLineProcess = new MesLineProcess(); + mesLineProcess.setBelongTo(belongTo); + mesLineProcess.setProcessName(processName); + mesLineProcess.setLineCode(lineCode); + mesLineProcess.setLineName(lineName); + mesLineProcess.setFactoryCode(factoryCode); + flag += mesLineProcessService.insertMesLineProcess(mesLineProcess); + } + }else { + return 0; + } + if (flag > 0){ + return mesLineMapper.updateMesLine(mesLine); + }else { + return 0; + } + } + + /** + * 批量删除线体管理 + * + * @param ids 需要删除的线体管理主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesLineByIds(String[] ids) { + return mesLineMapper.deleteMesLineByIds(ids); + } + + /** + * 删除线体管理信息 + * + * @param id 线体管理主键 + * @return 结果 + */ + @Override + public int deleteMesLineById(String id) { + return mesLineMapper.deleteMesLineById(id); + } + + @Override + @DS("#header.poolName") + public List selectLineBody(MesLine mesLine) { + return mesLineMapper.selectLineBody(mesLine); + } +} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesLineMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineMapper.xml new file mode 100644 index 00000000..4f75e67d --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, line_code, line_name, use_man, efficiency, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from mes_line + + + + + + + + insert into mes_line + + id, + line_code, + line_name, + use_man, + efficiency, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + factory_code, + del_flag, + + + #{id}, + #{lineCode}, + #{lineName}, + #{useMan}, + #{efficiency}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{delFlag}, + + + + + update mes_line + + line_code = #{lineCode}, + line_name = #{lineName}, + use_man = #{useMan}, + efficiency = #{efficiency}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + del_flag =#{delFlag}, + + where id = #{id} + + + + update mes_line set del_flag = '1' where id = #{id} + + + + update mes_line set del_flag = '1' where id in + + #{id} + + + + diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesLineProcessMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineProcessMapper.xml new file mode 100644 index 00000000..ebda3ea3 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineProcessMapper.xml @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, belong_to, process_code, process_name, quality, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag, line_code, line_name from mes_line_process + + + + + + + + + insert into mes_line_process + + id, + + belong_to, + + process_code, + + process_name, + + quality, + + attr1, + + attr2, + + attr3, + + attr4, + + create_by, + + create_time, + + update_by, + + update_time, + + factory_code, + + del_flag, + + line_code, + + line_name, + + + + #{id}, + + #{belongTo}, + + #{processCode}, + + #{processName}, + + #{quality}, + + #{attr1}, + + #{attr2}, + + #{attr3}, + + #{attr4}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + #{factoryCode}, + + #{delFlag}, + + #{lineCode}, + + #{lineName}, + + + + + + update mes_line_process + + belong_to = + #{belongTo}, + + process_code = + #{processCode}, + + process_name = + #{processName}, + + quality = + #{quality}, + + attr1 = + #{attr1}, + + attr2 = + #{attr2}, + + attr3 = + #{attr3}, + + attr4 = + #{attr4}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + factory_code = + #{factoryCode}, + + del_flag = + #{delFlag}, + + line_code = + #{lineCode}, + + line_name = + #{lineName}, + + + where id = #{id} + + + + delete from mes_line_process where id = #{id} + + + + delete from mes_line_process where id in + + #{id} + + + + delete from mes_line_process where belong_to = #{belongTo} + + + diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml index f8ddb0e3..b1b8a35b 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml @@ -326,7 +326,7 @@ left join base_equipment be on pow.workorder_name = be.equipment_code and be.equipment_type_code = 'equ_type_bzx' where pow.workorder_name = #{equCode} and pow.status = 'w2' and CONVERT ( DATE, pow.product_date ) = CONVERT ( DATE, GETDATE( ) ) - and pow.parent_order = '0' + and pow.parent_order = '0' and pow.del_flag='0' diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml index 55379f8b..0263194d 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml @@ -117,10 +117,11 @@ mpd.quantity planQuantity, mrwc.parent_order parentOrder from mes_report_work_consume mrwc - left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code - left join mes_prepare_detail mpd on mpd.parent_work_order = pow.belong_work_order - and mpd.material_code = mrwc.material_code - and mpd.del_flag = '0' + left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code + left join mes_prepare mp on mp.workorder_code = pow.workorder_code and mp.del_flag='0' + left join mes_prepare_detail mpd on mpd.prepare_id = mp.prepare_id + and mpd.material_code = mrwc.material_code + and mpd.del_flag = '0' where mrwc.del_flag = '0' and pow.del_flag = '0' and mrwc.workorder_code = #{workorderCode} order by mrwc.recoil,mrwc.attr1 diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 3e00b613..0abe5b7b 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -596,11 +596,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from mes_report_work where upload_status != #{uploadStatus} and prod_type = #{prodType} - and workorder_code = #{workorderCode} + and workorder_code = #{workorderCode} and del_flag='0' group by workorder_code,product_code,product_name,remark ) mrw left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code left join base_equipment equ on equ.equipment_code = ow.workorder_name + where ow.del_flag='0' and equ.del_flag='0' + + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml index 7c223f4f..94549ab2 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcUserMaterialMapper.xml @@ -114,7 +114,7 @@ diff --git a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java index 6306ecab..94251f85 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java @@ -1,8 +1,12 @@ package com.op.sap.controller; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.R; +import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.web.controller.BaseController; +import com.op.common.datasource.creator.DynamicDatasourceCreator; import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.sap.domain.vo.*; @@ -10,6 +14,7 @@ import com.op.sap.mapper.SapBomMapper; import com.op.sap.service.*; import com.op.system.api.RemoteUserService; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.sap.*; import com.op.system.api.domain.sap.SapCustom; @@ -20,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.Calendar; import java.util.Date; import java.util.List; @@ -60,6 +66,10 @@ public class SapController extends BaseController { @Autowired private SapWmsService sapWmsService; + @Resource + private DynamicDatasourceCreator dynamicDatasourceCreator; + @Resource + private DynamicRoutingDataSource dynamicRoutingDataSource; /**====================主数据相关===================================================================================*/ /** * 物料同步接口 @@ -521,5 +531,19 @@ public class SapController extends BaseController { public R incomingConversion(@RequestBody(required = false) Map mapList) { return sapItemSyncService.incomingConversion(mapList); } + @PostMapping("/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicDatasourceCreator.createDynamicDataSource(dataSourceProperty); + return R.ok(); + } + @PostMapping("/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicRoutingDataSource.removeDataSource(dataSourceProperty.getPoolName()); + return R.ok(); + } } diff --git a/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java b/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java index b2ac4385..c0fe1e05 100644 --- a/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java +++ b/op-modules/op-system/src/main/java/com/op/system/mapper/SysDatasourceMapper.java @@ -76,4 +76,6 @@ public interface SysDatasourceMapper { List selectDBListByDept(SysDatasource qo); void deletUserDB(String userCode); + + void deleteUserByIds(String[] ids); } diff --git a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysDatasourceServiceImpl.java b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysDatasourceServiceImpl.java index c7a63422..455cbe89 100644 --- a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysDatasourceServiceImpl.java +++ b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysDatasourceServiceImpl.java @@ -1,10 +1,14 @@ package com.op.system.service.impl; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; +import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.datasource.creator.DynamicDatasourceCreator; +import com.op.system.api.*; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.SysUser; import com.op.system.domain.SysDatasource; import com.op.system.mapper.SysDatasourceMapper; @@ -43,6 +47,24 @@ public class SysDatasourceServiceImpl implements ISysDatasourceService { private String driver; @Resource private DynamicDatasourceCreator dynamicDatasourceCreator; + @Autowired + private RemoteQualityService remoteQualityService; + @Autowired + private RemotePlanService remotePlanService; + @Autowired + private RemoteMesService remoteMesService; + @Autowired + private RemoteWmsService remoteWmsService; + @Autowired + private RemoteDeviceService remoteDeviceService; + @Autowired + private RemoteOpenService remoteOpenService; + @Autowired + private RemoteSapService remoteSapService; + @Autowired + private RemoteTechnologyService remoteTechnologyService; + @Resource + private DynamicRoutingDataSource dynamicRoutingDataSource; /** * 查询工厂数据库 @@ -102,6 +124,11 @@ public class SysDatasourceServiceImpl implements ISysDatasourceService { //修改之后status->1 不生效,需要重新测试链接才生效 sysDatasource.setStatus("1"); sysDatasource.setUpdateTime(DateUtils.getNowDate()); + if (StringUtils.isNotEmpty(sysDatasource.getIpPort())) { + sysDatasource.setUrl(mysqlPrev + sysDatasource.getIpPort().split("/")[0] + + mysqlAffter + sysDatasource.getIpPort().split("/")[1]); + } + return sysDatasourceMapper.updateSysDatasource(sysDatasource); } @@ -113,7 +140,32 @@ public class SysDatasourceServiceImpl implements ISysDatasourceService { */ @Override public int deleteSysDatasourceByIds(String[] ids) { - return sysDatasourceMapper.deleteSysDatasourceByIds(ids); + + for(String id:ids){ + SysDatasource sysDatasource = sysDatasourceMapper.selectSysDatasourceById(id); + DataSourcePropertyDTO dataSourceProperty = new DataSourcePropertyDTO(); + dataSourceProperty.setPoolName(sysDatasource.getPoolName()); + dynamicRoutingDataSource.removeDataSource(sysDatasource.getPoolName()); + //计划删除数据源 + remotePlanService.removeDatasource(dataSourceProperty); + //质量删除数据源 + remoteQualityService.removeDatasource(dataSourceProperty); + //mes删除数据源 + remoteMesService.removeDatasource(dataSourceProperty); + //wms删除数据源 + remoteWmsService.removeDatasource(dataSourceProperty); + //device删除数据源 + remoteDeviceService.removeDatasource(dataSourceProperty); + //open删除数据源 + remoteOpenService.removeDatasource(dataSourceProperty); + //sap删除数据源 + remoteSapService.removeDatasource(dataSourceProperty); + //工艺删除数据源 + remoteTechnologyService.removeDatasource(dataSourceProperty); + } + sysDatasourceMapper.deleteSysDatasourceByIds(ids); + sysDatasourceMapper.deleteUserByIds(ids); + return 1; } /** @@ -212,6 +264,25 @@ public class SysDatasourceServiceImpl implements ISysDatasourceService { dataSourceProperty.setLazy(false); dynamicDatasourceCreator.createDynamicDataSource(dataSourceProperty); + DataSourcePropertyDTO dto = new DataSourcePropertyDTO(); + BeanUtils.copyProperties(dataSourceProperty,dto); + //计划加入数据源 + remotePlanService.addDatasource(dto); + //质量加入数据源 + remoteQualityService.addDatasource(dto); + //mes加入数据源 + remoteMesService.addDatasource(dto); + //wms加入数据源 + remoteWmsService.addDatasource(dto); + //device加入数据源 + remoteDeviceService.addDatasource(dto); + //open加入数据源 + remoteOpenService.addDatasource(dto); + //sap加入数据源 + remoteSapService.addDatasource(dto); + //工艺加入数据源 + remoteTechnologyService.addDatasource(dto); + return "数据库链接测试成功,数据库链接状态正常"; } catch (ClassNotFoundException | SQLException classNotFoundException) { return "数据库链接异常,请检查数据库基本信息。"; diff --git a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java index 3475cd68..d483ecf3 100644 --- a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java +++ b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java @@ -592,14 +592,14 @@ public class SysUserServiceImpl implements ISysUserService { int n = 0; //sap返回的供应商编码 - List codes = dtos.stream().map(HRInfo::getUserCode).collect(Collectors.toList()); + List codes = dtos.stream().map(HRInfo::getUserName).collect(Collectors.toList()); //sap返回的工作中心编码-本地已存在 List exsitCodes = userMapper.getExsitCodes(codes); //sap返回的工作中心编码-本地不存在// 差集 (list2 - list1) List noExsitCodes = codes.stream().filter(item -> !exsitCodes.contains(item)).collect(Collectors.toList()); List updates = dtos.stream() - .filter(item -> exsitCodes.contains(item.getUserCode())) + .filter(item -> exsitCodes.contains(item.getUserName())) .collect(Collectors.toList()); if(!CollectionUtils.isEmpty(updates)){ @@ -621,7 +621,7 @@ public class SysUserServiceImpl implements ISysUserService { System.out.println("人员更新成功条数:"+m); } List adds = dtos.stream() - .filter(item -> noExsitCodes.contains(item.getUserCode())) + .filter(item -> noExsitCodes.contains(item.getUserName())) .collect(Collectors.toList()); if(!CollectionUtils.isEmpty(adds)){ diff --git a/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml b/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml index 558b903b..f076c8d6 100644 --- a/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml +++ b/op-modules/op-system/src/main/resources/mapper/system/SysDatasourceMapper.xml @@ -193,4 +193,10 @@ delete from sys_user_datasource where user_id =#{userCode} + + delete from sys_user_datasource where datasource_id in + + #{id} + + diff --git a/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml b/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml index 0739a7b6..22d19da5 100644 --- a/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -241,9 +241,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sex = #{item.sex}, del_flag = #{item.delFlag}, update_by = #{item.updateBy}, - update_time = #{updateTime} + update_time = #{item.updateTime} where - user_name = #{item.userCode} + user_name = #{item.userName} diff --git a/op-modules/op-technology/src/main/java/com/op/technology/controller/ProRouteController.java b/op-modules/op-technology/src/main/java/com/op/technology/controller/ProRouteController.java index c899cb77..c71154ba 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/controller/ProRouteController.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/controller/ProRouteController.java @@ -1,18 +1,24 @@ package com.op.technology.controller; import java.util.List; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.op.common.core.domain.R; +import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.utils.poi.ExcelUtil; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.page.TableDataInfo; import com.op.common.core.web.controller.BaseController; +import com.op.common.datasource.creator.DynamicDatasourceCreator; import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.common.security.annotation.RequiresPermissions; import com.op.system.api.RemoteSapService; +import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.sap.SapRouterQuery; import com.op.technology.domain.ProRoute; import com.op.technology.service.IProRouteProcessService; @@ -45,7 +51,10 @@ public class ProRouteController extends BaseController { @Autowired private RemoteSapService remoteSapService; - + @Resource + private DynamicDatasourceCreator dynamicDatasourceCreator; + @Resource + private DynamicRoutingDataSource dynamicRoutingDataSource; /** * 查询工艺路线列表 */ @@ -148,4 +157,20 @@ public class ProRouteController extends BaseController { } return AjaxResult.error("手动同步失败"); } + + @PostMapping("/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicDatasourceCreator.createDynamicDataSource(dataSourceProperty); + return R.ok(); + } + + @PostMapping("/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicRoutingDataSource.removeDataSource(dataSourceProperty.getPoolName()); + return R.ok(); + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java index c0011ec5..465d03ed 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseAreaController.java @@ -1,8 +1,15 @@ package com.op.wms.controller; import java.util.List; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; +import com.op.common.core.domain.R; +import com.op.common.core.utils.bean.BeanUtils; +import com.op.common.datasource.creator.DynamicDatasourceCreator; +import com.op.system.api.domain.DataSourcePropertyDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -33,7 +40,10 @@ import com.op.common.core.web.page.TableDataInfo; public class BaseAreaController extends BaseController { @Autowired private IBaseAreaService baseAreaService; - + @Resource + private DynamicDatasourceCreator dynamicDatasourceCreator; + @Resource + private DynamicRoutingDataSource dynamicRoutingDataSource; /** * 查询库区列表 */ @@ -101,4 +111,20 @@ public class BaseAreaController extends BaseController { public AjaxResult remove(@PathVariable String[] areaIds) { return toAjax(baseAreaService.deleteBaseAreaByAreaIds(areaIds)); } + @PostMapping("/addDatasource") + public R addDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicDatasourceCreator.createDynamicDataSource(dataSourceProperty); + return R.ok(); + } + + @PostMapping("/removeDatasource") + public R removeDatasource(@RequestBody DataSourcePropertyDTO dto){ + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + BeanUtils.copyProperties(dto,dataSourceProperty); + dynamicRoutingDataSource.removeDataSource(dataSourceProperty.getPoolName()); + return R.ok(); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProductEmbryoInventoryController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProductEmbryoInventoryController.java new file mode 100644 index 00000000..a885bccf --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProductEmbryoInventoryController.java @@ -0,0 +1,98 @@ +package com.op.wms.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.op.wms.domain.OdsProductEmbryoInventory; +import com.op.wms.service.IOdsProductEmbryoInventoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 成品盘点单Controller + * + * @author Open Platform + * @date 2024-04-10 + */ +@RestController +@RequestMapping("/systemFinished") +public class OdsProductEmbryoInventoryController extends BaseController { + @Autowired + private IOdsProductEmbryoInventoryService odsProductEmbryoInventoryService; + +/** + * 查询成品盘点单列表 + */ +@RequiresPermissions("systemFinished:systemFinished :list") +@GetMapping("/list") + public TableDataInfo list(OdsProductEmbryoInventory odsProductEmbryoInventory) { + startPage(); + List list = odsProductEmbryoInventoryService.selectOdsProductEmbryoInventoryList(odsProductEmbryoInventory); + return getDataTable(list); + } + + /** + * 导出成品盘点单列表 + */ + @RequiresPermissions("systemFinished:systemFinished :export") + @Log(title = "成品盘点单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, OdsProductEmbryoInventory odsProductEmbryoInventory) { + List list = odsProductEmbryoInventoryService.selectOdsProductEmbryoInventoryList(odsProductEmbryoInventory); + ExcelUtil util = new ExcelUtil(OdsProductEmbryoInventory. class); + util.exportExcel(response, list, "成品盘点单数据"); + } + + /** + * 获取成品盘点单详细信息 + */ + @RequiresPermissions("systemFinished:systemFinished :query") + @GetMapping(value = "/{ID}") + public AjaxResult getInfo(@PathVariable("ID") String ID) { + return success(odsProductEmbryoInventoryService.selectOdsProductEmbryoInventoryByID(ID)); + } + + /** + * 新增成品盘点单 + */ + @RequiresPermissions("systemFinished:systemFinished :add") + @Log(title = "成品盘点单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + return toAjax(odsProductEmbryoInventoryService.insertOdsProductEmbryoInventory(odsProductEmbryoInventory)); + } + + /** + * 修改成品盘点单 + */ + @RequiresPermissions("systemFinished:systemFinished :edit") + @Log(title = "成品盘点单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + return toAjax(odsProductEmbryoInventoryService.updateOdsProductEmbryoInventory(odsProductEmbryoInventory)); + } + + /** + * 删除成品盘点单 + */ + @RequiresPermissions("systemFinished:systemFinished :remove") + @Log(title = "成品盘点单", businessType = BusinessType.DELETE) + @DeleteMapping("/{IDs}") + public AjaxResult remove(@PathVariable String[] IDs) { + return toAjax(odsProductEmbryoInventoryService.deleteOdsProductEmbryoInventoryByIDs(IDs)); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsFpStorageNewsSnController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsFpStorageNewsSnController.java index 553129db..84b0b538 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsFpStorageNewsSnController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsFpStorageNewsSnController.java @@ -44,6 +44,16 @@ public class WmsFpStorageNewsSnController extends BaseController { List list = wmsFpStorageNewsSnService.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn); return getDataTable(list); } + /** + * 查询成品库存明细列表 + */ + + @GetMapping("/listunt") + public TableDataInfo listunt(WmsFpStorageNewsSn wmsFpStorageNewsSn) { + startPage(); + List list = wmsFpStorageNewsSnService.selectWmsFpStorageNewsSnListunt(wmsFpStorageNewsSn); + return getDataTable(list); + } /** * 导出成品库存明细列表 diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java index a4b7f01c..dd41ea63 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsProductPutController.java @@ -136,4 +136,6 @@ public class WmsProductPutController extends BaseController { String rlist = wmsProductPutService.addReportListSap(mesReportWork); return AjaxResult.success(rlist); } + + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsRuturnPutEmbryoController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsRuturnPutEmbryoController.java new file mode 100644 index 00000000..d57ef8de --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsRuturnPutEmbryoController.java @@ -0,0 +1,99 @@ +package com.op.wms.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.op.wms.service.IWmsProductPutService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.wms.domain.WmsRuturnPutEmbryo; + +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 成品退货入库Controller + * + * @author Open Platform + * @date 2024-04-09 + */ +@RestController +@RequestMapping("/ruturn") +public class WmsRuturnPutEmbryoController extends BaseController { + @Autowired + private IWmsProductPutService wmsProductPutService; + +/** + * 查询成品退货入库列表 + */ +@RequiresPermissions("wms:ruturn:list") +@GetMapping("/list") + public TableDataInfo list(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { + startPage(); + List list = wmsProductPutService.selectWmsRuturnPutEmbryoList(wmsRuturnPutEmbryo); + return getDataTable(list); + } + +// /** +// * 导出成品退货入库列表 +// */ +// @RequiresPermissions("wms:ruturn:export") +// @Log(title = "成品退货入库", businessType = BusinessType.EXPORT) +// @PostMapping("/export") +// public void export(HttpServletResponse response, WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { +// List list = wmsRuturnPutEmbryoService.selectWmsRuturnPutEmbryoList(wmsRuturnPutEmbryo); +// ExcelUtil util = new ExcelUtil(WmsRuturnPutEmbryo. class); +// util.exportExcel(response, list, "成品退货入库数据"); +// } +// +// /** +// * 获取成品退货入库详细信息 +// */ +// @RequiresPermissions("wms:ruturn:query") +// @GetMapping(value = "/{id}") +// public AjaxResult getInfo(@PathVariable("id") String id) { +// return success(wmsRuturnPutEmbryoService.selectWmsRuturnPutEmbryoById(id)); +// } +// +// /** +// * 新增成品退货入库 +// */ +// @RequiresPermissions("wms:ruturn:add") +// @Log(title = "成品退货入库", businessType = BusinessType.INSERT) +// @PostMapping +// public AjaxResult add(@RequestBody WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { +// return toAjax(wmsRuturnPutEmbryoService.insertWmsRuturnPutEmbryo(wmsRuturnPutEmbryo)); +// } +// +// /** +// * 修改成品退货入库 +// */ +// @RequiresPermissions("wms:ruturn:edit") +// @Log(title = "成品退货入库", businessType = BusinessType.UPDATE) +// @PutMapping +// public AjaxResult edit(@RequestBody WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { +// return toAjax(wmsRuturnPutEmbryoService.updateWmsRuturnPutEmbryo(wmsRuturnPutEmbryo)); +// } +// +// /** +// * 删除成品退货入库 +// */ +// @RequiresPermissions("wms:ruturn:remove") +// @Log(title = "成品退货入库", businessType = BusinessType.DELETE) +// @DeleteMapping("/{ids}") +// public AjaxResult remove(@PathVariable String[] ids) { +// return toAjax(wmsRuturnPutEmbryoService.deleteWmsRuturnPutEmbryoByIds(ids)); +// } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java index 22ba6574..446e5a06 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java @@ -20,342 +20,178 @@ import java.util.List; public class BaseEquipment extends BaseEntity { private static final long serialVersionUID = 1L; - /** - * 设备类型ID - */ + private Long equipmentId; - /** - * 设备编码 - */ @Excel(name = "设备编码") private String equipmentCode; - /** - * 设备名称 - */ @Excel(name = "设备名称") private String equipmentName; - /** - * 品牌 - */ @Excel(name = "品牌") private String equipmentBrand; - /** - * 规格型号 - */ @Excel(name = "规格型号") private String equipmentSpec; - /** - * 设备类型ID - */ @Excel(name = "设备类型ID") private Long equipmentTypeId; - /** - * 设备类型编码 - */ @Excel(name = "设备类型编码") private String equipmentTypeCode; - /** - * 设备类型名称 - */ @Excel(name = "设备类型名称") private String equipmentTypeName; - /** - * 所属车间ID - */ @Excel(name = "所属车间ID") private Long workshopId; - /** - * 所属车间编码 - */ @Excel(name = "所属车间编码") private String workshopCode; - /** - * 所属车间名称 - */ @Excel(name = "所属车间名称") private String workshopName; - /** - * 设备状态 - */ @Excel(name = "设备是否启用") private String status; - /** - * 预留字段1 - */ @Excel(name = "预留字段1") private String attr1; - /** - * 预留字段2 - */ @Excel(name = "预留字段2") private String attr2; - /** - * 预留字段3 - */ @Excel(name = "预留字段3") private Long attr3; - /** - * 预留字段4 - */ @Excel(name = "预留字段4") private Long attr4; - /** - * 单台能力工时 - */ @Excel(name = "单台能力工时") private String unitWorkingHours; - /** - * 工段 - */ @Excel(name = "工段") private String workshopSection; - /** - * 设备位置 - */ @Excel(name = "设备位置") private String equipmentLocation; - /** - * 工时单价 - */ @Excel(name = "工时单价") private String hourlyUnitPrice; //附属字段 - /** - * 成型机存料状态 - */ @Excel(name = "成型机存料状态") private String starving; - /** - * 该成型机存放的物料 - */ @Excel(name = "该成型机存放的物料") private String material; - /** - * 烘房是否开门 - */ @Excel(name = "烘房是否开门") private String isOpen; - /** - * 烘房2门前小车数量 - */ @Excel(name = "烘房2门前小车数量") private String dollyNumber; - /** - * 烘房温度 - */ @Excel(name = "烘房温度") private String temperature; - /** - * 烘房压强 - */ @Excel(name = "烘房压强") private String intensityOfPressure; - /** - * 烘房湿度 - */ @Excel(name = "烘房湿度") private String humidity; - /** - * 烘房状态 - */ @Excel(name = "烘房状态") private String state; - - /** - * 删除标志 - */ + ///////////////////////// @Excel(name = "删除标志") private String delFlag; - /** - * 属性 - */ @Excel(name = "属性") private String property; - /** - * 说明 - */ @Excel(name = "说明") private String explain; - /** - * IP - */ @Excel(name = "IP") private String plcIp; - /** - * 端口号 - */ @Excel(name = "端口号") private String plcPort; - - /** - * SAP资产号 - */ @Excel(name = "SAP资产号") private String sapAsset; - - /** - * 设备条码 - */ @Excel(name = "设备条码") private String equipmentBarcode; - /** - * 设备条码图片 - */ @Excel(name = "设备条码图片") private String equipmentBarcodeImage; - /** - * 生产厂商 - */ @Excel(name = "生产厂商") private String manufacturer; - /** - * 供应商 - */ @Excel(name = "供应商") private String supplier; - /** - * 使用寿命 - */ @Excel(name = "使用寿命") private String useLife; - /** - * 购买时间 - */ @Excel(name = "购买时间", width = 30, dateFormat = "yyyy-MM-dd") private String buyTime; - /** - * 资产原值 - */ @Excel(name = "资产原值") private String assetOriginalValue; - /** - * 资产净值 - */ @Excel(name = "资产净值") private String netAssetValue; - /** - * 资产负责人 - */ @Excel(name = "资产负责人") private String assetHead; - /** - * 固定资产编码 - */ @Excel(name = "固定资产编码") private String fixedAssetCode; - /** - * 部门 - */ @Excel(name = "部门") private String department; - /** - * 负责人工号 - */ @Excel(name = "负责人工号") private String equipmentHead; - /** - * 工厂号 - */ @Excel(name = "工厂号") private String factoryCode; - /** - * 设备状态 - */ @Excel(name = "设备状态") private String equipmentStatus; - /** - * 设备类别 - */ @Excel(name = "设备类别") private String equipmentCategory; - /** - * 资产分类名称 - */ @Excel(name = "资产分类名称") private String assetClassificationName; - /** - * 资产描述 - */ @Excel(name = "资产描述") private String assetDescription; - /** - * 数量 - */ @Excel(name = "数量") private String equipmentNumber; - /** - * 存货号 - */ @Excel(name = "存货号") private String inventoryNumber; - /** - * 计量单位 - */ @Excel(name = "计量单位") private String unitMeasurement; - //新增SAP字段 - /** - * SAP线体编码 - */ + @Excel(name = "SAP线体编码") private String sapCode; - /** - * SAP线体名称 - */ + + @Excel(name = "SAP线体名称") private String sapName; + @Excel(name = "工厂车间") + private String factoryWorkshop; + private String imageFileList; private String barCodeFileList; @@ -381,100 +217,31 @@ public class BaseEquipment extends BaseEntity { private List selectedEquipmentData; /////////////////////////维修记录 - /** - * 维修单号 - */ - private String workCode; - - /** - * 维修人员 - */ - private String workPerson; - - /** - * 维修组 - */ - private String workTeam; - - /** - * 原因分析 - */ - private String workReason; - - /** - * 故障描述 - */ - private String workFaultDesc; - - /** - * 设备维修措施 - */ - private String repairMeasures; - - /** - * 维修开始时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date workStartTime; - /** - * 维修结束时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String workCode;//维修单号 + private String workPerson;//维修人员 + private String workTeam;//维修组 + private String workReason;//原因分析 + private String workFaultDesc;//故障描述 + private String repairMeasures;//设备维修措施 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//维修开始时间 + private Date workStartTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//维修结束时间 private Date workEndTime; - - /** - * 维修状态 - */ - private String workStatus; + private String workStatus;//维修状态 /////////////////////////保养记录 - /** - * 单号 - */ - private String orderCode; - - /** - * 循环周期 - */ - private String planLoop; - - /** - * 实际开始时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd") + private String orderCode;//单号 + private String planLoop;//循环周期 + @JsonFormat(pattern = "yyyy-MM-dd")//实际开始时间 private Date orderStart; - - /** - * 实际结束时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd")//实际结束时间 private Date orderEnd; - - /** - * 工单状态 - */ - private String orderStatus; - - /** - * 工单费用 - */ - private BigDecimal orderCost; - - /** - * 责任人 - */ - private String planPerson; - - /** - * 工单用时 - */ - private String orderCostTime; - - /** - * 签字 - */ - private String orderSignPerson; + private String orderStatus;//工单状态 + private BigDecimal orderCost;//工单费用 + private String planPerson;//责任人 + private String orderCostTime;//工单用时 + private String orderSignPerson;//签字 /////////////////////////////////// public void setOrderCode(String orderCode) { @@ -1153,12 +920,12 @@ public class BaseEquipment extends BaseEntity { } //SAP线体名称 - public void setSapName(String sapName) { - this.sapName = sapName; - } - public String getSapName() { - return sapName; - } + public void setSapName(String sapName) { this.sapName = sapName; } + public String getSapName() { return sapName; } + + //工厂车间 + public void setFactoryWorkshop(String factoryWorkshop) { this.factoryWorkshop = factoryWorkshop; } + public String getFactoryWorkshop() { return factoryWorkshop; } @Override public String toString() { diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseProduct.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseProduct.java index 2f4b896e..d326c2be 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseProduct.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseProduct.java @@ -348,7 +348,7 @@ public class BaseProduct extends BaseEntity { * 报工汇率 */ @Excel(name = "报工汇率") - private Integer reportRate; + private BigDecimal reportRate; public void setCategory(String category) { this.category = category; @@ -790,12 +790,12 @@ public class BaseProduct extends BaseEntity { return mtart; } - public void setReportRate(Integer reportRate) { - this.reportRate = reportRate; + public BigDecimal getReportRate() { + return reportRate; } - public Integer getReportRate() { - return reportRate; + public void setReportRate(BigDecimal reportRate) { + this.reportRate = reportRate; } @Override diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventory.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventory.java new file mode 100644 index 00000000..f4fee6a7 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventory.java @@ -0,0 +1,379 @@ +package com.op.wms.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 成品盘点单对象 ods_product_embryo_inventory + * + * @author Open Platform + * @date 2024-04-10 + */ +public class OdsProductEmbryoInventory extends BaseEntity { +private static final long serialVersionUID=1L; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String siteCode; + + /** ID */ + private String ID; + + /** 盘点单号 */ + @Excel(name = "盘点单号") + private String orderCode; + + /** 型号编码 */ + @Excel(name = "型号编码") + private String materialCode; + /** 型号编码 */ + @Excel(name = "备注") + private String Remark; + + @Override + public String getRemark() { + return Remark; + } + + @Override + public void setRemark(String remark) { + Remark = remark; + } + + /** 型号名称 */ + @Excel(name = "型号名称") + private String materialDesc; + + /** 计划日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date planDate; + + /** 库存数量 */ + @Excel(name = "库存数量") + private BigDecimal locNumber; + + /** 单位 */ + @Excel(name = "单位") + private String Unit; + + /** 实际数量 */ + @Excel(name = "实际数量") + private BigDecimal realityNumber; + + /** 订单状态 */ + @Excel(name = "订单状态") + private String orderStatus; + + /** 用户自定义属性2 */ + @Excel(name = "用户自定义属性2") + private String userDefined1; + + /** 库位 */ + @Excel(name = "库位") + private String locCode; + + /** 用户自定义属性2 */ + @Excel(name = "用户自定义属性2") + private String userDefined2; + + /** 用户自定义属性3 */ + @Excel(name = "用户自定义属性3") + private String userDefined3; + + /** 用户自定义属性4 */ + @Excel(name = "用户自定义属性4") + private String userDefined4; + + /** 用户自定义属性5 */ + @Excel(name = "用户自定义属性5") + private String userDefined5; + + /** 用户自定义属性6 */ + @Excel(name = "用户自定义属性6") + private String userDefined6; + + /** 用户自定义属性7 */ + @Excel(name = "用户自定义属性7") + private String userDefined7; + + /** 用户自定义属性8 */ + @Excel(name = "用户自定义属性8") + private String userDefined8; + + /** 用户自定义属性9 */ + @Excel(name = "用户自定义属性9") + private String userDefined9; + + /** 用户自定义属性10 */ + @Excel(name = "用户自定义属性10") + private String userDefined10; + + /** 用户自定义属性11 */ + @Excel(name = "用户自定义属性11") + private String userDefined11; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createDate; + + /** 最后更新人 */ + @Excel(name = "最后更新人") + private String lastUpdateBy; + + /** 最后更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastUpdateDate; + + /** 可用标识 */ + @Excel(name = "可用标识") + private String Active; + + /** 企业主键 */ + @Excel(name = "企业主键") + private String enterpriseId; + + /** 企业编码 */ + @Excel(name = "企业编码") + private String enterpriseCode; + + public void setSiteCode(String siteCode){ + this.siteCode = siteCode; + } + + public String getSiteCode(){ + return siteCode; + } + public void setID(String ID){ + this.ID = ID; + } + + public String getID(){ + return ID; + } + public void setOrderCode(String orderCode){ + this.orderCode = orderCode; + } + + public String getOrderCode(){ + return orderCode; + } + public void setMaterialCode(String materialCode){ + this.materialCode = materialCode; + } + + public String getMaterialCode(){ + return materialCode; + } + public void setMaterialDesc(String materialDesc){ + this.materialDesc = materialDesc; + } + + public String getMaterialDesc(){ + return materialDesc; + } + public void setPlanDate(Date planDate){ + this.planDate = planDate; + } + + public Date getPlanDate(){ + return planDate; + } + public void setLocNumber(BigDecimal locNumber){ + this.locNumber = locNumber; + } + + public BigDecimal getLocNumber(){ + return locNumber; + } + public void setUnit(String Unit){ + this.Unit = Unit; + } + + public String getUnit(){ + return Unit; + } + public void setRealityNumber(BigDecimal realityNumber){ + this.realityNumber = realityNumber; + } + + public BigDecimal getRealityNumber(){ + return realityNumber; + } + public void setOrderStatus(String orderStatus){ + this.orderStatus = orderStatus; + } + + public String getOrderStatus(){ + return orderStatus; + } + public void setUserDefined1(String userDefined1){ + this.userDefined1 = userDefined1; + } + + public String getUserDefined1(){ + return userDefined1; + } + public void setLocCode(String locCode){ + this.locCode = locCode; + } + + public String getLocCode(){ + return locCode; + } + public void setUserDefined2(String userDefined2){ + this.userDefined2 = userDefined2; + } + + public String getUserDefined2(){ + return userDefined2; + } + public void setUserDefined3(String userDefined3){ + this.userDefined3 = userDefined3; + } + + public String getUserDefined3(){ + return userDefined3; + } + public void setUserDefined4(String userDefined4){ + this.userDefined4 = userDefined4; + } + + public String getUserDefined4(){ + return userDefined4; + } + public void setUserDefined5(String userDefined5){ + this.userDefined5 = userDefined5; + } + + public String getUserDefined5(){ + return userDefined5; + } + public void setUserDefined6(String userDefined6){ + this.userDefined6 = userDefined6; + } + + public String getUserDefined6(){ + return userDefined6; + } + public void setUserDefined7(String userDefined7){ + this.userDefined7 = userDefined7; + } + + public String getUserDefined7(){ + return userDefined7; + } + public void setUserDefined8(String userDefined8){ + this.userDefined8 = userDefined8; + } + + public String getUserDefined8(){ + return userDefined8; + } + public void setUserDefined9(String userDefined9){ + this.userDefined9 = userDefined9; + } + + public String getUserDefined9(){ + return userDefined9; + } + public void setUserDefined10(String userDefined10){ + this.userDefined10 = userDefined10; + } + + public String getUserDefined10(){ + return userDefined10; + } + public void setUserDefined11(String userDefined11){ + this.userDefined11 = userDefined11; + } + + public String getUserDefined11(){ + return userDefined11; + } + public void setCreateDate(Date createDate){ + this.createDate = createDate; + } + + public Date getCreateDate(){ + return createDate; + } + public void setLastUpdateBy(String lastUpdateBy){ + this.lastUpdateBy = lastUpdateBy; + } + + public String getLastUpdateBy(){ + return lastUpdateBy; + } + public void setLastUpdateDate(Date lastUpdateDate){ + this.lastUpdateDate = lastUpdateDate; + } + + public Date getLastUpdateDate(){ + return lastUpdateDate; + } + public void setActive(String Active){ + this.Active = Active; + } + + public String getActive(){ + return Active; + } + public void setEnterpriseId(String enterpriseId){ + this.enterpriseId = enterpriseId; + } + + public String getEnterpriseId(){ + return enterpriseId; + } + public void setEnterpriseCode(String enterpriseCode){ + this.enterpriseCode = enterpriseCode; + } + + public String getEnterpriseCode(){ + return enterpriseCode; + } + +@Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("siteCode",getSiteCode()) + .append("ID",getID()) + .append("orderCode",getOrderCode()) + .append("materialCode",getMaterialCode()) + .append("materialDesc",getMaterialDesc()) + .append("planDate",getPlanDate()) + .append("locNumber",getLocNumber()) + .append("Unit",getUnit()) + .append("realityNumber",getRealityNumber()) + .append("orderStatus",getOrderStatus()) + .append("userDefined1",getUserDefined1()) + .append("locCode",getLocCode()) + .append("userDefined2",getUserDefined2()) + .append("userDefined3",getUserDefined3()) + .append("userDefined4",getUserDefined4()) + .append("userDefined5",getUserDefined5()) + .append("userDefined6",getUserDefined6()) + .append("userDefined7",getUserDefined7()) + .append("userDefined8",getUserDefined8()) + .append("userDefined9",getUserDefined9()) + .append("userDefined10",getUserDefined10()) + .append("userDefined11",getUserDefined11()) + .append("Remark",getRemark()) + .append("createBy",getCreateBy()) + .append("createDate",getCreateDate()) + .append("lastUpdateBy",getLastUpdateBy()) + .append("lastUpdateDate",getLastUpdateDate()) + .append("Active",getActive()) + .append("enterpriseId",getEnterpriseId()) + .append("enterpriseCode",getEnterpriseCode()) + .toString(); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java index 0a168482..76f5da3f 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java @@ -146,6 +146,17 @@ public class WmsFpStorageNewsSn extends BaseEntity { @Excel(name = "备用9") private String userDefined9; + @Excel(name = "单位") + private String unit; + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + /** * 备用10 */ diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProductEmbryoInventoryMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProductEmbryoInventoryMapper.java new file mode 100644 index 00000000..aedc33be --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProductEmbryoInventoryMapper.java @@ -0,0 +1,61 @@ +package com.op.wms.mapper; + +import java.util.List; + +import com.op.wms.domain.OdsProductEmbryoInventory; + +/** + * 成品盘点单Mapper接口 + * + * @author Open Platform + * @date 2024-04-10 + */ +public interface OdsProductEmbryoInventoryMapper { + /** + * 查询成品盘点单 + * + * @param ID 成品盘点单主键 + * @return 成品盘点单 + */ + public OdsProductEmbryoInventory selectOdsProductEmbryoInventoryByID(String ID); + + /** + * 查询成品盘点单列表 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 成品盘点单集合 + */ + public List selectOdsProductEmbryoInventoryList(OdsProductEmbryoInventory odsProductEmbryoInventory); + + /** + * 新增成品盘点单 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 结果 + */ + public int insertOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + /** + * 修改成品盘点单 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 结果 + */ + public int updateOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + /** + * 删除成品盘点单 + * + * @param ID 成品盘点单主键 + * @return 结果 + */ + public int deleteOdsProductEmbryoInventoryByID(String ID); + + /** + * 批量删除成品盘点单 + * + * @param IDs 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteOdsProductEmbryoInventoryByIDs(String[] IDs); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java index ef4f5d3a..aa4ae031 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java @@ -78,4 +78,6 @@ public interface WmsFpStorageNewsSnMapper { public WmsFpStorageNewsSn selectWmsFpStorageNewsSnBySnAndProductCode(@Param("sn") String sn, @Param("productCode") String productCode); void updateWmsFpStorageNewsSnOut(WmsFpStorageNewsSn wmsFpStorageNewsSn); + + String selectwmsFpStorageNews(WmsFpStorageNewsSn wmsFpStorageNewsSn1); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRuturnPutEmbryoMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRuturnPutEmbryoMapper.java index 022034ba..31f01906 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRuturnPutEmbryoMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRuturnPutEmbryoMapper.java @@ -14,4 +14,11 @@ public interface WmsRuturnPutEmbryoMapper { WmsRuturnPutEmbryo selectWmsRuturnPutEmbryoByid(WmsRuturnPutEmbryo wmsRuturnPutEmbryo1); void insertWmsRuturnPutEmbryoMapperRecords(WmsRuturnPutEmbryo wmsProductPutRecords); + /** + * 查询成品退货入库列表 + * + * @param wmsRuturnPutEmbryo 成品退货入库 + * @return 成品退货入库集合 + */ + public List selectWmsRuturnPutEmbryoList(WmsRuturnPutEmbryo wmsRuturnPutEmbryo); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProductEmbryoInventoryService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProductEmbryoInventoryService.java new file mode 100644 index 00000000..c2b2dcef --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProductEmbryoInventoryService.java @@ -0,0 +1,61 @@ +package com.op.wms.service; + +import java.util.List; + +import com.op.wms.domain.OdsProductEmbryoInventory; + +/** + * 成品盘点单Service接口 + * + * @author Open Platform + * @date 2024-04-10 + */ +public interface IOdsProductEmbryoInventoryService { + /** + * 查询成品盘点单 + * + * @param ID 成品盘点单主键 + * @return 成品盘点单 + */ + public OdsProductEmbryoInventory selectOdsProductEmbryoInventoryByID(String ID); + + /** + * 查询成品盘点单列表 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 成品盘点单集合 + */ + public List selectOdsProductEmbryoInventoryList(OdsProductEmbryoInventory odsProductEmbryoInventory); + + /** + * 新增成品盘点单 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 结果 + */ + public int insertOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + /** + * 修改成品盘点单 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 结果 + */ + public int updateOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + /** + * 批量删除成品盘点单 + * + * @param IDs 需要删除的成品盘点单主键集合 + * @return 结果 + */ + public int deleteOdsProductEmbryoInventoryByIDs(String[] IDs); + + /** + * 删除成品盘点单信息 + * + * @param ID 成品盘点单主键 + * @return 结果 + */ + public int deleteOdsProductEmbryoInventoryByID(String ID); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsFpStorageNewsSnService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsFpStorageNewsSnService.java index 5d7279e6..ff1de4d4 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsFpStorageNewsSnService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsFpStorageNewsSnService.java @@ -60,4 +60,5 @@ public interface IWmsFpStorageNewsSnService { public int deleteWmsFpStorageNewsSnByStorageId(String storageId); + List selectWmsFpStorageNewsSnListunt(WmsFpStorageNewsSn wmsFpStorageNewsSn); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java index f1fd022d..2cf511ed 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsProductPutService.java @@ -126,4 +126,6 @@ public interface IWmsProductPutService { WmsFpStorageNewsSn palletScanning(WmsFpStorageNewsSn wmsFpStorageNewsSn); String palletTransferConfirmation(WmsFpStorageNewsSn wmsFpStorageNewsSn); + + List selectWmsRuturnPutEmbryoList(WmsRuturnPutEmbryo wmsRuturnPutEmbryo); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProductEmbryoInventoryServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProductEmbryoInventoryServiceImpl.java new file mode 100644 index 00000000..fd4877dd --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProductEmbryoInventoryServiceImpl.java @@ -0,0 +1,95 @@ +package com.op.wms.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.wms.domain.OdsProductEmbryoInventory; +import com.op.wms.mapper.OdsProductEmbryoInventoryMapper; +import com.op.wms.service.IOdsProductEmbryoInventoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * 成品盘点单Service业务层处理 + * + * @author Open Platform + * @date 2024-04-10 + */ +@Service +public class OdsProductEmbryoInventoryServiceImpl implements IOdsProductEmbryoInventoryService { + @Autowired + private OdsProductEmbryoInventoryMapper odsProductEmbryoInventoryMapper; + + /** + * 查询成品盘点单 + * + * @param ID 成品盘点单主键 + * @return 成品盘点单 + */ + @Override + @DS("#header.poolName") + public OdsProductEmbryoInventory selectOdsProductEmbryoInventoryByID(String ID) { + return odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryByID(ID); + } + + /** + * 查询成品盘点单列表 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 成品盘点单 + */ + @Override + @DS("#header.poolName") + public List selectOdsProductEmbryoInventoryList(OdsProductEmbryoInventory odsProductEmbryoInventory) { + return odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryList(odsProductEmbryoInventory); + } + + /** + * 新增成品盘点单 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) { + return odsProductEmbryoInventoryMapper.insertOdsProductEmbryoInventory(odsProductEmbryoInventory); + } + + /** + * 修改成品盘点单 + * + * @param odsProductEmbryoInventory 成品盘点单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) { + return odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventory(odsProductEmbryoInventory); + } + + /** + * 批量删除成品盘点单 + * + * @param IDs 需要删除的成品盘点单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteOdsProductEmbryoInventoryByIDs(String[] IDs) { + return odsProductEmbryoInventoryMapper.deleteOdsProductEmbryoInventoryByIDs(IDs); + } + + /** + * 删除成品盘点单信息 + * + * @param ID 成品盘点单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteOdsProductEmbryoInventoryByID(String ID) { + return odsProductEmbryoInventoryMapper.deleteOdsProductEmbryoInventoryByID(ID); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsFpStorageNewsSnServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsFpStorageNewsSnServiceImpl.java index f337a631..5cdc7392 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsFpStorageNewsSnServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsFpStorageNewsSnServiceImpl.java @@ -91,4 +91,16 @@ public class WmsFpStorageNewsSnServiceImpl implements IWmsFpStorageNewsSnService public int deleteWmsFpStorageNewsSnByStorageId(String storageId) { return wmsFpStorageNewsSnMapper.deleteWmsFpStorageNewsSnByStorageId(storageId); } + + @Override + @DS("#header.poolName") + public List selectWmsFpStorageNewsSnListunt(WmsFpStorageNewsSn wmsFpStorageNewsSn) { + List wmsFpStorageNewsSnList= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn); + for ( WmsFpStorageNewsSn wmsFpStorageNewsSn1 : + wmsFpStorageNewsSnList ) { + String unit= wmsFpStorageNewsSnMapper.selectwmsFpStorageNews(wmsFpStorageNewsSn1); + wmsFpStorageNewsSn1.setUnit(unit); + } + return wmsFpStorageNewsSnList; + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java index 0c70f596..ed4fbd99 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java @@ -697,8 +697,8 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { String results="提单成功"; DynamicDataSourceContextHolder.push("ds_" + wmsSellOutEmbryo.getFactoryCode()); Map objectMap=new HashMap<>(); -// objectMap.put("S_MATNR","");//物料号, -// objectMap.put("S_TDDAT","");//String 计划运输日期 + objectMap.put("S_MATNR",wmsSellOutEmbryo.getProductCode());//物料号, + objectMap.put("S_TDDAT",wmsSellOutEmbryo.getAttr1());//String 计划运输日期 objectMap.put("VBELN_VA",wmsSellOutEmbryo.getDeliveryOrder());//交货单 R result = remoteSapService.FPinventory(objectMap); int code = result.getCode(); @@ -1089,4 +1089,15 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { } return result1; } + /** + * 查询成品退货入库列表 + * + * @param wmsRuturnPutEmbryo 成品退货入库 + * @return 成品退货入库 + */ + @Override + @DS("#header.poolName") + public List selectWmsRuturnPutEmbryoList(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) { + return wmsRuturnPutEmbryoMapper.selectWmsRuturnPutEmbryoList(wmsRuturnPutEmbryo); + } } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml index 73f685fc..f5bce14a 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml @@ -56,6 +56,7 @@ + @@ -178,63 +179,43 @@ inventory_number, unit_measurement, sap_code, - sap_name + sap_name, + factory_workshop from base_equipment @@ -325,6 +301,7 @@ unit_measurement, sap_code, sap_name, + factory_workshop, #{equipmentCode}, @@ -369,21 +346,21 @@ #{factoryCode}, #{equipmentStatus}, #{equipmentCategory}, - #{assetClassificationName}, - + #{assetClassificationName}, #{assetDescription}, #{equipmentNumber}, #{inventoryNumber}, #{unitMeasurement}, #{sapCode}, #{sapName}, + #{factoryWorkshop}, update base_equipment - equipment_code = #{equipmentCode}, + equipment_code = #{equipmentCode}, equipment_name = #{equipmentName}, equipment_brand = #{equipmentBrand}, equipment_spec = #{equipmentSpec}, @@ -403,15 +380,12 @@ create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, - unit_working_hours = #{unitWorkingHours}, - - workshop_section = #{workshopSection}, - equipment_location = - #{equipmentLocation}, - - hourly_unit_price = #{hourlyUnitPrice}, - plc_ip = #{plcIp}, - plc_port = #{plcPort}, + unit_working_hours = #{unitWorkingHours}, + workshop_section = #{workshopSection}, + equipment_location = #{equipmentLocation}, + hourly_unit_price = #{hourlyUnitPrice}, + plc_ip = #{plcIp}, + plc_port = #{plcPort}, equipment_barcode = #{equipmentBarcode}, equipment_barcode_image = #{equipmentBarcodeImage}, manufacturer = #{manufacturer}, @@ -428,16 +402,14 @@ factory_code = #{factoryCode}, equipment_status = #{equipmentStatus}, equipment_category = #{equipmentCategory}, - asset_classification_name = - #{assetClassificationName}, - - asset_description = #{assetDescription}, - - equipment_number = #{equipmentNumber}, - inventory_number = #{inventoryNumber}, - unit_measurement = #{unitMeasurement}, - sap_code = #{sapCode}, - sap_name = #{sapName}, + asset_classification_name = #{assetClassificationName}, + asset_description = #{assetDescription}, + equipment_number = #{equipmentNumber}, + inventory_number = #{inventoryNumber}, + unit_measurement = #{unitMeasurement}, + sap_code = #{sapCode}, + sap_name = #{sapName}, + factory_workshop = #{factoryWorkshop}, where equipment_id = #{equipmentId} diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProductEmbryoInventoryMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProductEmbryoInventoryMapper.xml new file mode 100644 index 00000000..2c9f65f9 --- /dev/null +++ b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProductEmbryoInventoryMapper.xml @@ -0,0 +1,375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select Site_code, ID, Order_Code, Material_Code, Material_Desc, Plan_Date, Loc_Number, Unit, Reality_Number, Order_Status, User_Defined1, Loc_Code, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Remark, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from ods_product_embryo_inventory + + + + + + + + insert into ods_product_embryo_inventory + + Site_code, + + ID, + + Order_Code, + + Material_Code, + + Material_Desc, + + Plan_Date, + + Loc_Number, + + Unit, + + Reality_Number, + + Order_Status, + + User_Defined1, + + Loc_Code, + + User_Defined2, + + User_Defined3, + + User_Defined4, + + User_Defined5, + + User_Defined6, + + User_Defined7, + + User_Defined8, + + User_Defined9, + + User_Defined10, + + User_Defined11, + + Remark, + + Create_By, + + Create_Date, + + Last_Update_By, + + Last_Update_Date, + + Active, + + Enterprise_Id, + + Enterprise_Code, + + + + #{siteCode}, + + #{ID}, + + #{orderCode}, + + #{materialCode}, + + #{materialDesc}, + + #{planDate}, + + #{locNumber}, + + #{Unit}, + + #{realityNumber}, + + #{orderStatus}, + + #{userDefined1}, + + #{locCode}, + + #{userDefined2}, + + #{userDefined3}, + + #{userDefined4}, + + #{userDefined5}, + + #{userDefined6}, + + #{userDefined7}, + + #{userDefined8}, + + #{userDefined9}, + + #{userDefined10}, + + #{userDefined11}, + + #{Remark}, + + #{createBy}, + + #{createDate}, + + #{lastUpdateBy}, + + #{lastUpdateDate}, + + #{Active}, + + #{enterpriseId}, + + #{enterpriseCode}, + + + + + + update ods_product_embryo_inventory + + Site_code = + #{siteCode}, + + Order_Code = + #{orderCode}, + + Material_Code = + #{materialCode}, + + Material_Desc = + #{materialDesc}, + + Plan_Date = + #{planDate}, + + Loc_Number = + #{locNumber}, + + Unit = + #{Unit}, + + Reality_Number = + #{realityNumber}, + + Order_Status = + #{orderStatus}, + + User_Defined1 = + #{userDefined1}, + + Loc_Code = + #{locCode}, + + User_Defined2 = + #{userDefined2}, + + User_Defined3 = + #{userDefined3}, + + User_Defined4 = + #{userDefined4}, + + User_Defined5 = + #{userDefined5}, + + User_Defined6 = + #{userDefined6}, + + User_Defined7 = + #{userDefined7}, + + User_Defined8 = + #{userDefined8}, + + User_Defined9 = + #{userDefined9}, + + User_Defined10 = + #{userDefined10}, + + User_Defined11 = + #{userDefined11}, + + Remark = + #{Remark}, + + Create_By = + #{createBy}, + + Create_Date = + #{createDate}, + + Last_Update_By = + #{lastUpdateBy}, + + Last_Update_Date = + #{lastUpdateDate}, + + Active = + #{Active}, + + Enterprise_Id = + #{enterpriseId}, + + Enterprise_Code = + #{enterpriseCode}, + + + where ID = #{ID} + + + + delete from ods_product_embryo_inventory where ID = #{ID} + + + + delete from ods_product_embryo_inventory where ID in + + #{ID} + + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml index 9210d715..3d4aebe3 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml @@ -253,4 +253,8 @@ set user_defined2 = COALESCE(user_defined2, 0) + 1 where sn=#{sn} and active_flag='1' + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml index 93c536f8..f77bd2da 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRuturnPutEmbryoMapper.xml @@ -221,4 +221,95 @@ #{activeFlag}, + + + select id, factory_code, product_order, wh_code, wa_code, wl_code, product_name, product_code, product_sort, speciFication as speciFication, unit_of_measure, plan_quantity, put_quantity, status, SAP_status, SAP_proof, SAP_message, put_date, attr1, attr2, attr3, attr4, attr5, attr6, attr7, attr8, attr9, attr10, create_by, create_time, update_by, update_time from wms_ruturn_put_embryo + + +