diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsOdsWhiteEmbryoInController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsOdsWhiteEmbryoInController.java new file mode 100644 index 00000000..e60ff1a7 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsOdsWhiteEmbryoInController.java @@ -0,0 +1,104 @@ +package com.op.wms.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +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.WmsOdsWhiteEmbryoIn; +import com.op.wms.service.IWmsOdsWhiteEmbryoInService; +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 2023-07-20 + */ +@RestController +@RequestMapping("/wmsEmbryoin") +public class WmsOdsWhiteEmbryoInController extends BaseController { + @Autowired + private IWmsOdsWhiteEmbryoInService wmsOdsWhiteEmbryoInService; + + /** + * 查询白胚入库单列表 + */ + @RequiresPermissions("wms:wmsEmbryoin:list") + @GetMapping("/list") + public TableDataInfo list(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { + startPage(); + List list = wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInList(wmsOdsWhiteEmbryoIn); + return getDataTable(list); + } + + /** + * 导出白胚入库单列表 + */ + @RequiresPermissions("wms:wmsEmbryoin:export") + @Log(title = "白胚入库单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { + List list = wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInList(wmsOdsWhiteEmbryoIn); + ExcelUtil util = new ExcelUtil(WmsOdsWhiteEmbryoIn.class); + util.exportExcel(response, list, "白胚入库单数据"); + } + + /** + * 获取白胚入库单详细信息 + */ + @RequiresPermissions("wms:wmsEmbryoin:query") + @GetMapping(value = "/{ID}") + public AjaxResult getInfo(@PathVariable("ID") String ID) { + return success(wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInByID(ID)); + } + + /** + * 新增白胚入库单 + */ + @PostMapping("/add") + public AjaxResult add(@RequestBody List wmsOdsWhiteEmbryoIns) { + return toAjax(wmsOdsWhiteEmbryoInService.insertWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIns)); + } + + /** + * 修改白胚入库单 + */ + @RequiresPermissions("wms:wmsEmbryoin:edit") + @Log(title = "白胚入库单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { + return toAjax(wmsOdsWhiteEmbryoInService.updateWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIn)); + } + + /** + * 删除白胚入库单 + */ + @RequiresPermissions("wms:wmsEmbryoin:remove") + @Log(title = "白胚入库单", businessType = BusinessType.DELETE) + @DeleteMapping("/{IDs}") + public AjaxResult remove(@PathVariable String[] IDs) { + return toAjax(wmsOdsWhiteEmbryoInService.deleteWmsOdsWhiteEmbryoInByIDs(IDs)); + } + + /** + * 手持白胚入库 + */ + @PostMapping("/Warehousing") + public AjaxResult addWarehousing(@RequestBody List wmsOdsWhiteEmbryoIns) { + return toAjax(wmsOdsWhiteEmbryoInService.insertWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIns)); + } + +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsOdsWhiteEmbryoIn.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsOdsWhiteEmbryoIn.java new file mode 100644 index 00000000..42933525 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsOdsWhiteEmbryoIn.java @@ -0,0 +1,422 @@ +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; + +/** + * 白胚入库单对象 wms_ods_white_embryo_in + * + * @author Open Platform + * @date 2023-07-20 + */ +public class WmsOdsWhiteEmbryoIn 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 materialDesc; + + /** 计划日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date planDate; + + /** 计划数量 */ + @Excel(name = "计划数量") + private BigDecimal planNumber; + + /** 单位 */ + @Excel(name = "单位") + private String Unit; + + /** 已出库数量 */ + @Excel(name = "已出库数量") + private BigDecimal realityNumber; + + /** 订单状态 */ + @Excel(name = "订单状态") + private String orderStatus; + + /** 批次号 */ + @Excel(name = "批次号") + private String userDefined1; + + /** 产线名称 */ + @Excel(name = "产线名称") + private String productionLineDesc; + + /** 产线编号 */ + @Excel(name = "产线编号") + private String productionLineCode; + + /** 库位 */ + @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; + + /** 供应商编码 */ + @Excel(name = "供应商编码") + private String supplierCode; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String supplierName; + + /** 创建时间 */ + @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; + + private String Remark; + public String getRemark() { + return Remark; + } + + public void setRemark(String Remark) { + this.Remark = Remark; + } + /** 企业编码 */ + @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 setPlanNumber(BigDecimal planNumber) { + this.planNumber = planNumber; + } + + public BigDecimal getPlanNumber() { + return planNumber; + } + 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 setProductionLineDesc(String productionLineDesc) { + this.productionLineDesc = productionLineDesc; + } + + public String getProductionLineDesc() { + return productionLineDesc; + } + public void setProductionLineCode(String productionLineCode) { + this.productionLineCode = productionLineCode; + } + + public String getProductionLineCode() { + return productionLineCode; + } + 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 setSupplierCode(String supplierCode) { + this.supplierCode = supplierCode; + } + + public String getSupplierCode() { + return supplierCode; + } + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public String getSupplierName() { + return supplierName; + } + 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("planNumber", getPlanNumber()) + .append("Unit", getUnit()) + .append("realityNumber", getRealityNumber()) + .append("orderStatus", getOrderStatus()) + .append("userDefined1", getUserDefined1()) + .append("productionLineDesc", getProductionLineDesc()) + .append("productionLineCode", getProductionLineCode()) + .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("supplierCode", getSupplierCode()) + .append("supplierName", getSupplierName()) + .append("Remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createDate", getCreateDate()) + .append("lastUpdateBy", getLastUpdateBy()) + .append("lastUpdateDate", getLastUpdateDate()) + .append("Active", getActive()) + .append("enterpriseId", getEnterpriseId()) + .append("enterpriseCode", getEnterpriseCode()) + .toString(); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsWhiteEmbryoInMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsWhiteEmbryoInMapper.java new file mode 100644 index 00000000..0c6b35aa --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsWhiteEmbryoInMapper.java @@ -0,0 +1,61 @@ +package com.op.wms.mapper; + +import java.util.List; + +import com.op.wms.domain.WmsOdsWhiteEmbryoIn; + +/** + * 白胚入库单Mapper接口 + * + * @author Open Platform + * @date 2023-07-20 + */ +public interface WmsOdsWhiteEmbryoInMapper { + /** + * 查询白胚入库单 + * + * @param ID 白胚入库单主键 + * @return 白胚入库单 + */ + public WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByID(String ID); + + /** + * 查询白胚入库单列表 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 白胚入库单集合 + */ + public List selectWmsOdsWhiteEmbryoInList(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn); + + /** + * 新增白胚入库单 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 结果 + */ + public int insertWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn); + + /** + * 修改白胚入库单 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 结果 + */ + public int updateWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn); + + /** + * 删除白胚入库单 + * + * @param ID 白胚入库单主键 + * @return 结果 + */ + public int deleteWmsOdsWhiteEmbryoInByID(String ID); + + /** + * 批量删除白胚入库单 + * + * @param IDs 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsOdsWhiteEmbryoInService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsOdsWhiteEmbryoInService.java new file mode 100644 index 00000000..026addda --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsOdsWhiteEmbryoInService.java @@ -0,0 +1,60 @@ +package com.op.wms.service; + +import java.util.List; +import com.op.wms.domain.WmsOdsWhiteEmbryoIn; + +/** + * 白胚入库单Service接口 + * + * @author Open Platform + * @date 2023-07-20 + */ +public interface IWmsOdsWhiteEmbryoInService { + /** + * 查询白胚入库单 + * + * @param ID 白胚入库单主键 + * @return 白胚入库单 + */ + public WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByID(String ID); + + /** + * 查询白胚入库单列表 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 白胚入库单集合 + */ + public List selectWmsOdsWhiteEmbryoInList(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn); + + /** + * 新增白胚入库单 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 结果 + */ + public int insertWmsOdsWhiteEmbryoIn(List wmsOdsWhiteEmbryoIns); + + /** + * 修改白胚入库单 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 结果 + */ + public int updateWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn); + + /** + * 批量删除白胚入库单 + * + * @param IDs 需要删除的白胚入库单主键集合 + * @return 结果 + */ + public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs); + + /** + * 删除白胚入库单信息 + * + * @param ID 白胚入库单主键 + * @return 结果 + */ + public int deleteWmsOdsWhiteEmbryoInByID(String ID); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsOdsWhiteEmbryoInServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsOdsWhiteEmbryoInServiceImpl.java new file mode 100644 index 00000000..31ff53f1 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsOdsWhiteEmbryoInServiceImpl.java @@ -0,0 +1,152 @@ +package com.op.wms.service.impl; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.context.SecurityContextHolder; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.wms.domain.Purcode; +import com.op.wms.mapper.PurcodeMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.wms.mapper.WmsOdsWhiteEmbryoInMapper; +import com.op.wms.domain.WmsOdsWhiteEmbryoIn; +import com.op.wms.service.IWmsOdsWhiteEmbryoInService; +import org.springframework.transaction.annotation.Transactional; + +/** + * 白胚入库单Service业务层处理 + * + * @author Open Platform + * @date 2023-07-20 + */ +@Service +public class WmsOdsWhiteEmbryoInServiceImpl implements IWmsOdsWhiteEmbryoInService { + @Autowired + private WmsOdsWhiteEmbryoInMapper wmsOdsWhiteEmbryoInMapper; + @Autowired + private PurcodeMapper purcodeMapper; + /** + * 查询白胚入库单 + * + * @param ID 白胚入库单主键 + * @return 白胚入库单 + */ + @Override + @DS("#header.poolName") + public WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByID(String ID) { + return wmsOdsWhiteEmbryoInMapper.selectWmsOdsWhiteEmbryoInByID(ID); + } + + /** + * 查询白胚入库单列表 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 白胚入库单 + */ + @Override + @DS("#header.poolName") + public List selectWmsOdsWhiteEmbryoInList(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { + return wmsOdsWhiteEmbryoInMapper.selectWmsOdsWhiteEmbryoInList(wmsOdsWhiteEmbryoIn); + } + + /** + * 新增白胚入库单 + * + * @param WmsOdsWhiteEmbryoIn 白胚入库单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + @Transactional + public int insertWmsOdsWhiteEmbryoIn(List wmsOdsWhiteEmbryoIns) { + String userName = SecurityContextHolder.getUserName(); + int tem=0; + for (WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn: + wmsOdsWhiteEmbryoIns) { + String orderCode =getPurcode(null,"RL"); + wmsOdsWhiteEmbryoIn.setID(IdUtils.fastSimpleUUID()); + wmsOdsWhiteEmbryoIn.setOrderCode(orderCode); + wmsOdsWhiteEmbryoIn.setCreateDate(new Date()); + wmsOdsWhiteEmbryoIn.setOrderStatus("0");//0,1 + wmsOdsWhiteEmbryoIn.setActive("1"); + wmsOdsWhiteEmbryoIn.setCreateBy(userName); + tem= wmsOdsWhiteEmbryoInMapper.insertWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIn); + } + return tem; + } + + /** + * 修改白胚入库单 + * + * @param wmsOdsWhiteEmbryoIn 白胚入库单 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { + return wmsOdsWhiteEmbryoInMapper.updateWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIn); + } + + /** + * 批量删除白胚入库单 + * + * @param IDs 需要删除的白胚入库单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs) { + return wmsOdsWhiteEmbryoInMapper.deleteWmsOdsWhiteEmbryoInByIDs(IDs); + } + + /** + * 删除白胚入库单信息 + * + * @param ID 白胚入库单主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWmsOdsWhiteEmbryoInByID(String ID) { + return wmsOdsWhiteEmbryoInMapper.deleteWmsOdsWhiteEmbryoInByID(ID); + } + @DS("#header.poolName") + private String getPurcode(String factorycode, String orderType) { + + String purcode = ""; + String curDate = new SimpleDateFormat("yyyyMMdd").format(new Date()); + + Integer vaule = purcodeMapper.queryCurValue(orderType, curDate); + if (vaule == null) { + Purcode purcodeO = new Purcode(); + purcodeO.setCurDate(curDate); + purcodeO.setOrderType(orderType); + purcodeO.setValue(1); + int count = purcodeMapper.insert(purcodeO); + if (count != 1) { + return ""; + } + if (factorycode != null && !factorycode.equals("")) { + purcode = orderType + factorycode + curDate.substring(2) + String.format("%04d", 1); + } else { + purcode = orderType + curDate.substring(2) + String.format("%04d", 1); + } + + } else { + int count = purcodeMapper.updateCurValue(orderType, curDate, vaule); + if (count != 1) { + return ""; + } + + if (factorycode != null && !factorycode.equals("")) { + purcode = orderType + factorycode + curDate.substring(2) + String.format("%04d", vaule + 1); + } else { + purcode = orderType + curDate.substring(2) + String.format("%04d", vaule + 1); + } + } + return purcode; + } +} diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsWhiteEmbryoInMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsWhiteEmbryoInMapper.xml new file mode 100644 index 00000000..3a49d4ba --- /dev/null +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsWhiteEmbryoInMapper.xml @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select Site_code, ID, Order_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit, Reality_Number, Order_Status, User_Defined1, Production_Line_Desc, Production_Line_Code, Loc_Code, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Supplier_Code, Supplier_Name, Remark, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from wms_ods_white_embryo_in + + + + + + + + insert into wms_ods_white_embryo_in + + Site_code, + ID, + Order_Code, + Material_Code, + Material_Desc, + Plan_Date, + Plan_Number, + Unit, + Reality_Number, + Order_Status, + User_Defined1, + Production_Line_Desc, + Production_Line_Code, + Loc_Code, + User_Defined2, + User_Defined3, + User_Defined4, + User_Defined5, + User_Defined6, + User_Defined7, + User_Defined8, + User_Defined9, + User_Defined10, + User_Defined11, + Supplier_Code, + Supplier_Name, + Remark, + Create_By, + Create_Date, + Last_Update_By, + Last_Update_Date, + Active, + Enterprise_Id, + Enterprise_Code, + + + #{siteCode}, + #{ID}, + #{orderCode}, + #{materialCode}, + #{materialDesc}, + #{planDate}, + #{planNumber}, + #{Unit}, + #{realityNumber}, + #{orderStatus}, + #{userDefined1}, + #{productionLineDesc}, + #{productionLineCode}, + #{locCode}, + #{userDefined2}, + #{userDefined3}, + #{userDefined4}, + #{userDefined5}, + #{userDefined6}, + #{userDefined7}, + #{userDefined8}, + #{userDefined9}, + #{userDefined10}, + #{userDefined11}, + #{supplierCode}, + #{supplierName}, + #{Remark}, + #{createBy}, + #{createDate}, + #{lastUpdateBy}, + #{lastUpdateDate}, + #{Active}, + #{enterpriseId}, + #{enterpriseCode}, + + + + + update wms_ods_white_embryo_in + + Site_code = #{siteCode}, + Order_Code = #{orderCode}, + Material_Code = #{materialCode}, + Material_Desc = #{materialDesc}, + Plan_Date = #{planDate}, + Plan_Number = #{planNumber}, + Unit = #{Unit}, + Reality_Number = #{realityNumber}, + Order_Status = #{orderStatus}, + User_Defined1 = #{userDefined1}, + Production_Line_Desc = #{productionLineDesc}, + Production_Line_Code = #{productionLineCode}, + Loc_Code = #{locCode}, + User_Defined2 = #{userDefined2}, + User_Defined3 = #{userDefined3}, + User_Defined4 = #{userDefined4}, + User_Defined5 = #{userDefined5}, + User_Defined6 = #{userDefined6}, + User_Defined7 = #{userDefined7}, + User_Defined8 = #{userDefined8}, + User_Defined9 = #{userDefined9}, + User_Defined10 = #{userDefined10}, + User_Defined11 = #{userDefined11}, + Supplier_Code = #{supplierCode}, + Supplier_Name = #{supplierName}, + Remark = #{Remark}, + Create_By = #{createBy}, + Create_Date = #{createDate}, + Last_Update_By = #{lastUpdateBy}, + Last_Update_Date = #{lastUpdateDate}, + Active = #{Active}, + Enterprise_Id = #{enterpriseId}, + Enterprise_Code = #{enterpriseCode}, + + where ID = #{ID} + + + + delete from wms_ods_white_embryo_in where ID = #{ID} + + + + delete from wms_ods_white_embryo_in where ID in + + #{ID} + + + \ No newline at end of file