diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProductEmbryoInventoryController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProductEmbryoInventoryController.java index a885bccf..3f1aebaa 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProductEmbryoInventoryController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProductEmbryoInventoryController.java @@ -4,6 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.op.wms.domain.OdsProductEmbryoInventory; +import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation; import com.op.wms.service.IOdsProductEmbryoInventoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -76,6 +77,83 @@ public class OdsProductEmbryoInventoryController extends BaseController { return toAjax(odsProductEmbryoInventoryService.insertOdsProductEmbryoInventory(odsProductEmbryoInventory)); } + + /** + * 新增成品盘点单 + */ + + @PostMapping("/addOdsProductEmbryoInventory") + public AjaxResult addOdsProductEmbryoInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + return success(odsProductEmbryoInventoryService.addOdsProductEmbryoInventory(odsProductEmbryoInventory)); + } + /** + * 查询成品盘点单 + */ + /** + * 盘点后,如果盘点总数量=盘点单总数量,则状态更新为已完成,如果不等于,则状态更新为待调整; + * @param odsProductEmbryoInventory + * @return + */ + @PostMapping("/selectOdsProductEmbryoInventory") + public AjaxResult selectOdsProductEmbryoInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + return success(odsProductEmbryoInventoryService.selectOdsProductEmbryoInventory(odsProductEmbryoInventory)); + } + /** + * 成品盘点的托盘扫码 + */ + /** + * + * @param odsProductEmbryoInventory + * @return + */ + @PostMapping("/selectScanningTray") + public AjaxResult selectScanningTray(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation= odsProductEmbryoInventoryService.selectScanningTray(odsProductEmbryoInventory); + if (odsProductEmbryoInventoryCorrelation==null){ + return success("托盘扫码错误"); + } + return success(odsProductEmbryoInventoryCorrelation); + } + /** + * 成品盘点-关联信息确认盘点 + */ + /** + * + * @param odsProductEmbryoInventory + * @return + */ + @PostMapping("/confirmInventory") + public AjaxResult confirmInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + String result= odsProductEmbryoInventoryService.confirmInventory(odsProductEmbryoInventory); + return success(result); + } + /** + * 成品盘点-关联信息确--取消盘点 + */ + /** + * + * @param odsProductEmbryoInventory + * @return + */ + @PostMapping("/cancelInventory") + public AjaxResult cancelInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + String result= odsProductEmbryoInventoryService.cancelInventory(odsProductEmbryoInventory); + return success(result); + } + + /** + * 成品盘点---盘点完成确认按钮 + */ + /** + *盘点后,如果盘点总数量=盘点单总数量,则状态更新为已完成,如果不等于,则状态更新为待调整; + * @param odsProductEmbryoInventory + * @return + */ + @PostMapping("/confirmCompletion") + public AjaxResult confirmCompletion(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) { + String result= odsProductEmbryoInventoryService.confirmCompletion(odsProductEmbryoInventory); + return success(result); + } /** * 修改成品盘点单 */ diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventory.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventory.java index f4fee6a7..9aadf138 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventory.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventory.java @@ -2,6 +2,8 @@ package com.op.wms.domain; import java.math.BigDecimal; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -17,6 +19,17 @@ import com.op.common.core.web.domain.BaseEntity; public class OdsProductEmbryoInventory extends BaseEntity { private static final long serialVersionUID=1L; + + private List odsProductEmbryoInventoryCorrelationList; + + public List getOdsProductEmbryoInventoryCorrelationList() { + return odsProductEmbryoInventoryCorrelationList; + } + + public void setOdsProductEmbryoInventoryCorrelationList(List odsProductEmbryoInventoryCorrelationList) { + this.odsProductEmbryoInventoryCorrelationList = odsProductEmbryoInventoryCorrelationList; + } + /** 工厂编码 */ @Excel(name = "工厂编码") private String siteCode; @@ -27,6 +40,16 @@ private static final long serialVersionUID=1L; /** 盘点单号 */ @Excel(name = "盘点单号") private String orderCode; + @Excel(name = "托盘") + private String sn; + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } /** 型号编码 */ @Excel(name = "型号编码") diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventoryCorrelation.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventoryCorrelation.java new file mode 100644 index 00000000..bf982fa5 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProductEmbryoInventoryCorrelation.java @@ -0,0 +1,428 @@ +package com.op.wms.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 成品盘点关联表 ods_product_embryo_inventory + * + * @author Open Platform + * @date 2024-04-10 + */ +public class OdsProductEmbryoInventoryCorrelation extends BaseEntity { +private static final long serialVersionUID=1L; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String siteCode; + private String amount; + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + /** ID */ + private String ID; + + /** 盘点单号 */ + @Excel(name = "关联的盘点单号") + private String orderCode; + private String wlCode; + + public String getWlCode() { + return wlCode; + } + + public void setWlCode(String wlCode) { + this.wlCode = wlCode; + } + + /** 型号编码 */ + @Excel(name = "型号编码") + private String materialCode; + /** 型号编码 */ + @Excel(name = "备注") + private String Remark; + @Excel(name = "托盘") + private String sn; + + + private String productCode; + private String productName; + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + @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 = "状态0是未盘。1是盘了") + private String orderStatus; + + /** 用户自定义属性2 */ + @Excel(name = "用户自定义属性2") + private String userDefined1; + + /** 库位 */ + @Excel(name = "库位") + private String locCode; + + /** 用户自定义属性2 */ + @Excel(name = "用户自定义属性2") + private String userDefined2; + + /** 用户自定义属性3 */ + @Excel(name = "用户自定义属性3") + private String userDefined3; + + /** 用户自定义属性4 */ + @Excel(name = "用户自定义属性4") + private String userDefined4; + + /** 用户自定义属性5 */ + @Excel(name = "用户自定义属性5") + private String userDefined5; + + /** 用户自定义属性6 */ + @Excel(name = "用户自定义属性6") + private String userDefined6; + + /** 用户自定义属性7 */ + @Excel(name = "用户自定义属性7") + private String userDefined7; + + /** 用户自定义属性8 */ + @Excel(name = "用户自定义属性8") + private String userDefined8; + + /** 用户自定义属性9 */ + @Excel(name = "用户自定义属性9") + private String userDefined9; + + /** 用户自定义属性10 */ + @Excel(name = "用户自定义属性10") + private String userDefined10; + + /** 用户自定义属性11 */ + @Excel(name = "用户自定义属性11") + private String userDefined11; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createDate; + + /** 最后更新人 */ + @Excel(name = "最后更新人") + private String lastUpdateBy; + + /** 最后更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastUpdateDate; + + /** 可用标识 */ + @Excel(name = "可用标识") + private String Active; + + /** 企业主键 */ + @Excel(name = "企业主键") + private String enterpriseId; + + /** 企业编码 */ + @Excel(name = "企业编码") + private String enterpriseCode; + + public void setSiteCode(String siteCode){ + this.siteCode = siteCode; + } + + public String getSiteCode(){ + return siteCode; + } + public void setID(String ID){ + this.ID = ID; + } + + public String getID(){ + return ID; + } + public void setOrderCode(String orderCode){ + this.orderCode = orderCode; + } + + public String getOrderCode(){ + return orderCode; + } + public void setMaterialCode(String materialCode){ + this.materialCode = materialCode; + } + + public String getMaterialCode(){ + return materialCode; + } + public void setMaterialDesc(String materialDesc){ + this.materialDesc = materialDesc; + } + + public String getMaterialDesc(){ + return materialDesc; + } + public void setPlanDate(Date planDate){ + this.planDate = planDate; + } + + public Date getPlanDate(){ + return planDate; + } + public void setLocNumber(BigDecimal locNumber){ + this.locNumber = locNumber; + } + + public BigDecimal getLocNumber(){ + return locNumber; + } + public void setUnit(String unit){ + this.unit = unit; + } + + public String getUnit(){ + return unit; + } + public void setRealityNumber(BigDecimal realityNumber){ + this.realityNumber = realityNumber; + } + + public BigDecimal getRealityNumber(){ + return realityNumber; + } + public void setOrderStatus(String orderStatus){ + this.orderStatus = orderStatus; + } + + public String getOrderStatus(){ + return orderStatus; + } + public void setUserDefined1(String userDefined1){ + this.userDefined1 = userDefined1; + } + + public String getUserDefined1(){ + return userDefined1; + } + public void setLocCode(String locCode){ + this.locCode = locCode; + } + + public String getLocCode(){ + return locCode; + } + public void setUserDefined2(String userDefined2){ + this.userDefined2 = userDefined2; + } + + public String getUserDefined2(){ + return userDefined2; + } + public void setUserDefined3(String userDefined3){ + this.userDefined3 = userDefined3; + } + + public String getUserDefined3(){ + return userDefined3; + } + public void setUserDefined4(String userDefined4){ + this.userDefined4 = userDefined4; + } + + public String getUserDefined4(){ + return userDefined4; + } + public void setUserDefined5(String userDefined5){ + this.userDefined5 = userDefined5; + } + + public String getUserDefined5(){ + return userDefined5; + } + public void setUserDefined6(String userDefined6){ + this.userDefined6 = userDefined6; + } + + public String getUserDefined6(){ + return userDefined6; + } + public void setUserDefined7(String userDefined7){ + this.userDefined7 = userDefined7; + } + + public String getUserDefined7(){ + return userDefined7; + } + public void setUserDefined8(String userDefined8){ + this.userDefined8 = userDefined8; + } + + public String getUserDefined8(){ + return userDefined8; + } + public void setUserDefined9(String userDefined9){ + this.userDefined9 = userDefined9; + } + + public String getUserDefined9(){ + return userDefined9; + } + public void setUserDefined10(String userDefined10){ + this.userDefined10 = userDefined10; + } + + public String getUserDefined10(){ + return userDefined10; + } + public void setUserDefined11(String userDefined11){ + this.userDefined11 = userDefined11; + } + + public String getUserDefined11(){ + return userDefined11; + } + public void setCreateDate(Date createDate){ + this.createDate = createDate; + } + + public Date getCreateDate(){ + return createDate; + } + public void setLastUpdateBy(String lastUpdateBy){ + this.lastUpdateBy = lastUpdateBy; + } + + public String getLastUpdateBy(){ + return lastUpdateBy; + } + public void setLastUpdateDate(Date lastUpdateDate){ + this.lastUpdateDate = lastUpdateDate; + } + + public Date getLastUpdateDate(){ + return lastUpdateDate; + } + public void setActive(String Active){ + this.Active = Active; + } + + public String getActive(){ + return Active; + } + public void setEnterpriseId(String enterpriseId){ + this.enterpriseId = enterpriseId; + } + + public String getEnterpriseId(){ + return enterpriseId; + } + public void setEnterpriseCode(String enterpriseCode){ + this.enterpriseCode = enterpriseCode; + } + + public String getEnterpriseCode(){ + return enterpriseCode; + } + +@Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("siteCode",getSiteCode()) + .append("ID",getID()) + .append("orderCode",getOrderCode()) + .append("materialCode",getMaterialCode()) + .append("materialDesc",getMaterialDesc()) + .append("planDate",getPlanDate()) + .append("locNumber",getLocNumber()) + .append("unit",getUnit()) + .append("realityNumber",getRealityNumber()) + .append("orderStatus",getOrderStatus()) + .append("userDefined1",getUserDefined1()) + .append("locCode",getLocCode()) + .append("userDefined2",getUserDefined2()) + .append("userDefined3",getUserDefined3()) + .append("userDefined4",getUserDefined4()) + .append("userDefined5",getUserDefined5()) + .append("userDefined6",getUserDefined6()) + .append("userDefined7",getUserDefined7()) + .append("userDefined8",getUserDefined8()) + .append("userDefined9",getUserDefined9()) + .append("userDefined10",getUserDefined10()) + .append("userDefined11",getUserDefined11()) + .append("Remark",getRemark()) + .append("createBy",getCreateBy()) + .append("createDate",getCreateDate()) + .append("lastUpdateBy",getLastUpdateBy()) + .append("lastUpdateDate",getLastUpdateDate()) + .append("Active",getActive()) + .append("enterpriseId",getEnterpriseId()) + .append("enterpriseCode",getEnterpriseCode()) + .toString(); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProductEmbryoInventoryMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProductEmbryoInventoryMapper.java index aedc33be..c9cbf83e 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProductEmbryoInventoryMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProductEmbryoInventoryMapper.java @@ -3,6 +3,7 @@ package com.op.wms.mapper; import java.util.List; import com.op.wms.domain.OdsProductEmbryoInventory; +import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation; /** * 成品盘点单Mapper接口 @@ -58,4 +59,8 @@ public interface OdsProductEmbryoInventoryMapper { * @return 结果 */ public int deleteOdsProductEmbryoInventoryByIDs(String[] IDs); + + void insertOdsProductEmbryoInventoryCorrelation(OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation1); + + List selectOdsProductEmbryoInventoryCorrelationList(OdsProductEmbryoInventory odsProductEmbryoInventory2); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProductEmbryoInventoryService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProductEmbryoInventoryService.java index c2b2dcef..b66113d9 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProductEmbryoInventoryService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProductEmbryoInventoryService.java @@ -3,6 +3,7 @@ package com.op.wms.service; import java.util.List; import com.op.wms.domain.OdsProductEmbryoInventory; +import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation; /** * 成品盘点单Service接口 @@ -58,4 +59,16 @@ public interface IOdsProductEmbryoInventoryService { * @return 结果 */ public int deleteOdsProductEmbryoInventoryByID(String ID); + + String addOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + OdsProductEmbryoInventory selectOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + OdsProductEmbryoInventoryCorrelation selectScanningTray(OdsProductEmbryoInventory odsProductEmbryoInventory); + + String confirmInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + String cancelInventory(OdsProductEmbryoInventory odsProductEmbryoInventory); + + String confirmCompletion(OdsProductEmbryoInventory odsProductEmbryoInventory); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProductEmbryoInventoryServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProductEmbryoInventoryServiceImpl.java index fd4877dd..69e6f3fb 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProductEmbryoInventoryServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProductEmbryoInventoryServiceImpl.java @@ -1,10 +1,20 @@ package com.op.wms.service.impl; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; import com.op.wms.domain.OdsProductEmbryoInventory; +import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation; +import com.op.wms.domain.Purcode; import com.op.wms.mapper.OdsProductEmbryoInventoryMapper; +import com.op.wms.mapper.PurcodeMapper; import com.op.wms.service.IOdsProductEmbryoInventoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -21,6 +31,8 @@ public class OdsProductEmbryoInventoryServiceImpl implements IOdsProductEmbryoIn @Autowired private OdsProductEmbryoInventoryMapper odsProductEmbryoInventoryMapper; + @Autowired + private PurcodeMapper purcodeMapper; /** * 查询成品盘点单 * @@ -92,4 +104,192 @@ public class OdsProductEmbryoInventoryServiceImpl implements IOdsProductEmbryoIn public int deleteOdsProductEmbryoInventoryByID(String ID) { return odsProductEmbryoInventoryMapper.deleteOdsProductEmbryoInventoryByID(ID); } + + @Override + @DS("#header.poolName") + public String addOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) { + String ruslt="创建成功"; + //插入盘点表 + String orderCode = getPurcode(null, "PD"); + OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory(); + odsProductEmbryoInventory1.setID(IdUtils.fastSimpleUUID()); + odsProductEmbryoInventory1.setActive("1"); + odsProductEmbryoInventory1.setSiteCode(odsProductEmbryoInventory.getSiteCode()); + odsProductEmbryoInventory1.setOrderCode(orderCode);//自动生成 + odsProductEmbryoInventory1.setOrderStatus("0"); + // odsProductEmbryoInventory1.setMaterialCode(odsProductEmbryoInventory.getMaterialCode()); + // odsProductEmbryoInventory1.setMaterialDesc(odsProductEmbryoInventory.getMaterialDesc()); + // odsProductEmbryoInventory1.setLocNumber(); + odsProductEmbryoInventory1.setUnit(odsProductEmbryoInventory.getUnit()); + odsProductEmbryoInventory1.setUserDefined1(odsProductEmbryoInventory.getUserDefined1());//盘点仓库 + odsProductEmbryoInventory1.setUserDefined3(odsProductEmbryoInventory.getUserDefined3());//盘点类型 + odsProductEmbryoInventory1.setUserDefined10(odsProductEmbryoInventory.getUserDefined10());//盘点策略 + odsProductEmbryoInventory1.setUserDefined11(odsProductEmbryoInventory.getUserDefined11());//产品状态 + odsProductEmbryoInventory1.setRemark(odsProductEmbryoInventory.getRemark()); + odsProductEmbryoInventory1.setCreateBy(SecurityUtils.getUsername()); + odsProductEmbryoInventory1.setCreateDate(new Date()); + odsProductEmbryoInventoryMapper.insertOdsProductEmbryoInventory(odsProductEmbryoInventory1); + //插入对应的关联明细 + List odsProductEmbryoInventoryCorrelationList= odsProductEmbryoInventory.getOdsProductEmbryoInventoryCorrelationList(); + for (OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation: + odsProductEmbryoInventoryCorrelationList ) { + OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation1=new OdsProductEmbryoInventoryCorrelation(); + odsProductEmbryoInventoryCorrelation1.setID(IdUtils.fastSimpleUUID()); + odsProductEmbryoInventoryCorrelation1.setActive("1"); + odsProductEmbryoInventoryCorrelation1.setSiteCode(odsProductEmbryoInventory.getSiteCode()); + odsProductEmbryoInventoryCorrelation1.setOrderCode(orderCode); + odsProductEmbryoInventoryCorrelation1.setOrderStatus("0"); + odsProductEmbryoInventoryCorrelation1.setMaterialCode(odsProductEmbryoInventoryCorrelation.getProductCode()); + odsProductEmbryoInventoryCorrelation1.setMaterialDesc(odsProductEmbryoInventoryCorrelation.getProductName()); + odsProductEmbryoInventoryCorrelation1.setLocNumber(new BigDecimal(odsProductEmbryoInventoryCorrelation.getAmount()));//应盘 + odsProductEmbryoInventoryCorrelation1.setLocCode(odsProductEmbryoInventoryCorrelation.getWlCode());//库位 + odsProductEmbryoInventoryCorrelation1.setUserDefined2(odsProductEmbryoInventoryCorrelation.getSn());//sn + odsProductEmbryoInventoryCorrelation1.setUnit(odsProductEmbryoInventoryCorrelation.getUnit()); + odsProductEmbryoInventoryCorrelation1.setUserDefined1(odsProductEmbryoInventory.getUserDefined1());//盘点仓库 + odsProductEmbryoInventoryCorrelation1.setUserDefined3(odsProductEmbryoInventory.getUserDefined3());//盘点类型 + odsProductEmbryoInventoryCorrelation1.setUserDefined10(odsProductEmbryoInventory.getUserDefined10());//盘点策略 + odsProductEmbryoInventoryCorrelation1.setUserDefined11(odsProductEmbryoInventory.getUserDefined11());//产品状态 + odsProductEmbryoInventoryCorrelation1.setRemark(odsProductEmbryoInventory.getRemark()); + odsProductEmbryoInventoryCorrelation1.setCreateBy(SecurityUtils.getUsername()); + odsProductEmbryoInventoryCorrelation1.setCreateDate(new Date()); + odsProductEmbryoInventoryMapper.insertOdsProductEmbryoInventoryCorrelation(odsProductEmbryoInventoryCorrelation1); + } + return ruslt; + } + + @Override + public OdsProductEmbryoInventory selectOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) { + OdsProductEmbryoInventory odsProductEmbryoInventorytwm=new OdsProductEmbryoInventory(); + DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode()); + List odsProductEmbryoInventoryCorrelationList=new ArrayList<>(); + OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory(); + odsProductEmbryoInventory1.setOrderCode(odsProductEmbryoInventory.getOrderCode()); + odsProductEmbryoInventory1.setActive("1"); + odsProductEmbryoInventory1.setOrderStatus("0");//带盘点 + List odsProductEmbryoInventoryList=odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryList(odsProductEmbryoInventory1); + if (odsProductEmbryoInventoryList.size()>0){ + odsProductEmbryoInventorytwm= odsProductEmbryoInventoryList.get(0); + OdsProductEmbryoInventory odsProductEmbryoInventory3=new OdsProductEmbryoInventory(); + odsProductEmbryoInventory3.setOrderCode(odsProductEmbryoInventorytwm.getOrderCode()); + odsProductEmbryoInventory3.setActive("1"); + odsProductEmbryoInventoryCorrelationList =odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryCorrelationList(odsProductEmbryoInventory3); + } + odsProductEmbryoInventorytwm.setOdsProductEmbryoInventoryCorrelationList(odsProductEmbryoInventoryCorrelationList); + return odsProductEmbryoInventorytwm; + } + + @Override + public OdsProductEmbryoInventoryCorrelation selectScanningTray(OdsProductEmbryoInventory odsProductEmbryoInventory) { + DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode()); + OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory(); + odsProductEmbryoInventory1.setOrderCode(odsProductEmbryoInventory.getOrderCode()); + odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getSn()); + List odsProductEmbryoInventoryCorrelationList= odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryCorrelationList(odsProductEmbryoInventory1); + if (odsProductEmbryoInventoryCorrelationList.size()>0){ + return odsProductEmbryoInventoryCorrelationList.get(0); + } + return null; + } + + @Override + public String confirmInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) { + String ruslt="成功"; + DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode()); + OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory(); + + odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID()); + odsProductEmbryoInventory1.setOrderStatus("1"); + odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getUserDefined2()); + odsProductEmbryoInventory1.setRealityNumber(odsProductEmbryoInventory.getRealityNumber()); + odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventory(odsProductEmbryoInventory1); + return ruslt; + } + + @Override + public String cancelInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) { + String ruslt="成功"; + DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode()); + OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory(); + + odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID()); + odsProductEmbryoInventory1.setOrderStatus("0"); + odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getUserDefined2()); + odsProductEmbryoInventory1.setRealityNumber(new BigDecimal("0")); + odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventory(odsProductEmbryoInventory1); + return ruslt; + } + + /** + * 盘点后,如果盘点总数量=盘点单总数量,则状态更新为已完成,如果不等于,则状态更新为待调整; + * @param odsProductEmbryoInventory + * @return + */ + @Override + public String confirmCompletion(OdsProductEmbryoInventory odsProductEmbryoInventory) { + String ruslt="成功"; + DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode()); + BigDecimal realityNumber= odsProductEmbryoInventory.getRealityNumber(); + BigDecimal locNumber= odsProductEmbryoInventory.getLocNumber(); + // 获取当前时间 + Date currentDate = new Date(); + // 使用SimpleDateFormat格式化时间 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 将当前时间格式化为字符串 + String date = dateFormat.format(currentDate); + if (realityNumber.compareTo(locNumber) == 0) { // 如果实际数量等于库存地点数量 + // 更新状态为已完成---3 + OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory(); + odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID()); + odsProductEmbryoInventory1.setOrderStatus("3"); + odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getCreateBy()); + odsProductEmbryoInventory1.setUserDefined5(date); + odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventory(odsProductEmbryoInventory1); + } else { + // 更新状态为待调整--1 + OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory(); + odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID()); + odsProductEmbryoInventory1.setOrderStatus("1"); + odsProductEmbryoInventory1.setUserDefined5(date);//盘点时间 + odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getCreateBy());//盘点人 + odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventory(odsProductEmbryoInventory1); + } + return ruslt; + } + + @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/OdsProductEmbryoInventoryMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProductEmbryoInventoryMapper.xml index 2c9f65f9..62f8f57b 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProductEmbryoInventoryMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProductEmbryoInventoryMapper.xml @@ -37,6 +37,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ -139,6 +171,133 @@ where ID = #{ID} + + insert into ods_product_embryo_Inventory_correlation + + Site_code, + + ID, + + Order_Code, + + Material_Code, + + Material_Desc, + + Plan_Date, + + Loc_Number, + + Unit, + + Reality_Number, + + Order_Status, + + User_Defined1, + + Loc_Code, + + User_Defined2, + + User_Defined3, + + User_Defined4, + + User_Defined5, + + User_Defined6, + + User_Defined7, + + User_Defined8, + + User_Defined9, + + User_Defined10, + + User_Defined11, + + Remark, + + Create_By, + + Create_Date, + + Last_Update_By, + + Last_Update_Date, + + Active, + + Enterprise_Id, + + Enterprise_Code, + + + + #{siteCode}, + + #{ID}, + + #{orderCode}, + + #{materialCode}, + + #{materialDesc}, + + #{planDate}, + + #{locNumber}, + + #{unit}, + + #{realityNumber}, + + #{orderStatus}, + + #{userDefined1}, + + #{locCode}, + + #{userDefined2}, + + #{userDefined3}, + + #{userDefined4}, + + #{userDefined5}, + + #{userDefined6}, + + #{userDefined7}, + + #{userDefined8}, + + #{userDefined9}, + + #{userDefined10}, + + #{userDefined11}, + + #{Remark}, + + #{createBy}, + + #{createDate}, + + #{lastUpdateBy}, + + #{lastUpdateDate}, + + #{Active}, + + #{enterpriseId}, + + #{enterpriseCode}, + + + insert into ods_product_embryo_inventory @@ -372,4 +531,128 @@ #{ID} +