Merge remote-tracking branch 'origin/master'

master
Yangwl 12 months ago
commit 783dc284f9

@ -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);
}

@ -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);
}

@ -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);
}

@ -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);
}

@ -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);
}

@ -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<String, Object> mapList);
@PostMapping("/sap/addDatasource")
public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty);
@PostMapping("/sap/removeDatasource")
public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty);
}

@ -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<Boolean> sapAddOrder(@RequestBody SapProOrder sapProOrder);
@PostMapping("/pro/proroute/addDatasource")
public R addDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty);
@PostMapping("/pro/proroute/removeDatasource")
public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty);
}

@ -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);
}

@ -0,0 +1,80 @@
package com.op.system.api.domain;
/**
* @author zxl
* @date 20240412 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;
}
}

@ -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<RemoteDevice
public R equipmentBKTask() {
return R.fail("设备运行记录数据库备份失败"+throwable.getMessage());
}
@Override
public R addDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("设备数据源创建失败:" + throwable.getMessage());
}
@Override
public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("设备数据源移除失败:" + throwable.getMessage());
}
};
}
}

@ -4,6 +4,7 @@ import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R;
import com.op.system.api.RemoteMesService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.model.SapProOrder;
import org.slf4j.Logger;
@ -55,6 +56,16 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R dataBKTask() {
return R.fail("数据库备份失败:" + throwable.getMessage());
}
@Override
public R addDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("mes数据源创建失败:" + throwable.getMessage());
}
@Override
public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("mes数据源删除失败:" + throwable.getMessage());
}
};
}
}

@ -1,8 +1,9 @@
package com.op.system.api.factory;
import com.op.common.core.domain.R;
import com.op.common.core.web.domain.AjaxResult;
import com.op.system.api.RemoteOpenService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@ -44,6 +45,16 @@ public class RemoteOpenFallbackFactory implements FallbackFactory<RemoteOpenServ
public AjaxResult GetHrDeptInfo() {
return AjaxResult.error("获取HR部门信息失败"+throwable.getMessage());
}
@Override
public R addDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("open数据源创建失败:" + throwable.getMessage());
}
@Override
public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("open数据源删除失败:" + throwable.getMessage());
}
};
}
}

@ -1,8 +1,8 @@
package com.op.system.api.factory;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R;
import com.op.system.api.RemotePlanService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.model.SapProOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -33,6 +33,18 @@ public class RemotePlanFallbackFactory implements FallbackFactory<RemotePlanServ
public R syncSAPOrders() {
return R.fail("定时任务更新订单失败:" + throwable.getMessage());
}
@Override
public R addDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("计划数据源创建失败:" + throwable.getMessage());
}
@Override
public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("计划数据源删除失败:" + throwable.getMessage());
}
};
}
}

@ -1,8 +1,8 @@
package com.op.system.api.factory;
import com.op.common.core.domain.R;
import com.op.system.api.RemoteQualityService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.op.system.api.domain.quality.QcCheckTaskWarehousingDTO;
import org.slf4j.Logger;
@ -42,6 +42,16 @@ public class RemoteQualityFallbackFactory implements FallbackFactory<RemoteQuali
public R createIncomeBatchTask() {
return R.fail("来料检验批量检验任务创建失败:" + throwable.getMessage());
}
@Override
public R addDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("质量数据源创建失败:" + throwable.getMessage());
}
@Override
public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("质量数据源移除失败:" + throwable.getMessage());
}
};
}
}

@ -2,13 +2,12 @@ package com.op.system.api.factory;
import com.op.common.core.domain.R;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.sap.*;
import com.op.system.api.model.SapProOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
@ -129,6 +128,16 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
return R.fail("成品备货单获取失败" + throwable.getMessage());
}
@Override
public R addDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("sap新增数据源失败" + throwable.getMessage());
}
@Override
public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("sap数据源删除失败" + throwable.getMessage());
}
};
}
}

@ -2,6 +2,7 @@ package com.op.system.api.factory;
import com.op.common.core.domain.R;
import com.op.system.api.RemoteTechnologyService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.model.SapProOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -26,6 +27,16 @@ public class RemoteTechnologyFallbackFactory implements FallbackFactory<RemoteTe
return R.fail("新增SAP订单失败:" + throwable.getMessage());
}
@Override
public R addDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("工艺新增数据源失败:" + throwable.getMessage());
}
@Override
public R removeDatasource(DataSourcePropertyDTO dataSourceProperty) {
return R.fail("工艺移除数据源失败:" + throwable.getMessage());
}
};
}
}

@ -0,0 +1,39 @@
package com.op.system.api.factory;
import com.op.common.core.domain.R;
import com.op.system.api.RemoteWmsService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.dto.WCSDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.List;
/**
*
*
* @author OP
*/
@Component
public class RemoteWmsFallbackFactory implements FallbackFactory<RemoteWmsService> {
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());
}
};
}
}

@ -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

@ -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();
}
}

@ -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<MesLine> 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<MesLine> list = mesLineService.selectMesLineList(mesLine);
ExcelUtil<MesLine> util = new ExcelUtil<MesLine>(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<MesLine> list = mesLineService.selectLineBody(mesLine);
return getDataTable(list);
}
}

@ -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<MesReportWorkConsume> 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();
}
}

@ -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;
/**
* 10
*/
private String delFlag;
private List<String> 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<String> getProcessList() {
return processList;
}
public void setProcessList(List<String> 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();
}
}

@ -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();
}
}

@ -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<MesLine> 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<MesLine> selectLineBody(MesLine mesLine);
}

@ -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<MesLineProcess> selectMesLineProcessByBelongTo(String belongTo);
/**
* 线
*
* @param mesLineProcess 线
* @return 线
*/
public List<MesLineProcess> 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);
}

@ -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<MesLineProcess> selectMesLineProcessByBelongTo(String belongTo);
/**
* 线
*
* @param mesLineProcess 线
* @return 线
*/
public List<MesLineProcess> 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);
}

@ -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<MesLine> 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<MesLine> selectLineBody(MesLine mesLine);
}

@ -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));

@ -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<MesLineProcess> selectMesLineProcessByBelongTo(String belongTo) {
return mesLineProcessMapper.selectMesLineProcessByBelongTo(belongTo);
}
/**
* 线
*
* @param mesLineProcess 线
* @return 线
*/
@Override
@DS("#header.poolName")
public List<MesLineProcess> 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);
}
}

@ -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<MesLineProcess> mesList = mesLineProcessService.selectMesLineProcessByBelongTo(id);
List<String> 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<MesLine> 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<String> 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<MesLine> selectLineBody(MesLine mesLine) {
return mesLineMapper.selectLineBody(mesLine);
}
}

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesLineMapper">
<resultMap type="MesLine" id="MesLineResult">
<result property="id" column="id"/>
<result property="lineCode" column="line_code"/>
<result property="lineName" column="line_name"/>
<result property="useMan" column="use_man"/>
<result property="efficiency" column="efficiency"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
<result property="attr4" column="attr4"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="factoryCode" column="factory_code"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="selectMesLineVo">
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
</sql>
<select id="selectMesLineList" parameterType="MesLine" resultMap="MesLineResult">
<include refid="selectMesLineVo"/>
<where>
<if test="lineCode != null and lineCode != ''">
and line_code = #{lineCode}
</if>
<if test="lineName != null and lineName != ''">
and line_name like concat('%', #{lineName}, '%')
</if>
<if test="useMan != null ">
and use_man = #{useMan}
</if>
<if test="efficiency != null ">
and efficiency = #{efficiency}
</if>
<if test="attr1 != null and attr1 != ''">
and attr1 = #{attr1}
</if>
<if test="attr2 != null and attr2 != ''">
and attr2 = #{attr2}
</if>
<if test="attr3 != null and attr3 != ''">
and attr3 = #{attr3}
</if>
<if test="attr4 != null and attr4 != ''">
and attr4 = #{attr4}
</if>
<if test="factoryCode != null and factoryCode != ''">
and factory_code = #{factoryCode}
</if>
and del_flag = '0'
</where>
</select>
<select id="selectMesLineById" parameterType="String"
resultMap="MesLineResult">
<include refid="selectMesLineVo"/>
where id = #{id}
</select>
<insert id="insertMesLine" parameterType="MesLine">
insert into mes_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="lineCode != null">line_code,</if>
<if test="lineName != null">line_name,</if>
<if test="useMan != null">use_man,</if>
<if test="efficiency != null">efficiency,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="lineCode != null">#{lineCode},</if>
<if test="lineName != null">#{lineName},</if>
<if test="useMan != null">#{useMan},</if>
<if test="efficiency != null">#{efficiency},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateMesLine" parameterType="MesLine">
update mes_line
<trim prefix="SET" suffixOverrides=",">
<if test="lineCode != null">line_code = #{lineCode},</if>
<if test="lineName != null">line_name = #{lineName},</if>
<if test="useMan != null">use_man = #{useMan},</if>
<if test="efficiency != null">efficiency = #{efficiency},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag =#{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMesLineById" parameterType="String">
update mes_line set del_flag = '1' where id = #{id}
</delete>
<delete id="deleteMesLineByIds" parameterType="String">
update mes_line set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectLineBody" parameterType="MesLine" resultMap="MesLineResult" >
select equipment_code line_code,
equipment_name line_name
from base_equipment
where del_flag = '0'
<if test="lineCode != null and lineCode != ''">
and equipment_code = #{lineCode}
</if>
<if test="lineName != null and lineName != ''">
and equipment_name like concat('%', #{lineName}, '%')
</if>
</select>
</mapper>

@ -0,0 +1,226 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesLineProcessMapper">
<resultMap type="MesLineProcess" id="MesLineProcessResult">
<result property="id" column="id"/>
<result property="belongTo" column="belong_to"/>
<result property="processCode" column="process_code"/>
<result property="processName" column="process_name"/>
<result property="quality" column="quality"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
<result property="attr4" column="attr4"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="factoryCode" column="factory_code"/>
<result property="delFlag" column="del_flag"/>
<result property="lineCode" column="line_code"/>
<result property="lineName" column="line_name"/>
</resultMap>
<sql id="selectMesLineProcessVo">
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
</sql>
<select id="selectMesLineProcessList" parameterType="MesLineProcess" resultMap="MesLineProcessResult">
<include refid="selectMesLineProcessVo"/>
<where>
<if test="belongTo != null and belongTo != ''">
and belong_to = #{belongTo}
</if>
<if test="processCode != null and processCode != ''">
and process_code = #{processCode}
</if>
<if test="processName != null and processName != ''">
and process_name like concat('%', #{processName}, '%')
</if>
<if test="quality != null ">
and quality = #{quality}
</if>
<if test="attr1 != null and attr1 != ''">
and attr1 = #{attr1}
</if>
<if test="attr2 != null and attr2 != ''">
and attr2 = #{attr2}
</if>
<if test="attr3 != null and attr3 != ''">
and attr3 = #{attr3}
</if>
<if test="attr4 != null and attr4 != ''">
and attr4 = #{attr4}
</if>
<if test="factoryCode != null and factoryCode != ''">
and factory_code = #{factoryCode}
</if>
<if test="lineCode != null and lineCode != ''">
and line_code = #{lineCode}
</if>
<if test="lineName != null and lineName != ''">
and line_name like concat('%', #{lineName}, '%')
</if>
</where>
</select>
<select id="selectMesLineProcessById" parameterType="String"
resultMap="MesLineProcessResult">
<include refid="selectMesLineProcessVo"/>
where id = #{id}
</select>
<select id="selectMesLineProcessByBelongTo" parameterType="String"
resultMap="MesLineProcessResult">
<include refid="selectMesLineProcessVo"/>
where belong_to = #{belongTo}
</select>
<insert id="insertMesLineProcess" parameterType="MesLineProcess">
insert into mes_line_process
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,
</if>
<if test="belongTo != null">belong_to,
</if>
<if test="processCode != null">process_code,
</if>
<if test="processName != null">process_name,
</if>
<if test="quality != null">quality,
</if>
<if test="attr1 != null">attr1,
</if>
<if test="attr2 != null">attr2,
</if>
<if test="attr3 != null">attr3,
</if>
<if test="attr4 != null">attr4,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="factoryCode != null">factory_code,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="lineCode != null">line_code,
</if>
<if test="lineName != null">line_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},
</if>
<if test="belongTo != null">#{belongTo},
</if>
<if test="processCode != null">#{processCode},
</if>
<if test="processName != null">#{processName},
</if>
<if test="quality != null">#{quality},
</if>
<if test="attr1 != null">#{attr1},
</if>
<if test="attr2 != null">#{attr2},
</if>
<if test="attr3 != null">#{attr3},
</if>
<if test="attr4 != null">#{attr4},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="factoryCode != null">#{factoryCode},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="lineCode != null">#{lineCode},
</if>
<if test="lineName != null">#{lineName},
</if>
</trim>
</insert>
<update id="updateMesLineProcess" parameterType="MesLineProcess">
update mes_line_process
<trim prefix="SET" suffixOverrides=",">
<if test="belongTo != null">belong_to =
#{belongTo},
</if>
<if test="processCode != null">process_code =
#{processCode},
</if>
<if test="processName != null">process_name =
#{processName},
</if>
<if test="quality != null">quality =
#{quality},
</if>
<if test="attr1 != null">attr1 =
#{attr1},
</if>
<if test="attr2 != null">attr2 =
#{attr2},
</if>
<if test="attr3 != null">attr3 =
#{attr3},
</if>
<if test="attr4 != null">attr4 =
#{attr4},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="factoryCode != null">factory_code =
#{factoryCode},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="lineCode != null">line_code =
#{lineCode},
</if>
<if test="lineName != null">line_name =
#{lineName},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMesLineProcessById" parameterType="String">
delete from mes_line_process where id = #{id}
</delete>
<delete id="deleteMesLineProcessByIds" parameterType="String">
delete from mes_line_process where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteMesLineProcessByBelongTo" parameterType="String">
delete from mes_line_process where belong_to = #{belongTo}
</delete>
</mapper>

@ -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'
</select>
</mapper>

@ -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

@ -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'
</select>
<select id="selectMesReportWorkList_S" parameterType="MesReportWork" resultMap="MesReportWorkResult">
SELECT

@ -1,19 +1,22 @@
package com.op.open.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.utils.StringUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.open.service.OpenService;
import com.op.system.api.RemoteQualityService;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.device.EquRepairOrderDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.quality.QcCheckTaskProduceDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import javax.annotation.Resource;
import java.util.Map;
import com.op.common.core.utils.bean.BeanUtils;
/**
* mes
*
@ -26,8 +29,10 @@ public class OpenController extends BaseController {
@Autowired
private OpenService openService;
@Resource
private DynamicDatasourceCreator dynamicDatasourceCreator;
@Resource
private DynamicRoutingDataSource dynamicRoutingDataSource;
/**
*
* WCS MES
@ -185,4 +190,19 @@ public class OpenController extends BaseController {
return openService.GetHrPostInfo();
}
@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();
}
}

@ -2,13 +2,8 @@ package com.op.open.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.op.common.core.constant.Constants;
import com.op.common.core.context.SecurityContextHolder;
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.http.HttpUtils;
@ -17,43 +12,24 @@ import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.open.mapper.OpenMapper;
import com.op.open.service.OpenService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.device.DeviceRepairOrder;
import com.op.system.api.domain.device.EquRepairOrderDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.quality.*;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import java.time.LocalDateTime;
import java.time.Duration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -327,6 +303,17 @@ public class OpenServiceImpl implements OpenService {
public int insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce) {
DynamicDataSourceContextHolder.push("ds_" + qcCheckTaskProduce.getFactoryCode());
// 创建两个日期时间对象
// LocalDateTime dateTime1 = LocalDateTime.of(2023, 1, 1, 10, 30); // 2023年1月1日 10:30
// LocalDateTime dateTime2 = LocalDateTime.now(); // 2023年1月2日 11:45
// // 计算分钟差
// long minutesBetween = Duration.between(dateTime1, dateTime2).toMinutes();
// if(minutesBetween<=1){
// logger.info("++++++++++++检验任务1分钟内生成过不再重复创建++++++++++++++");
// return 0;
// }
qcCheckTaskProduce.setCreateTime(DateUtils.getNowDate());
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());

@ -2,19 +2,20 @@ package com.op.plan.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import com.op.common.core.utils.bean.BeanUtils;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
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.StringUtils;
import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.security.utils.SecurityUtils;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.plan.domain.dto.SplitOrderDTO;
import com.op.system.api.domain.DataSourcePropertyDTO;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -47,7 +48,11 @@ import org.springframework.web.multipart.MultipartFile;
public class ProOrderController extends BaseController {
@Autowired
private IProOrderService proOrderService;
@Resource
private DynamicDatasourceCreator dynamicDatasourceCreator;
@Resource
private DynamicRoutingDataSource dynamicRoutingDataSource;
/**
* Code
*
@ -309,4 +314,19 @@ public class ProOrderController 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();
}
}

@ -303,7 +303,12 @@ public class ProOrderServiceImpl implements IProOrderService {
workOrder.setProductName(productNameInfo.getProdDesc());
workOrder.setBelongWorkOrder(belongWorkOrder);
workOrder.setProdType(proOrder.getOrderType());
if("LJ88".equals(proOrder.getOrderType())){
workOrder.setProdType("LJ01");
}else{
workOrder.setProdType(proOrder.getOrderType());
}
// 将工单信息更新至数据库/**pro_order_workorder**/
proOrderWorkorderMapper.insertProOrderWorkorder(workOrder);

@ -116,12 +116,12 @@
#{workorderName}, '%')
</if>
<if test="orderId != null and orderId != ''">and pow.order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''">and pow.order_code like concat('%', #{orderCode}, '%')</if>
<if test="orderCode != null and orderCode != ''">and pow.workorder_code_sap like concat('%', #{orderCode}, '%')</if>
<if test="productCode != null and productCode != ''">
and ppow.product_code like concat('%', #{productCode},'%')
and pow.product_code like concat('%', #{productCode},'%')
</if>
<if test="productName != null and productName != ''">
and ppow.product_name like concat('%', #{productName},'%')
and pow.product_name like concat('%', #{productName},'%')
</if>
<if test="productDate != null ">and pow.product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''">and pow.shift_id = #{shiftId}</if>
@ -202,7 +202,7 @@
from pro_order_workorder pow
left join pro_order po on pow.order_code = po.order_code
where (pow.workorder_code = #{workorderId} or pow.workorder_id = #{workorderId})
and pow.del_flag = '0'
and pow.del_flag = '0'and po.del_flag = '0'
</select>
<select id="selectFirWorkOrder" parameterType="String" resultMap="ProOrderWorkorderResult">

@ -9,26 +9,27 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import com.baomidou.dynamic.datasource.annotation.DS;
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.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*;
import com.op.system.api.RemoteOpenService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysRole;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.quality.HRInfo;
import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.op.system.api.domain.sap.SapSupplier;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
@ -69,6 +70,10 @@ public class QcCheckTaskIncomeController extends BaseController {
@Autowired
private RemoteSapService remoteSapService;
@Resource
private DynamicDatasourceCreator dynamicDatasourceCreator;
@Resource
private DynamicRoutingDataSource dynamicRoutingDataSource;
/**
*
*/
@ -451,4 +456,20 @@ public class QcCheckTaskIncomeController extends BaseController {
List<QcCheckTaskIncome> list = qcCheckTaskIncomeService.getCkeckProjectXJList(qcCheckTaskIncome);
return getDataTable(list);
}
@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();
}
}

@ -76,6 +76,10 @@ public class QcUserMaterialController extends BaseController {
public AjaxResult getInfo(@PathVariable("userCode") String userCode) {
return success(qcUserMaterialService.selectUserByUserCode(userCode));
}
@GetMapping("/getInfoById/{id}")
public AjaxResult getInfoById(@PathVariable("id") String id) {
return success(qcUserMaterialService.selectQcUserMaterialById(id));
}
/**
*

@ -100,6 +100,7 @@ public class QcUserMaterial extends BaseEntity {
private String[] userCodes;
private String[] userNames;
private String[] attr1List;
private String label;
private String key;
@ -289,6 +290,14 @@ public class QcUserMaterial extends BaseEntity {
this.deptName = deptName;
}
public String[] getAttr1List() {
return attr1List;
}
public void setAttr1List(String[] attr1List) {
this.attr1List = attr1List;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -90,6 +90,8 @@ public interface QcCheckTaskIncomeMapper {
List<QcUserMaterialDTO> getUserByCheckType(String checkType);
List<QcUserMaterialDTO> getCheckUser(QcCheckTaskIncome qcCheckTaskIncome);
int addCheckUsers(@Param("list") List<QcUserMaterialDTO> users);
int addQcCheckTaskDefects(@Param("list") List<QcCheckTaskDefect> defects);

@ -22,10 +22,10 @@ public interface IQcUserMaterialService {
/**
*
*
* @param userCode
* @param id
* @return
*/
public QcUserMaterial selectQcUserMaterialById(String userCode);
public QcUserMaterial selectQcUserMaterialById(String id);
/**
*

@ -220,7 +220,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
qcCheckTaskIncome.setCheckManName("");
qcCheckTaskIncome.setCheckManCode("");
/**qc_user_material取默认检查人**/
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getUserByCheckType(qcCheckTaskIncome.getCheckType());
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getCheckUser(qcCheckTaskIncome);
if(CollectionUtils.isEmpty(users)){
QcUserMaterialDTO dto0 = new QcUserMaterialDTO();
dto0.setId(IdUtils.fastSimpleUUID());
@ -705,8 +705,8 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
n = qcCheckUnqualifiedMapper.repeatCheckTask(recheck);
logger.info("复检表qc_check_task:" + n);
n = qcCheckUnqualifiedMapper.repeatCheckTaskDefect(recheck);
logger.info("复检表qc_check_task_defect:" + n);
// n = qcCheckUnqualifiedMapper.repeatCheckTaskDefect(recheck);
// logger.info("复检表qc_check_task_defect:" + n);
n = qcCheckUnqualifiedMapper.repeatCheckTaskDetail(recheck);
logger.info("复检表qc_check_task_detail:" + n);

@ -40,13 +40,13 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
/**
*
*
* @param userCode
* @param id
* @return
*/
@Override
@DS("#header.poolName")
public QcUserMaterial selectQcUserMaterialById(String userCode) {
return qcUserMaterialMapper.selectQcUserMaterialById(userCode);
public QcUserMaterial selectQcUserMaterialById(String id) {
return qcUserMaterialMapper.selectQcUserMaterialById(id);
}
@Override
@ -54,7 +54,6 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
return qcUserMaterialMapper.selectUserByUserCode(userCode);
}
/**
*
*
@ -199,6 +198,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
String[] userCodes = qcUserMaterial.getUserCodes();
String[] userNames = qcUserMaterial.getUserNames();
String[] attr1List = qcUserMaterial.getAttr1List();
String materialCode = qcUserMaterial.getMaterialCode();
String materialName = qcUserMaterial.getMaterialName();
String user = SecurityUtils.getUsername();
@ -210,6 +210,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
qcUserMaterialDto.setCreateBy(user);
qcUserMaterialDto.setUserCode(userCodes[i]);
qcUserMaterialDto.setUserName(userNames[i]);
qcUserMaterialDto.setAttr1(attr1List[i]);
qcUserMaterialDto.setMaterialCode(materialCode);
qcUserMaterialDto.setMaterialName(materialName);
qcUserMaterialDto.setFactoryCode(factoryCode);

@ -172,6 +172,7 @@
left join pro_order_workorder pow on powb.workorder_id = pow.workorder_id
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{workorderCode}
order by powb.batch_code
</select>
<select id="getTypeCode" resultType="java.lang.String">
select type_code from qc_check_type where order_code = #{checkType}
@ -351,6 +352,16 @@
where material_code = #{checkType} and del_flag = '0'
</select>
<select id="getCheckUser" resultType="com.op.system.api.domain.quality.QcUserMaterialDTO">
select user_code userCode,
user_name userName
from qc_user_material
where material_code = #{checkType} and del_flag = '0'
<if test = "orderType!=null">
and attr1 = #{orderType}
</if>
</select>
<select id="getCkeckDefectList" resultType="com.op.quality.domain.QcCheckTaskDefect">
select
qctd.defect_code defectCode,

@ -135,7 +135,6 @@
update_by,
update_time,
factory_code,
del_flag,
belong_to
)
values
@ -154,7 +153,6 @@
#{item.updateBy},
#{item.updateTime},
#{item.factoryCode},
#{item.delFlag},
#{item.belongTo}
)
</foreach>

@ -228,13 +228,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
record_id,belong_to,order_num,rule_name,property_code,
check_mode,check_tool,unit_code,check_standard,actual_value,
create_by,create_time,factory_code,del_flag,
project_id,project_no,type_project_id,defect_code
project_id,project_no,type_project_id,defect_code,status
)
select
REPLACE(NEWID(), '-',''),#{belongTo},order_num,rule_name,property_code,
check_mode,check_tool,unit_code,check_standard,actual_value,
#{createBy},#{createTime},factory_code,del_flag,
project_id,project_no,type_project_id,defect_code
project_id,project_no,type_project_id,defect_code,'Y'
from qc_check_task_detail where belong_to = #{oldBelongTo} and del_flag = '0'
</insert>
<insert id="repeatCheckTaskUser">

@ -275,6 +275,10 @@
<if test="checkType != null and checkType != ''">and qct.check_type = #{checkType}</if>
<if test="checkManCode != null and checkManCode != ''">and qctu.check_man_code = #{checkManCode}</if>
<if test="checkStatus != null and checkStatus != ''">and qct.check_status in (${checkStatus})</if>
and (
CONVERT(varchar(10),qct.create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
or CONVERT(varchar(10),qct.create_time, 120) = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120)
)
</where>
order by qct.create_time desc
</select>

@ -114,7 +114,7 @@
</if>
</select>
<select id="getSelectedUsers" resultMap="QcUserMaterialResult">
select qum.user_code, qum.user_name
select qum.id, qum.user_code, qum.user_name, qum.attr1
from qc_user_material qum
where qum.del_flag = '0' and qum.material_code = #{materialCode}
</select>

@ -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<String, Object> 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();
}
}

@ -76,4 +76,6 @@ public interface SysDatasourceMapper {
List<SysDatasource> selectDBListByDept(SysDatasource qo);
void deletUserDB(String userCode);
void deleteUserByIds(String[] ids);
}

@ -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 "数据库链接异常,请检查数据库基本信息。";

@ -592,14 +592,14 @@ public class SysUserServiceImpl implements ISysUserService {
int n = 0;
//sap返回的供应商编码
List<String> codes = dtos.stream().map(HRInfo::getUserCode).collect(Collectors.toList());
List<String> codes = dtos.stream().map(HRInfo::getUserName).collect(Collectors.toList());
//sap返回的工作中心编码-本地已存在
List<String> exsitCodes = userMapper.getExsitCodes(codes);
//sap返回的工作中心编码-本地不存在// 差集 (list2 - list1)
List<String> noExsitCodes = codes.stream().filter(item -> !exsitCodes.contains(item)).collect(Collectors.toList());
List<HRInfo> 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<HRInfo> adds = dtos.stream()
.filter(item -> noExsitCodes.contains(item.getUserCode()))
.filter(item -> noExsitCodes.contains(item.getUserName()))
.collect(Collectors.toList());
if(!CollectionUtils.isEmpty(adds)){

@ -193,4 +193,10 @@
<delete id="deletUserDB">
delete from sys_user_datasource where user_id =#{userCode}
</delete>
<delete id="deleteUserByIds">
delete from sys_user_datasource where datasource_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -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}
</foreach>
</update>

@ -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();
}
}

@ -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();
}
}

@ -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<OdsProductEmbryoInventory> 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<OdsProductEmbryoInventory> list = odsProductEmbryoInventoryService.selectOdsProductEmbryoInventoryList(odsProductEmbryoInventory);
ExcelUtil<OdsProductEmbryoInventory> util = new ExcelUtil<OdsProductEmbryoInventory>(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));
}
}

@ -44,6 +44,16 @@ public class WmsFpStorageNewsSnController extends BaseController {
List<WmsFpStorageNewsSn> list = wmsFpStorageNewsSnService.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/listunt")
public TableDataInfo listunt(WmsFpStorageNewsSn wmsFpStorageNewsSn) {
startPage();
List<WmsFpStorageNewsSn> list = wmsFpStorageNewsSnService.selectWmsFpStorageNewsSnListunt(wmsFpStorageNewsSn);
return getDataTable(list);
}
/**
*

@ -136,4 +136,6 @@ public class WmsProductPutController extends BaseController {
String rlist = wmsProductPutService.addReportListSap(mesReportWork);
return AjaxResult.success(rlist);
}
}

@ -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<WmsRuturnPutEmbryo> 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<WmsRuturnPutEmbryo> list = wmsRuturnPutEmbryoService.selectWmsRuturnPutEmbryoList(wmsRuturnPutEmbryo);
// ExcelUtil<WmsRuturnPutEmbryo> util = new ExcelUtil<WmsRuturnPutEmbryo>(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));
// }
}

@ -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<EquBindAuxiliaryEquipment> 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() {

@ -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

@ -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();
}
}

@ -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
*/

@ -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<OdsProductEmbryoInventory> 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);
}

@ -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);
}

@ -14,4 +14,11 @@ public interface WmsRuturnPutEmbryoMapper {
WmsRuturnPutEmbryo selectWmsRuturnPutEmbryoByid(WmsRuturnPutEmbryo wmsRuturnPutEmbryo1);
void insertWmsRuturnPutEmbryoMapperRecords(WmsRuturnPutEmbryo wmsProductPutRecords);
/**
* 退
*
* @param wmsRuturnPutEmbryo 退
* @return 退
*/
public List<WmsRuturnPutEmbryo> selectWmsRuturnPutEmbryoList(WmsRuturnPutEmbryo wmsRuturnPutEmbryo);
}

@ -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<OdsProductEmbryoInventory> 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);
}

@ -60,4 +60,5 @@ public interface IWmsFpStorageNewsSnService {
public int deleteWmsFpStorageNewsSnByStorageId(String storageId);
List<WmsFpStorageNewsSn> selectWmsFpStorageNewsSnListunt(WmsFpStorageNewsSn wmsFpStorageNewsSn);
}

@ -126,4 +126,6 @@ public interface IWmsProductPutService {
WmsFpStorageNewsSn palletScanning(WmsFpStorageNewsSn wmsFpStorageNewsSn);
String palletTransferConfirmation(WmsFpStorageNewsSn wmsFpStorageNewsSn);
List<WmsRuturnPutEmbryo> selectWmsRuturnPutEmbryoList(WmsRuturnPutEmbryo wmsRuturnPutEmbryo);
}

@ -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<OdsProductEmbryoInventory> 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);
}
}

@ -91,4 +91,16 @@ public class WmsFpStorageNewsSnServiceImpl implements IWmsFpStorageNewsSnService
public int deleteWmsFpStorageNewsSnByStorageId(String storageId) {
return wmsFpStorageNewsSnMapper.deleteWmsFpStorageNewsSnByStorageId(storageId);
}
@Override
@DS("#header.poolName")
public List<WmsFpStorageNewsSn> selectWmsFpStorageNewsSnListunt(WmsFpStorageNewsSn wmsFpStorageNewsSn) {
List<WmsFpStorageNewsSn> wmsFpStorageNewsSnList= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn);
for ( WmsFpStorageNewsSn wmsFpStorageNewsSn1 :
wmsFpStorageNewsSnList ) {
String unit= wmsFpStorageNewsSnMapper.selectwmsFpStorageNews(wmsFpStorageNewsSn1);
wmsFpStorageNewsSn1.setUnit(unit);
}
return wmsFpStorageNewsSnList;
}
}

@ -697,8 +697,8 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
String results="提单成功";
DynamicDataSourceContextHolder.push("ds_" + wmsSellOutEmbryo.getFactoryCode());
Map<String, Object> 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<WmsRuturnPutEmbryo> selectWmsRuturnPutEmbryoList(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) {
return wmsRuturnPutEmbryoMapper.selectWmsRuturnPutEmbryoList(wmsRuturnPutEmbryo);
}
}

@ -56,6 +56,7 @@
<result property="unitMeasurement" column="unit_measurement"/>
<result property="sapCode" column="sap_code"/>
<result property="sapName" column="sap_name"/>
<result property="factoryWorkshop" column="factory_workshop"/>
</resultMap>
<resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult">
@ -178,63 +179,43 @@
inventory_number,
unit_measurement,
sap_code,
sap_name
sap_name,
factory_workshop
from base_equipment
</sql>
<select id="selectBaseEquipmentList" parameterType="BaseEquipment" resultMap="BaseEquipmentResult">
<include refid="selectBaseEquipmentVo"/>
<where>
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code like concat('%',
#{equipmentCode}, '%')
</if>
<if test="equipmentName != null and equipmentName != ''">and equipment_name like concat('%',
#{equipmentName}, '%')
</if>
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code like concat('%',#{equipmentCode}, '%')</if>
<if test="equipmentName != null and equipmentName != ''">and equipment_name like concat('%',#{equipmentName}, '%')</if>
<if test="equipmentBrand != null and equipmentBrand != ''">and equipment_brand = #{equipmentBrand}</if>
<if test="equipmentSpec != null and equipmentSpec != ''">and equipment_spec = #{equipmentSpec}</if>
<if test="equipmentTypeId != null ">and equipment_type_id = #{equipmentTypeId}</if>
<if test="equipmentTypeCode != null and equipmentTypeCode != ''">and equipment_type_code like concat('%',
#{equipmentTypeCode}, '%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">and equipment_type_name like concat('%',
#{equipmentTypeName}, '%')
</if>
<if test="equipmentTypeCode != null and equipmentTypeCode != ''">and equipment_type_code like concat('%',#{equipmentTypeCode}, '%')</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">and equipment_type_name like concat('%',#{equipmentTypeName}, '%')</if>
<if test="workshopId != null ">and workshop_id = #{workshopId}</if>
<if test="workshopCode != null and workshopCode != ''">and workshop_code = #{workshopCode}</if>
<if test="workshopName != null and workshopName != ''">and workshop_name like concat('%', #{workshopName},
'%')
</if>
<if test="workshopName != null and workshopName != ''">and workshop_name like concat('%', #{workshopName},'%')</if>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
<if test="attr3 != null ">and attr3 = #{attr3}</if>
<if test="attr4 != null ">and attr4 = #{attr4}</if>
<if test="unitWorkingHours != null and unitWorkingHours != ''">and unit_working_hours =
#{unitWorkingHours}
</if>
<if test="unitWorkingHours != null and unitWorkingHours != ''">and unit_working_hours = #{unitWorkingHours}</if>
<if test="workshopSection != null and workshopSection != ''">and workshop_section = #{workshopSection}</if>
<if test="equipmentLocation != null and equipmentLocation != ''">and equipment_location =
#{equipmentLocation}
</if>
<if test="hourlyUnitPrice != null and hourlyUnitPrice != ''">and hourly_unit_price = #{hourlyUnitPrice}
</if>
<if test="equipmentLocation != null and equipmentLocation != ''">and equipment_location = #{equipmentLocation}</if>
<if test="hourlyUnitPrice != null and hourlyUnitPrice != ''">and hourly_unit_price = #{hourlyUnitPrice}</if>
<if test="plcIp != null and plcIp != ''">and plc_ip = #{plcIp}</if>
<if test="plcPort != null and plcPort != ''">and plc_port = #{plcPort}</if>
<if test="equipmentHead != null and equipmentHead != ''">and equipment_head = #{equipmentHead}</if>
<if test="equipmentBarcode != null and equipmentBarcode != ''">and equipment_barcode =
#{equipmentBarcode}
</if>
<if test="equipmentBarcodeImage != null and equipmentBarcodeImage != ''">and equipment_barcode_image =
#{equipmentBarcodeImage}
</if>
<if test="equipmentBarcode != null and equipmentBarcode != ''">and equipment_barcode = #{equipmentBarcode}</if>
<if test="equipmentBarcodeImage != null and equipmentBarcodeImage != ''">and equipment_barcode_image = #{equipmentBarcodeImage}</if>
<if test="manufacturer != null and manufacturer != ''">and manufacturer = #{manufacturer}</if>
<if test="supplier != null and supplier != ''">and supplier = #{supplier}</if>
<if test="useLife != null and useLife != ''">and use_life = #{useLife}</if>
<if test="buyTime != null ">and buy_time = #{buyTime}</if>
<if test="assetOriginalValue != null and assetOriginalValue != ''">and asset_original_value =
#{assetOriginalValue}
</if>
<if test="assetOriginalValue != null and assetOriginalValue != ''">and asset_original_value = #{assetOriginalValue}</if>
<if test="netAssetValue != null and netAssetValue != ''">and net_asset_value = #{netAssetValue}</if>
<if test="assetHead != null and assetHead != ''">and asset_head = #{assetHead}</if>
<if test="fixedAssetCode != null and fixedAssetCode != ''">and fixed_asset_code = #{fixedAssetCode}</if>
@ -242,20 +223,15 @@
<if test="sapAsset != null and sapAsset != ''">and sap_asset = #{sapAsset}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="equipmentStatus != null and equipmentStatus != ''">and equipment_status = #{equipmentStatus}</if>
<if test="equipmentCategory != null and equipmentCategory != ''">and equipment_category =
#{equipmentCategory}
</if>
<if test="assetClassificationName != null and assetClassificationName != ''">and asset_classification_name
= #{assetClassificationName}
</if>
<if test="assetDescription != null and assetDescription != ''">and asset_description =
#{assetDescription}
</if>
<if test="equipmentCategory != null and equipmentCategory != ''">and equipment_category = #{equipmentCategory}</if>
<if test="assetClassificationName != null and assetClassificationName != ''">and asset_classification_name = #{assetClassificationName}</if>
<if test="assetDescription != null and assetDescription != ''">and asset_description = #{assetDescription}</if>
<if test="equipmentNumber != null and equipmentNumber != ''">and equipment_number = #{equipmentNumber}</if>
<if test="inventoryNumber != null and inventoryNumber != ''">and inventory_number = #{inventoryNumber}</if>
<if test="unitMeasurement != null and unitMeasurement != ''">and unit_measurement = #{unitMeasurement}</if>
<if test="sapCode != null and sapCode != ''">and sap_code = #{sapCode}</if>
<if test="sapName != null and sapName != ''">and sap_name = #{sapName}</if>
<if test="factoryWorkshop != null and factoryWorkshop != ''">and factory_workshop like concat('%', #{factoryWorkshop},'%')</if>
and del_flag ='0'
</where>
</select>
@ -325,6 +301,7 @@
<if test="unitMeasurement != null">unit_measurement,</if>
<if test="sapCode != null">sap_code,</if>
<if test="sapName != null">sap_name,</if>
<if test="factoryWorkshop != null">factory_workshop,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
@ -369,21 +346,21 @@
<if test="factoryCode != null">#{factoryCode},</if>
<if test="equipmentStatus != null">#{equipmentStatus},</if>
<if test="equipmentCategory != null">#{equipmentCategory},</if>
<if test="assetClassificationName != null and assetClassificationName != ''">#{assetClassificationName},
</if>
<if test="assetClassificationName != null and assetClassificationName != ''">#{assetClassificationName},</if>
<if test="assetDescription != null and assetDescription != ''">#{assetDescription},</if>
<if test="equipmentNumber != null and equipmentNumber != ''">#{equipmentNumber},</if>
<if test="inventoryNumber != null and inventoryNumber != ''">#{inventoryNumber},</if>
<if test="unitMeasurement != null and unitMeasurement != ''">#{unitMeasurement},</if>
<if test="sapCode != null and sapCode != ''">#{sapCode},</if>
<if test="sapName != null and sapName != ''">#{sapName},</if>
<if test="factoryWorkshop != null and factoryWorkshop != ''">#{factoryWorkshop},</if>
</trim>
</insert>
<update id="updateBaseEquipment" parameterType="BaseEquipment">
update base_equipment
<trim prefix="SET" suffixOverrides=",">
<if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if>
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
<if test="equipmentName != null">equipment_name = #{equipmentName},</if>
<if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if>
<if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if>
@ -403,15 +380,12 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="unitWorkingHours != null and unitWorkingHours != ''">unit_working_hours = #{unitWorkingHours},
</if>
<if test="workshopSection != null and workshopSection != ''">workshop_section = #{workshopSection},</if>
<if test="equipmentLocation != null and equipmentLocation != ''">equipment_location =
#{equipmentLocation},
</if>
<if test="hourlyUnitPrice != null and hourlyUnitPrice != ''">hourly_unit_price = #{hourlyUnitPrice},</if>
<if test="plcIp != null and plcIp != ''">plc_ip = #{plcIp},</if>
<if test="plcPort != null and plcPort != ''">plc_port = #{plcPort},</if>
<if test="unitWorkingHours != null ">unit_working_hours = #{unitWorkingHours},</if>
<if test="workshopSection != null">workshop_section = #{workshopSection},</if>
<if test="equipmentLocation != null">equipment_location = #{equipmentLocation},</if>
<if test="hourlyUnitPrice != null">hourly_unit_price = #{hourlyUnitPrice},</if>
<if test="plcIp != null">plc_ip = #{plcIp},</if>
<if test="plcPort != null">plc_port = #{plcPort},</if>
<if test="equipmentBarcode != null">equipment_barcode = #{equipmentBarcode},</if>
<if test="equipmentBarcodeImage != null">equipment_barcode_image = #{equipmentBarcodeImage},</if>
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
@ -428,16 +402,14 @@
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="equipmentStatus != null">equipment_status = #{equipmentStatus},</if>
<if test="equipmentCategory != null">equipment_category = #{equipmentCategory},</if>
<if test="assetClassificationName != null and assetClassificationName != ''">asset_classification_name =
#{assetClassificationName},
</if>
<if test="assetDescription != null and assetDescription != ''">asset_description = #{assetDescription},
</if>
<if test="equipmentNumber != null and equipmentNumber != ''">equipment_number = #{equipmentNumber},</if>
<if test="inventoryNumber != null and inventoryNumber != ''">inventory_number = #{inventoryNumber},</if>
<if test="unitMeasurement != null and unitMeasurement != ''">unit_measurement = #{unitMeasurement},</if>
<if test="sapCode != null and sapCode != ''">sap_code = #{sapCode},</if>
<if test="sapName != null and sapName != ''">sap_name = #{sapName},</if>
<if test="assetClassificationName != null">asset_classification_name = #{assetClassificationName},</if>
<if test="assetDescription != null">asset_description = #{assetDescription},</if>
<if test="equipmentNumber != null">equipment_number = #{equipmentNumber},</if>
<if test="inventoryNumber != null">inventory_number = #{inventoryNumber},</if>
<if test="unitMeasurement != null">unit_measurement = #{unitMeasurement},</if>
<if test="sapCode != null">sap_code = #{sapCode},</if>
<if test="sapName != null">sap_name = #{sapName},</if>
<if test="factoryWorkshop != null">factory_workshop = #{factoryWorkshop},</if>
</trim>
where equipment_id = #{equipmentId}
</update>

@ -0,0 +1,375 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.OdsProductEmbryoInventoryMapper">
<resultMap type="OdsProductEmbryoInventory" id="OdsProductEmbryoInventoryResult">
<result property="siteCode" column="Site_code"/>
<result property="ID" column="ID"/>
<result property="orderCode" column="Order_Code"/>
<result property="materialCode" column="Material_Code"/>
<result property="materialDesc" column="Material_Desc"/>
<result property="planDate" column="Plan_Date"/>
<result property="locNumber" column="Loc_Number"/>
<result property="Unit" column="Unit"/>
<result property="realityNumber" column="Reality_Number"/>
<result property="orderStatus" column="Order_Status"/>
<result property="userDefined1" column="User_Defined1"/>
<result property="locCode" column="Loc_Code"/>
<result property="userDefined2" column="User_Defined2"/>
<result property="userDefined3" column="User_Defined3"/>
<result property="userDefined4" column="User_Defined4"/>
<result property="userDefined5" column="User_Defined5"/>
<result property="userDefined6" column="User_Defined6"/>
<result property="userDefined7" column="User_Defined7"/>
<result property="userDefined8" column="User_Defined8"/>
<result property="userDefined9" column="User_Defined9"/>
<result property="userDefined10" column="User_Defined10"/>
<result property="userDefined11" column="User_Defined11"/>
<result property="Remark" column="Remark"/>
<result property="createBy" column="Create_By"/>
<result property="createDate" column="Create_Date"/>
<result property="lastUpdateBy" column="Last_Update_By"/>
<result property="lastUpdateDate" column="Last_Update_Date"/>
<result property="Active" column="Active"/>
<result property="enterpriseId" column="Enterprise_Id"/>
<result property="enterpriseCode" column="Enterprise_Code"/>
</resultMap>
<sql id="selectOdsProductEmbryoInventoryVo">
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
</sql>
<select id="selectOdsProductEmbryoInventoryList" parameterType="OdsProductEmbryoInventory" resultMap="OdsProductEmbryoInventoryResult">
<include refid="selectOdsProductEmbryoInventoryVo"/>
<where>
<if test="siteCode != null and siteCode != ''">
and Site_code = #{siteCode}
</if>
<if test="orderCode != null and orderCode != ''">
and Order_Code = #{orderCode}
</if>
<if test="materialCode != null and materialCode != ''">
and Material_Code = #{materialCode}
</if>
<if test="materialDesc != null and materialDesc != ''">
and Material_Desc = #{materialDesc}
</if>
<if test="planDate != null ">
and Plan_Date = #{planDate}
</if>
<if test="locNumber != null ">
and Loc_Number = #{locNumber}
</if>
<if test="Unit != null and Unit != ''">
and Unit = #{Unit}
</if>
<if test="realityNumber != null ">
and Reality_Number = #{realityNumber}
</if>
<if test="orderStatus != null and orderStatus != ''">
and Order_Status = #{orderStatus}
</if>
<if test="userDefined1 != null and userDefined1 != ''">
and User_Defined1 = #{userDefined1}
</if>
<if test="locCode != null and locCode != ''">
and Loc_Code = #{locCode}
</if>
<if test="userDefined2 != null and userDefined2 != ''">
and User_Defined2 = #{userDefined2}
</if>
<if test="userDefined3 != null and userDefined3 != ''">
and User_Defined3 = #{userDefined3}
</if>
<if test="userDefined4 != null and userDefined4 != ''">
and User_Defined4 = #{userDefined4}
</if>
<if test="userDefined5 != null and userDefined5 != ''">
and User_Defined5 = #{userDefined5}
</if>
<if test="userDefined6 != null and userDefined6 != ''">
and User_Defined6 = #{userDefined6}
</if>
<if test="userDefined7 != null and userDefined7 != ''">
and User_Defined7 = #{userDefined7}
</if>
<if test="userDefined8 != null and userDefined8 != ''">
and User_Defined8 = #{userDefined8}
</if>
<if test="userDefined9 != null and userDefined9 != ''">
and User_Defined9 = #{userDefined9}
</if>
<if test="userDefined10 != null and userDefined10 != ''">
and User_Defined10 = #{userDefined10}
</if>
<if test="userDefined11 != null and userDefined11 != ''">
and User_Defined11 = #{userDefined11}
</if>
<if test="Remark != null and Remark != ''">
and Remark = #{Remark}
</if>
<if test="createBy != null and createBy != ''">
and Create_By = #{createBy}
</if>
<if test="createDate != null ">
and Create_Date = #{createDate}
</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''">
and Last_Update_By = #{lastUpdateBy}
</if>
<if test="lastUpdateDate != null ">
and Last_Update_Date = #{lastUpdateDate}
</if>
<if test="Active != null and Active != ''">
and Active = #{Active}
</if>
<if test="enterpriseId != null and enterpriseId != ''">
and Enterprise_Id = #{enterpriseId}
</if>
<if test="enterpriseCode != null and enterpriseCode != ''">
and Enterprise_Code = #{enterpriseCode}
</if>
</where>
</select>
<select id="selectOdsProductEmbryoInventoryByID" parameterType="String"
resultMap="OdsProductEmbryoInventoryResult">
<include refid="selectOdsProductEmbryoInventoryVo"/>
where ID = #{ID}
</select>
<insert id="insertOdsProductEmbryoInventory" parameterType="OdsProductEmbryoInventory">
insert into ods_product_embryo_inventory
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteCode != null">Site_code,
</if>
<if test="ID != null">ID,
</if>
<if test="orderCode != null">Order_Code,
</if>
<if test="materialCode != null">Material_Code,
</if>
<if test="materialDesc != null">Material_Desc,
</if>
<if test="planDate != null">Plan_Date,
</if>
<if test="locNumber != null">Loc_Number,
</if>
<if test="Unit != null">Unit,
</if>
<if test="realityNumber != null">Reality_Number,
</if>
<if test="orderStatus != null">Order_Status,
</if>
<if test="userDefined1 != null">User_Defined1,
</if>
<if test="locCode != null">Loc_Code,
</if>
<if test="userDefined2 != null">User_Defined2,
</if>
<if test="userDefined3 != null">User_Defined3,
</if>
<if test="userDefined4 != null">User_Defined4,
</if>
<if test="userDefined5 != null">User_Defined5,
</if>
<if test="userDefined6 != null">User_Defined6,
</if>
<if test="userDefined7 != null">User_Defined7,
</if>
<if test="userDefined8 != null">User_Defined8,
</if>
<if test="userDefined9 != null">User_Defined9,
</if>
<if test="userDefined10 != null">User_Defined10,
</if>
<if test="userDefined11 != null">User_Defined11,
</if>
<if test="Remark != null">Remark,
</if>
<if test="createBy != null">Create_By,
</if>
<if test="createDate != null">Create_Date,
</if>
<if test="lastUpdateBy != null">Last_Update_By,
</if>
<if test="lastUpdateDate != null">Last_Update_Date,
</if>
<if test="Active != null">Active,
</if>
<if test="enterpriseId != null">Enterprise_Id,
</if>
<if test="enterpriseCode != null">Enterprise_Code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteCode != null">#{siteCode},
</if>
<if test="ID != null">#{ID},
</if>
<if test="orderCode != null">#{orderCode},
</if>
<if test="materialCode != null">#{materialCode},
</if>
<if test="materialDesc != null">#{materialDesc},
</if>
<if test="planDate != null">#{planDate},
</if>
<if test="locNumber != null">#{locNumber},
</if>
<if test="Unit != null">#{Unit},
</if>
<if test="realityNumber != null">#{realityNumber},
</if>
<if test="orderStatus != null">#{orderStatus},
</if>
<if test="userDefined1 != null">#{userDefined1},
</if>
<if test="locCode != null">#{locCode},
</if>
<if test="userDefined2 != null">#{userDefined2},
</if>
<if test="userDefined3 != null">#{userDefined3},
</if>
<if test="userDefined4 != null">#{userDefined4},
</if>
<if test="userDefined5 != null">#{userDefined5},
</if>
<if test="userDefined6 != null">#{userDefined6},
</if>
<if test="userDefined7 != null">#{userDefined7},
</if>
<if test="userDefined8 != null">#{userDefined8},
</if>
<if test="userDefined9 != null">#{userDefined9},
</if>
<if test="userDefined10 != null">#{userDefined10},
</if>
<if test="userDefined11 != null">#{userDefined11},
</if>
<if test="Remark != null">#{Remark},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createDate != null">#{createDate},
</if>
<if test="lastUpdateBy != null">#{lastUpdateBy},
</if>
<if test="lastUpdateDate != null">#{lastUpdateDate},
</if>
<if test="Active != null">#{Active},
</if>
<if test="enterpriseId != null">#{enterpriseId},
</if>
<if test="enterpriseCode != null">#{enterpriseCode},
</if>
</trim>
</insert>
<update id="updateOdsProductEmbryoInventory" parameterType="OdsProductEmbryoInventory">
update ods_product_embryo_inventory
<trim prefix="SET" suffixOverrides=",">
<if test="siteCode != null">Site_code =
#{siteCode},
</if>
<if test="orderCode != null">Order_Code =
#{orderCode},
</if>
<if test="materialCode != null">Material_Code =
#{materialCode},
</if>
<if test="materialDesc != null">Material_Desc =
#{materialDesc},
</if>
<if test="planDate != null">Plan_Date =
#{planDate},
</if>
<if test="locNumber != null">Loc_Number =
#{locNumber},
</if>
<if test="Unit != null">Unit =
#{Unit},
</if>
<if test="realityNumber != null">Reality_Number =
#{realityNumber},
</if>
<if test="orderStatus != null">Order_Status =
#{orderStatus},
</if>
<if test="userDefined1 != null">User_Defined1 =
#{userDefined1},
</if>
<if test="locCode != null">Loc_Code =
#{locCode},
</if>
<if test="userDefined2 != null">User_Defined2 =
#{userDefined2},
</if>
<if test="userDefined3 != null">User_Defined3 =
#{userDefined3},
</if>
<if test="userDefined4 != null">User_Defined4 =
#{userDefined4},
</if>
<if test="userDefined5 != null">User_Defined5 =
#{userDefined5},
</if>
<if test="userDefined6 != null">User_Defined6 =
#{userDefined6},
</if>
<if test="userDefined7 != null">User_Defined7 =
#{userDefined7},
</if>
<if test="userDefined8 != null">User_Defined8 =
#{userDefined8},
</if>
<if test="userDefined9 != null">User_Defined9 =
#{userDefined9},
</if>
<if test="userDefined10 != null">User_Defined10 =
#{userDefined10},
</if>
<if test="userDefined11 != null">User_Defined11 =
#{userDefined11},
</if>
<if test="Remark != null">Remark =
#{Remark},
</if>
<if test="createBy != null">Create_By =
#{createBy},
</if>
<if test="createDate != null">Create_Date =
#{createDate},
</if>
<if test="lastUpdateBy != null">Last_Update_By =
#{lastUpdateBy},
</if>
<if test="lastUpdateDate != null">Last_Update_Date =
#{lastUpdateDate},
</if>
<if test="Active != null">Active =
#{Active},
</if>
<if test="enterpriseId != null">Enterprise_Id =
#{enterpriseId},
</if>
<if test="enterpriseCode != null">Enterprise_Code =
#{enterpriseCode},
</if>
</trim>
where ID = #{ID}
</update>
<delete id="deleteOdsProductEmbryoInventoryByID" parameterType="String">
delete from ods_product_embryo_inventory where ID = #{ID}
</delete>
<delete id="deleteOdsProductEmbryoInventoryByIDs" parameterType="String">
delete from ods_product_embryo_inventory where ID in
<foreach item="ID" collection="array" open="(" separator="," close=")">
#{ID}
</foreach>
</delete>
</mapper>

@ -253,4 +253,8 @@
set user_defined2 = COALESCE(user_defined2, 0) + 1
where sn=#{sn} and active_flag='1'
</update>
<select id="selectwmsFpStorageNews" resultType="java.lang.String">
select DISTINCT user_defined1 from wms_fp_storage_news where product_code=#{productCode} and active_flag='1'
</select>
</mapper>

@ -221,4 +221,95 @@
<if test="activeFlag != null">#{activeFlag},</if>
</trim>
</insert>
<sql id="selectWmsRuturnPutEmbryoVo">
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
</sql>
<select id="selectWmsRuturnPutEmbryoList" parameterType="WmsRuturnPutEmbryo" resultMap="WmsRuturnPutEmbryoResult">
<include refid="selectWmsRuturnPutEmbryoVo"/>
<where>
<if test="factoryCode != null and factoryCode != ''">
and factory_code = #{factoryCode}
</if>
<if test="productOrder != null and productOrder != ''">
and product_order = #{productOrder}
</if>
<if test="whCode != null and whCode != ''">
and wh_code = #{whCode}
</if>
<if test="waCode != null and waCode != ''">
and wa_code = #{waCode}
</if>
<if test="wlCode != null and wlCode != ''">
and wl_code = #{wlCode}
</if>
<if test="productName != null and productName != ''">
and product_name like concat('%', #{productName}, '%')
</if>
<if test="productCode != null and productCode != ''">
and product_code = #{productCode}
</if>
<if test="productSort != null and productSort != ''">
and product_sort = #{productSort}
</if>
<if test="speciFication != null and speciFication != ''">
and specification = #{speciFication}
</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">
and unit_of_measure = #{unitOfMeasure}
</if>
<if test="planQuantity != null ">
and plan_quantity = #{planQuantity}
</if>
<if test="putQuantity != null ">
and put_quantity = #{putQuantity}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="sapStatus != null and sapStatus != ''">
and SAP_status = #{sapStatus}
</if>
<if test="sapProof != null and sapProof != ''">
and SAP_proof = #{sapProof}
</if>
<if test="sapMessage != null and sapMessage != ''">
and SAP_message = #{sapMessage}
</if>
<if test="putDate != null ">
and put_date = #{putDate}
</if>
<if test="attr1 != null and attr1 != ''">
and attr1 = #{attr1}
</if>
<if test="attr2 != null and attr2 != ''">
and attr2 = #{attr2}
</if>
<if test="attr3 != null and attr3 != ''">
and attr3 = #{attr3}
</if>
<if test="attr4 != null and attr4 != ''">
and attr4 = #{attr4}
</if>
<if test="attr5 != null and attr5 != ''">
and attr5 = #{attr5}
</if>
<if test="attr6 != null and attr6 != ''">
and attr6 = #{attr6}
</if>
<if test="attr7 != null and attr7 != ''">
and attr7 = #{attr7}
</if>
<if test="attr8 != null and attr8 != ''">
and attr8 = #{attr8}
</if>
<if test="attr9 != null and attr9 != ''">
and attr9 = #{attr9}
</if>
<if test="attr10 != null and attr10 != ''">
and attr10 = #{attr10}
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save