MES:增加获取生产派工、生产计划明细、和生成生产计划明细接口
auth:增加获取工位列表接口,登录接口保存工位信息。
master
xins 9 months ago
parent eba8e3c1a7
commit 81f9aa8f23

@ -58,6 +58,11 @@ public class LoginUser implements Serializable
*/
private SysUser sysUser;
/**
* ID
*/
private Long stationId;
public String getToken()
{
return token;
@ -147,4 +152,12 @@ public class LoginUser implements Serializable
{
this.sysUser = sysUser;
}
public Long getStationId() {
return stationId;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
}
}

@ -42,6 +42,7 @@ public class TokenController
{
// 用户登录
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
userInfo.setStationId(form.getStationId());
// 获取登录token
return R.ok(tokenService.createToken(userInfo));
}

@ -17,6 +17,13 @@ public class LoginBody
*/
private String password;
/**
* ID
*/
private Long stationId;
public String getUsername()
{
return username;
@ -36,4 +43,12 @@ public class LoginBody
{
this.password = password;
}
public Long getStationId() {
return stationId;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
}
}

@ -46,4 +46,10 @@ public class SecurityConstants
*
*/
public static final String ROLE_PERMISSION = "role_permission";
/**
* ID
*/
public static final String DETAILS_STATION_ID = "station_id";
}

@ -95,4 +95,16 @@ public class SecurityContextHolder
{
THREAD_LOCAL.remove();
}
public static Long getStationId()
{
return Convert.toLong(get(SecurityConstants.DETAILS_STATION_ID), 0L);
}
public static void setStationId(String stationId)
{
set(SecurityConstants.DETAILS_STATION_ID, stationId);
}
}

@ -120,4 +120,17 @@ public class JwtUtils
{
return Convert.toStr(claims.get(key), "");
}
/**
* ID
*
* @param claims
* @return ID
*/
public static String getStationId(Claims claims)
{
return getValue(claims, SecurityConstants.DETAILS_STATION_ID);
}
}

@ -31,6 +31,7 @@ public class HeaderInterceptor implements AsyncHandlerInterceptor
SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID));
SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME));
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY));
SecurityContextHolder.setStationId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_STATION_ID));
String token = SecurityUtils.getToken();
if (StringUtils.isNotEmpty(token))

@ -61,6 +61,7 @@ public class TokenService
claimsMap.put(SecurityConstants.USER_KEY, token);
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
claimsMap.put(SecurityConstants.DETAILS_STATION_ID, loginUser.getStationId());
// 接口返回信息
Map<String, Object> rspMap = new HashMap<String, Object>();

@ -40,6 +40,14 @@ public class SecurityUtils
return SecurityContextHolder.getUserKey();
}
/**
* ID
*/
public static Long getStationd()
{
return SecurityContextHolder.getStationId();
}
/**
*
*/

@ -69,6 +69,7 @@ public class AuthFilter implements GlobalFilter, Ordered
}
String userid = JwtUtils.getUserId(claims);
String username = JwtUtils.getUserName(claims);
String stationId = JwtUtils.getStationId(claims);
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username))
{
return unauthorizedResponse(exchange, "令牌验证失败");
@ -78,6 +79,7 @@ public class AuthFilter implements GlobalFilter, Ordered
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
addHeader(mutate, SecurityConstants.DETAILS_STATION_ID, stationId);
// 内部请求来源参数清除
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
return chain.filter(exchange.mutate().request(mutate.build()).build());

@ -132,7 +132,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
TdTableVo tableVo = new TdTableVo();
tableVo.setDatabaseName("db_hwmes");
tableVo.setSuperTableName("st_electricity");
tableVo.setTableName(TdEngineConstants.getEmsTableName(objid));
tableVo.setTableName(TdEngineConstants.getEmsTableName(monitorId));
List<TdField> fields = new ArrayList<TdField>();
TdField field = new TdField();
TdField field2 = new TdField();
@ -267,7 +267,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
*/
private void updateTdEngineTable(BaseMonitorInfo baseMonitorInfo, BaseMonitorInfo dbBaseMonitorInfo) {
String databaseName = TdEngineConstants.EMS_DATABASE_NAME;
String tableName = TdEngineConstants.getEmsTableName(baseMonitorInfo.getObjid());
String tableName = TdEngineConstants.getEmsTableName(baseMonitorInfo.getMonitorId());
List<AlterTagVo> alterTagVos = new ArrayList<AlterTagVo>();
R<?> tdReturnMsg;

@ -363,8 +363,7 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService {
tdSelectDto.setSchemaFieldValues(listTdfields);
List<BaseMonitorInfo> baseMonitorInfos = baseMonitorInfo1Service.selectBaseMonitorInfoList(new BaseMonitorInfo());
for (BaseMonitorInfo baseMonitorInfo : baseMonitorInfos){
tdSelectDto.setTableName(TdEngineConstants.getEmsTableName(baseMonitorInfo.getObjid()));
// tdSelectDto.setTableName(TdEngineConstants.getEmsTableName("ceshi7"));
tdSelectDto.setTableName(TdEngineConstants.getEmsTableName(baseMonitorInfo.getMonitorId()));
tdSelectDto.setTagsName("monitorobjid");
//查出每个计量设备最新的一条实时数据

@ -213,7 +213,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
TdTableVo tdTableVo = new TdTableVo();
tdTableVo.setDatabaseName("db_hwmes");
tdTableVo.setSuperTableName("st_electricity");
tdTableVo.setTableName("t_e_"+baseMonitorInfos.get(0).getObjid());
tdTableVo.setTableName(TdEngineConstants.getEmsTableName(baseMonitorInfos.get(0).getMonitorId()));
List<TdField> fields = new ArrayList<TdField>();
List<TdField> field2s = new ArrayList<TdField>();
TdField field = new TdField();
@ -434,10 +434,9 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
if (!baseMonitorInfos.isEmpty()) {
for (BaseMonitorInfo baseMonitorInfo : baseMonitorInfos) {
try {
String emsTableName = TdEngineConstants.getEmsTableName(baseMonitorInfo.getObjid());
String emsTableName = TdEngineConstants.getEmsTableName(baseMonitorInfo.getMonitorId());
//获取当前数据以及一小时前的数据
tdHistorySelectDto.setTableName(emsTableName);
// tdHistorySelectDto.setTableName("t_e_ceshi7");
List<Map<String, Object>> dnbInstant = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER).getData().getDataList();
R<TdReturnDataVo> historyData = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER);
ReportPointDnb report = new ReportPointDnb();

@ -2,10 +2,18 @@ package com.hw.mes.controller;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import com.hw.mes.service.IMesMaterialBomService;
import com.hw.mes.service.IMesProductPlanDetailService;
import com.hw.mes.service.IMesProductPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -23,6 +31,12 @@ public class MesApiController extends BaseController
@Autowired
private IMesMaterialBomService mesMaterialBomService;
@Autowired
private IMesProductPlanService productPlanService;
@Autowired
private IMesProductPlanDetailService productPlanDetailService;
/**
* BOM
*/
@ -35,4 +49,37 @@ public class MesApiController extends BaseController
}
/**
*
*/
// @RequiresPermissions("mes:materialBom:list")
@GetMapping("/getProductPlans")
public AjaxResult getProductPlans(MesProductPlan mesProductPlan)
{
List<MesProductPlan> list = productPlanService.selectMesProductPlanJoinList(mesProductPlan);
return success(list);
}
/**
*
*/
@Log(title = "生产计划明细", businessType = BusinessType.INSERT)
@PostMapping(("/insertProductPlanDetails"))
public AjaxResult insertProductPlanDetails(@Validated @RequestBody MesProductPlanDetailVo mesProductPlanDetailVo) {
return toAjax(productPlanDetailService.insertMesProductPlanDetails(mesProductPlanDetailVo));
}
/**
* ID
*/
// @RequiresPermissions("mes:materialBom:list")
@GetMapping("/getProductPlanDetails")
public AjaxResult getProductPlanDetails(MesProductPlanDetail mesProductPlanDetail)
{
List<MesProductPlanDetail> list = productPlanDetailService.selectMesProductPlanDetailList(mesProductPlanDetail);
return success(list);
}
}

@ -0,0 +1,105 @@
package com.hw.mes.controller;
import java.util.List;
import java.io.IOException;
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.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.service.IMesProductPlanService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author xins
* @date 2024-02-21
*/
@RestController
@RequestMapping("/productplan")
public class MesProductPlanController extends BaseController
{
@Autowired
private IMesProductPlanService mesProductPlanService;
/**
*
*/
@RequiresPermissions("mes:productplan:list")
@GetMapping("/list")
public TableDataInfo list(MesProductPlan mesProductPlan)
{
startPage();
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:productplan:export")
@Log(title = "生产派工", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesProductPlan mesProductPlan)
{
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
ExcelUtil<MesProductPlan> util = new ExcelUtil<MesProductPlan>(MesProductPlan.class);
util.exportExcel(response, list, "生产派工数据");
}
/**
*
*/
@RequiresPermissions("mes:productplan:query")
@GetMapping(value = "/{planId}")
public AjaxResult getInfo(@PathVariable("planId") Long planId)
{
return success(mesProductPlanService.selectMesProductPlanByPlanId(planId));
}
/**
*
*/
@RequiresPermissions("mes:productplan:add")
@Log(title = "生产派工", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesProductPlan mesProductPlan)
{
return toAjax(mesProductPlanService.insertMesProductPlan(mesProductPlan));
}
/**
*
*/
@RequiresPermissions("mes:productplan:edit")
@Log(title = "生产派工", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesProductPlan mesProductPlan)
{
return toAjax(mesProductPlanService.updateMesProductPlan(mesProductPlan));
}
/**
*
*/
@RequiresPermissions("mes:productplan:remove")
@Log(title = "生产派工", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public AjaxResult remove(@PathVariable Long[] planIds)
{
return toAjax(mesProductPlanService.deleteMesProductPlanByPlanIds(planIds));
}
}

@ -0,0 +1,110 @@
package com.hw.mes.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* mes_material_check_result
*
* @author xins
* @date 2024-02-21
*/
public class MesMaterialCheckResult extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long materialCheckResultId;
/** 生产计划ID关联mes_product_plan的plan_id */
@Excel(name = "生产计划ID关联mes_product_plan的plan_id")
private Long planId;
/** 生产计划明细ID关联mes_product_plan_detail的plan_detail_id */
@Excel(name = "生产计划明细ID关联mes_product_plan_detail的plan_detail_id")
private Long planDetailId;
/** 物料ID */
@Excel(name = "物料ID")
private Long materialId;
/** 标准数量 */
@Excel(name = "标准数量")
private BigDecimal standardAmount;
/** 检验数量 */
@Excel(name = "检验数量")
private BigDecimal checkAmount;
public void setMaterialCheckResultId(Long materialCheckResultId)
{
this.materialCheckResultId = materialCheckResultId;
}
public Long getMaterialCheckResultId()
{
return materialCheckResultId;
}
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setPlanDetailId(Long planDetailId)
{
this.planDetailId = planDetailId;
}
public Long getPlanDetailId()
{
return planDetailId;
}
public void setMaterialId(Long materialId)
{
this.materialId = materialId;
}
public Long getMaterialId()
{
return materialId;
}
public void setStandardAmount(BigDecimal standardAmount)
{
this.standardAmount = standardAmount;
}
public BigDecimal getStandardAmount()
{
return standardAmount;
}
public void setCheckAmount(BigDecimal checkAmount)
{
this.checkAmount = checkAmount;
}
public BigDecimal getCheckAmount()
{
return checkAmount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("materialCheckResultId", getMaterialCheckResultId())
.append("planId", getPlanId())
.append("planDetailId", getPlanDetailId())
.append("materialId", getMaterialId())
.append("standardAmount", getStandardAmount())
.append("checkAmount", getCheckAmount())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,370 @@
package com.hw.mes.domain;
import java.math.BigDecimal;
import java.util.List;
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.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* mes_product_plan
*
* @author xins
* @date 2024-02-21
*/
public class MesProductPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long planId;
/** 生产工单ID */
@Excel(name = "生产工单ID")
private Long productOrderId;
/** 计划编号 */
@Excel(name = "计划编号")
private String planCode;
/** 派工单号;主要为顺序生产时,获取上一工序的派工单是否完成,每次派工生成的派工单号相同,不同次派工的派工单号不能相同 */
@Excel(name = "派工单号;主要为顺序生产时,获取上一工序的派工单是否完成,每次派工生成的派工单号相同,不同次派工的派工单号不能相同")
private String dispatchCode;
/** 物料ID */
@Excel(name = "物料ID")
private Long materialId;
/** 物料bomID关联mes_material_bom的material_bom_id */
@Excel(name = "物料bomID关联mes_material_bom的material_bom_id")
private Long materialBomId;
/** 工序ID */
@Excel(name = "工序ID")
private Long processId;
/** 顺序;派工类型是工艺路线的需要有顺序 */
@Excel(name = "顺序;派工类型是工艺路线的需要有顺序")
private Long processOrder;
/** 上一工序ID */
@Excel(name = "上一工序ID")
private Long lastProcessId;
/** 工位ID关联工位信息主键;根据选择的工序或者工艺路线拆分到工位上会拆分1到多条生产计划 */
@Excel(name = "工位ID关联工位信息主键;根据选择的工序或者工艺路线拆分到工位上会拆分1到多条生产计划")
private Long stationId;
/** 用户ID关联sys_user主键;预留,暂时不用 */
@Excel(name = "用户ID关联sys_user主键;预留,暂时不用")
private Long userId;
/** 单位生产时间(单位s) */
@Excel(name = "单位生产时间(单位s)")
private Long productionTime;
/** 计划数量 */
@Excel(name = "计划数量")
private BigDecimal planAmount;
/** 完成数量 */
@Excel(name = "完成数量")
private BigDecimal completeAmount;
/** 计划开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planBeginTime;
/** 计划结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planEndTime;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realBeginTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realEndTime;
/** 附件信息,关联附件信息主键;多个用,隔开;页面可选择附件信息,也可直接上传 */
@Excel(name = "附件信息,关联附件信息主键;多个用,隔开;页面可选择附件信息,也可直接上传")
private String attachId;
/** 计划状态0-未派工1-已派工2-已开始 */
@Excel(name = "计划状态0-未派工1-已派工2-已开始3-已完成")
private String planStatus;
/** 是否标识1-是0-否 */
@Excel(name = "是否标识1-是0-否")
private String isFlag;
/**
*
*/
private Date planDeliveryDate;
/**
*
*/
private String materialName;
/** 生产计划明细信息 */
private List<MesProductPlanDetail> mesProductPlanDetailList;
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setProductOrderId(Long productOrderId)
{
this.productOrderId = productOrderId;
}
public Long getProductOrderId()
{
return productOrderId;
}
public void setPlanCode(String planCode)
{
this.planCode = planCode;
}
public String getPlanCode()
{
return planCode;
}
public void setDispatchCode(String dispatchCode)
{
this.dispatchCode = dispatchCode;
}
public String getDispatchCode()
{
return dispatchCode;
}
public void setMaterialId(Long materialId)
{
this.materialId = materialId;
}
public Long getMaterialId()
{
return materialId;
}
public void setMaterialBomId(Long materialBomId)
{
this.materialBomId = materialBomId;
}
public Long getMaterialBomId()
{
return materialBomId;
}
public void setProcessId(Long processId)
{
this.processId = processId;
}
public Long getProcessId()
{
return processId;
}
public void setProcessOrder(Long processOrder)
{
this.processOrder = processOrder;
}
public Long getProcessOrder()
{
return processOrder;
}
public void setLastProcessId(Long lastProcessId)
{
this.lastProcessId = lastProcessId;
}
public Long getLastProcessId()
{
return lastProcessId;
}
public void setStationId(Long stationId)
{
this.stationId = stationId;
}
public Long getStationId()
{
return stationId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setProductionTime(Long productionTime)
{
this.productionTime = productionTime;
}
public Long getProductionTime()
{
return productionTime;
}
public void setPlanAmount(BigDecimal planAmount)
{
this.planAmount = planAmount;
}
public BigDecimal getPlanAmount()
{
return planAmount;
}
public void setCompleteAmount(BigDecimal completeAmount)
{
this.completeAmount = completeAmount;
}
public BigDecimal getCompleteAmount()
{
return completeAmount;
}
public void setPlanBeginTime(Date planBeginTime)
{
this.planBeginTime = planBeginTime;
}
public Date getPlanBeginTime()
{
return planBeginTime;
}
public void setPlanEndTime(Date planEndTime)
{
this.planEndTime = planEndTime;
}
public Date getPlanEndTime()
{
return planEndTime;
}
public void setRealBeginTime(Date realBeginTime)
{
this.realBeginTime = realBeginTime;
}
public Date getRealBeginTime()
{
return realBeginTime;
}
public void setRealEndTime(Date realEndTime)
{
this.realEndTime = realEndTime;
}
public Date getRealEndTime()
{
return realEndTime;
}
public void setAttachId(String attachId)
{
this.attachId = attachId;
}
public String getAttachId()
{
return attachId;
}
public void setPlanStatus(String planStatus)
{
this.planStatus = planStatus;
}
public String getPlanStatus()
{
return planStatus;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
{
return isFlag;
}
public List<MesProductPlanDetail> getMesProductPlanDetailList()
{
return mesProductPlanDetailList;
}
public void setMesProductPlanDetailList(List<MesProductPlanDetail> mesProductPlanDetailList)
{
this.mesProductPlanDetailList = mesProductPlanDetailList;
}
public Date getPlanDeliveryDate() {
return planDeliveryDate;
}
public void setPlanDeliveryDate(Date planDeliveryDate) {
this.planDeliveryDate = planDeliveryDate;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("planId", getPlanId())
.append("productOrderId", getProductOrderId())
.append("planCode", getPlanCode())
.append("dispatchCode", getDispatchCode())
.append("materialId", getMaterialId())
.append("materialBomId", getMaterialBomId())
.append("processId", getProcessId())
.append("processOrder", getProcessOrder())
.append("lastProcessId", getLastProcessId())
.append("stationId", getStationId())
.append("userId", getUserId())
.append("productionTime", getProductionTime())
.append("planAmount", getPlanAmount())
.append("completeAmount", getCompleteAmount())
.append("planBeginTime", getPlanBeginTime())
.append("planEndTime", getPlanEndTime())
.append("realBeginTime", getRealBeginTime())
.append("realEndTime", getRealEndTime())
.append("attachId", getAttachId())
.append("planStatus", getPlanStatus())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("mesProductPlanDetailList", getMesProductPlanDetailList())
.toString();
}
}

@ -0,0 +1,172 @@
package com.hw.mes.domain;
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.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* mes_product_plan_detail
*
* @author xins
* @date 2024-02-21
*/
public class MesProductPlanDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long planDetailId;
/** 明细编号 */
@Excel(name = "明细编号")
private String planDetailCode;
/** 生产计划ID */
@Excel(name = "生产计划ID")
private Long planId;
/** 计划编号,关联mes_product_plan_info的plan_code */
@Excel(name = "计划编号,关联mes_product_plan_info的plan_code")
private String planCode;
/** 操作人员ID关联sys_user的user_id;如果后续一个工位有多个人,则一个明细有多个人执行,则可以保存执行记录信息,需要新增表 */
@Excel(name = "操作人员ID关联sys_user的user_id;如果后续一个工位有多个人,则一个明细有多个人执行,则可以保存执行记录信息,需要新增表")
private Long userId;
/** 操作人员名称关联sys_user的user_name */
@Excel(name = "操作人员名称关联sys_user的user_name")
private String userName;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realBeginTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realEndTime;
/** 明细状态1-未开始2-已开始3-已完成 */
@Excel(name = "明细状态1-未开始2-已开始3-已完成")
private String planDetailStatus;
/** 是否标识1-是0-否 */
@Excel(name = "是否标识1-是0-否")
private String isFlag;
public void setPlanDetailId(Long planDetailId)
{
this.planDetailId = planDetailId;
}
public Long getPlanDetailId()
{
return planDetailId;
}
public void setPlanDetailCode(String planDetailCode)
{
this.planDetailCode = planDetailCode;
}
public String getPlanDetailCode()
{
return planDetailCode;
}
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setPlanCode(String planCode)
{
this.planCode = planCode;
}
public String getPlanCode()
{
return planCode;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setRealBeginTime(Date realBeginTime)
{
this.realBeginTime = realBeginTime;
}
public Date getRealBeginTime()
{
return realBeginTime;
}
public void setRealEndTime(Date realEndTime)
{
this.realEndTime = realEndTime;
}
public Date getRealEndTime()
{
return realEndTime;
}
public void setPlanDetailStatus(String planDetailStatus)
{
this.planDetailStatus = planDetailStatus;
}
public String getPlanDetailStatus()
{
return planDetailStatus;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
{
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("planDetailId", getPlanDetailId())
.append("planDetailCode", getPlanDetailCode())
.append("planId", getPlanId())
.append("planCode", getPlanCode())
.append("userId", getUserId())
.append("userName", getUserName())
.append("realBeginTime", getRealBeginTime())
.append("realEndTime", getRealEndTime())
.append("planDetailStatus", getPlanDetailStatus())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,34 @@
package com.hw.mes.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description:VO
* @ProjectName:HwMes
* @Author:xins
* @Date:2024-02-22 9:41
* @Version:1.0
*/
@Data
public class MesProductPlanDetailVo {
//生产计划ID
@NotNull(message = "生产计划ID必须输入")
private Long planId;
//成品批次
@NotNull(message = "物料ID必须输入")
private Long materialId;
//成品批次
@NotNull(message = "物料BomID必须输入")
private Long materialBomId;
//成品批次
@NotBlank(message = "计划数量必须输入")
private String planAmount;
}

@ -0,0 +1,61 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesMaterialCheckResult;
/**
* Mapper
*
* @author xins
* @date 2024-02-21
*/
public interface MesMaterialCheckResultMapper
{
/**
*
*
* @param materialCheckResultId
* @return
*/
public MesMaterialCheckResult selectMesMaterialCheckResultByMaterialCheckResultId(Long materialCheckResultId);
/**
*
*
* @param mesMaterialCheckResult
* @return
*/
public List<MesMaterialCheckResult> selectMesMaterialCheckResultList(MesMaterialCheckResult mesMaterialCheckResult);
/**
*
*
* @param mesMaterialCheckResult
* @return
*/
public int insertMesMaterialCheckResult(MesMaterialCheckResult mesMaterialCheckResult);
/**
*
*
* @param mesMaterialCheckResult
* @return
*/
public int updateMesMaterialCheckResult(MesMaterialCheckResult mesMaterialCheckResult);
/**
*
*
* @param materialCheckResultId
* @return
*/
public int deleteMesMaterialCheckResultByMaterialCheckResultId(Long materialCheckResultId);
/**
*
*
* @param materialCheckResultIds
* @return
*/
public int deleteMesMaterialCheckResultByMaterialCheckResultIds(Long[] materialCheckResultIds);
}

@ -0,0 +1,61 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesProductPlanDetail;
/**
* Mapper
*
* @author xins
* @date 2024-02-21
*/
public interface MesProductPlanDetailMapper
{
/**
*
*
* @param planDetailId
* @return
*/
public MesProductPlanDetail selectMesProductPlanDetailByPlanDetailId(Long planDetailId);
/**
*
*
* @param mesProductPlanDetail
* @return
*/
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail);
/**
*
*
* @param mesProductPlanDetail
* @return
*/
public int insertMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
/**
*
*
* @param mesProductPlanDetail
* @return
*/
public int updateMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
/**
*
*
* @param planDetailId
* @return
*/
public int deleteMesProductPlanDetailByPlanDetailId(Long planDetailId);
/**
*
*
* @param planDetailIds
* @return
*/
public int deleteMesProductPlanDetailByPlanDetailIds(Long[] planDetailIds);
}

@ -0,0 +1,97 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail;
/**
* Mapper
*
* @author xins
* @date 2024-02-21
*/
public interface MesProductPlanMapper
{
/**
*
*
* @param planId
* @return
*/
public MesProductPlan selectMesProductPlanByPlanId(Long planId);
/**
*
*
* @param mesProductPlan
* @return
*/
public List<MesProductPlan> selectMesProductPlanList(MesProductPlan mesProductPlan);
/**
*
*
* @param mesProductPlan
* @return
*/
public int insertMesProductPlan(MesProductPlan mesProductPlan);
/**
*
*
* @param mesProductPlan
* @return
*/
public int updateMesProductPlan(MesProductPlan mesProductPlan);
/**
*
*
* @param planId
* @return
*/
public int deleteMesProductPlanByPlanId(Long planId);
/**
*
*
* @param planIds
* @return
*/
public int deleteMesProductPlanByPlanIds(Long[] planIds);
/**
*
*
* @param planIds
* @return
*/
public int deleteMesProductPlanDetailByPlanIds(Long[] planIds);
/**
*
*
* @param mesProductPlanDetailList
* @return
*/
public int batchMesProductPlanDetail(List<MesProductPlanDetail> mesProductPlanDetailList);
/**
*
*
* @param planId ID
* @return
*/
public int deleteMesProductPlanDetailByPlanId(Long planId);
/**
* ,Join product_orderbase_material
*
* @param mesProductPlan
* @return
*/
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan);
}

@ -0,0 +1,74 @@
package com.hw.mes.service;
import java.util.List;
import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
/**
* Service
*
* @author xins
* @date 2024-02-21
*/
public interface IMesProductPlanDetailService
{
/**
*
*
* @param planDetailId
* @return
*/
public MesProductPlanDetail selectMesProductPlanDetailByPlanDetailId(Long planDetailId);
/**
*
*
* @param mesProductPlanDetail
* @return
*/
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail);
/**
*
*
* @param mesProductPlanDetail
* @return
*/
public int insertMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
/**
*
*
* @param mesProductPlanDetail
* @return
*/
public int updateMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
/**
*
*
* @param planDetailIds
* @return
*/
public int deleteMesProductPlanDetailByPlanDetailIds(Long[] planDetailIds);
/**
*
*
* @param planDetailId
* @return
*/
public int deleteMesProductPlanDetailByPlanDetailId(Long planDetailId);
/**
*
*
* @param mesProductPlanDetailVo Vo
* @return
*/
public int insertMesProductPlanDetails(MesProductPlanDetailVo mesProductPlanDetailVo);
}

@ -0,0 +1,70 @@
package com.hw.mes.service;
import java.util.List;
import com.hw.mes.domain.MesProductPlan;
/**
* Service
*
* @author xins
* @date 2024-02-21
*/
public interface IMesProductPlanService
{
/**
*
*
* @param planId
* @return
*/
public MesProductPlan selectMesProductPlanByPlanId(Long planId);
/**
*
*
* @param mesProductPlan
* @return
*/
public List<MesProductPlan> selectMesProductPlanList(MesProductPlan mesProductPlan);
/**
*
*
* @param mesProductPlan
* @return
*/
public int insertMesProductPlan(MesProductPlan mesProductPlan);
/**
*
*
* @param mesProductPlan
* @return
*/
public int updateMesProductPlan(MesProductPlan mesProductPlan);
/**
*
*
* @param planIds
* @return
*/
public int deleteMesProductPlanByPlanIds(Long[] planIds);
/**
*
*
* @param planId
* @return
*/
public int deleteMesProductPlanByPlanId(Long planId);
/**
* Join product_orderbase_material
*
* @param mesProductPlan
* @return
*/
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan);
}

@ -0,0 +1,116 @@
package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesProductPlanDetailMapper;
import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.service.IMesProductPlanDetailService;
/**
* Service
*
* @author xins
* @date 2024-02-21
*/
@Service
public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailService
{
@Autowired
private MesProductPlanDetailMapper mesProductPlanDetailMapper;
/**
*
*
* @param planDetailId
* @return
*/
@Override
public MesProductPlanDetail selectMesProductPlanDetailByPlanDetailId(Long planDetailId)
{
return mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(planDetailId);
}
/**
*
*
* @param mesProductPlanDetail
* @return
*/
@Override
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail)
{
return mesProductPlanDetailMapper.selectMesProductPlanDetailList(mesProductPlanDetail);
}
/**
*
*
* @param mesProductPlanDetail
* @return
*/
@Override
public int insertMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail)
{
mesProductPlanDetail.setCreateTime(DateUtils.getNowDate());
return mesProductPlanDetailMapper.insertMesProductPlanDetail(mesProductPlanDetail);
}
/**
*
*
* @param mesProductPlanDetail
* @return
*/
@Override
public int updateMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail)
{
mesProductPlanDetail.setUpdateTime(DateUtils.getNowDate());
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}
/**
*
*
* @param planDetailIds
* @return
*/
@Override
public int deleteMesProductPlanDetailByPlanDetailIds(Long[] planDetailIds)
{
return mesProductPlanDetailMapper.deleteMesProductPlanDetailByPlanDetailIds(planDetailIds);
}
/**
*
*
* @param planDetailId
* @return
*/
@Override
public int deleteMesProductPlanDetailByPlanDetailId(Long planDetailId)
{
return mesProductPlanDetailMapper.deleteMesProductPlanDetailByPlanDetailId(planDetailId);
}
/**
*
*
* @param mesProductPlanDetailVo Vo
* @return
*/
@Override
public int insertMesProductPlanDetails(MesProductPlanDetailVo mesProductPlanDetailVo)
{
// mesProductPlanDetail.setCreateTime(DateUtils.getNowDate());
// return mesProductPlanDetailMapper.insertMesProductPlanDetail(mesProductPlanDetail);
// MesProductPlan mesProductPlan
return 1;
}
}

@ -0,0 +1,156 @@
package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.hw.common.core.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.mapper.MesProductPlanMapper;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.service.IMesProductPlanService;
/**
* Service
*
* @author xins
* @date 2024-02-21
*/
@Service
public class MesProductPlanServiceImpl implements IMesProductPlanService
{
@Autowired
private MesProductPlanMapper mesProductPlanMapper;
/**
*
*
* @param planId
* @return
*/
@Override
public MesProductPlan selectMesProductPlanByPlanId(Long planId)
{
return mesProductPlanMapper.selectMesProductPlanByPlanId(planId);
}
/**
*
*
* @param mesProductPlan
* @return
*/
@Override
public List<MesProductPlan> selectMesProductPlanList(MesProductPlan mesProductPlan)
{
return mesProductPlanMapper.selectMesProductPlanList(mesProductPlan);
}
/**
*
*
* @param mesProductPlan
* @return
*/
@Transactional
@Override
public int insertMesProductPlan(MesProductPlan mesProductPlan)
{
mesProductPlan.setCreateTime(DateUtils.getNowDate());
int rows = mesProductPlanMapper.insertMesProductPlan(mesProductPlan);
insertMesProductPlanDetail(mesProductPlan);
return rows;
}
/**
*
*
* @param mesProductPlan
* @return
*/
@Transactional
@Override
public int updateMesProductPlan(MesProductPlan mesProductPlan)
{
mesProductPlan.setUpdateTime(DateUtils.getNowDate());
mesProductPlanMapper.deleteMesProductPlanDetailByPlanId(mesProductPlan.getPlanId());
insertMesProductPlanDetail(mesProductPlan);
return mesProductPlanMapper.updateMesProductPlan(mesProductPlan);
}
/**
*
*
* @param planIds
* @return
*/
@Transactional
@Override
public int deleteMesProductPlanByPlanIds(Long[] planIds)
{
mesProductPlanMapper.deleteMesProductPlanDetailByPlanIds(planIds);
return mesProductPlanMapper.deleteMesProductPlanByPlanIds(planIds);
}
/**
*
*
* @param planId
* @return
*/
@Transactional
@Override
public int deleteMesProductPlanByPlanId(Long planId)
{
mesProductPlanMapper.deleteMesProductPlanDetailByPlanId(planId);
return mesProductPlanMapper.deleteMesProductPlanByPlanId(planId);
}
/**
*
*
* @param mesProductPlan
*/
public void insertMesProductPlanDetail(MesProductPlan mesProductPlan)
{
List<MesProductPlanDetail> mesProductPlanDetailList = mesProductPlan.getMesProductPlanDetailList();
Long planId = mesProductPlan.getPlanId();
if (StringUtils.isNotNull(mesProductPlanDetailList))
{
List<MesProductPlanDetail> list = new ArrayList<MesProductPlanDetail>();
for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList)
{
mesProductPlanDetail.setPlanId(planId);
list.add(mesProductPlanDetail);
}
if (list.size() > 0)
{
mesProductPlanMapper.batchMesProductPlanDetail(list);
}
}
}
/**
* Join product_orderbase_material
*
* @param mesProductPlan
* @return
*/
@Override
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan)
{
Long stationId = SecurityUtils.getStationd();
System.out.println("stationId: " + stationId);
return mesProductPlanMapper.selectMesProductPlanJoinList(mesProductPlan);
}
}

@ -0,0 +1,84 @@
<?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.hw.mes.mapper.MesMaterialCheckResultMapper">
<resultMap type="MesMaterialCheckResult" id="MesMaterialCheckResultResult">
<result property="materialCheckResultId" column="material_check_result_id" />
<result property="planId" column="plan_id" />
<result property="planDetailId" column="plan_detail_id" />
<result property="materialId" column="material_id" />
<result property="standardAmount" column="standard_amount" />
<result property="checkAmount" column="check_amount" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectMesMaterialCheckResultVo">
select material_check_result_id, plan_id, plan_detail_id, material_id, standard_amount, check_amount, update_by, update_time from mes_material_check_result
</sql>
<select id="selectMesMaterialCheckResultList" parameterType="MesMaterialCheckResult" resultMap="MesMaterialCheckResultResult">
<include refid="selectMesMaterialCheckResultVo"/>
<where>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planDetailId != null "> and plan_detail_id = #{planDetailId}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="standardAmount != null "> and standard_amount = #{standardAmount}</if>
<if test="checkAmount != null "> and check_amount = #{checkAmount}</if>
</where>
</select>
<select id="selectMesMaterialCheckResultByMaterialCheckResultId" parameterType="Long" resultMap="MesMaterialCheckResultResult">
<include refid="selectMesMaterialCheckResultVo"/>
where material_check_result_id = #{materialCheckResultId}
</select>
<insert id="insertMesMaterialCheckResult" parameterType="MesMaterialCheckResult" useGeneratedKeys="true" keyProperty="materialCheckResultId">
insert into mes_material_check_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">plan_id,</if>
<if test="planDetailId != null">plan_detail_id,</if>
<if test="materialId != null">material_id,</if>
<if test="standardAmount != null">standard_amount,</if>
<if test="checkAmount != null">check_amount,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planId != null">#{planId},</if>
<if test="planDetailId != null">#{planDetailId},</if>
<if test="materialId != null">#{materialId},</if>
<if test="standardAmount != null">#{standardAmount},</if>
<if test="checkAmount != null">#{checkAmount},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateMesMaterialCheckResult" parameterType="MesMaterialCheckResult">
update mes_material_check_result
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">plan_id = #{planId},</if>
<if test="planDetailId != null">plan_detail_id = #{planDetailId},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
<if test="checkAmount != null">check_amount = #{checkAmount},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where material_check_result_id = #{materialCheckResultId}
</update>
<delete id="deleteMesMaterialCheckResultByMaterialCheckResultId" parameterType="Long">
delete from mes_material_check_result where material_check_result_id = #{materialCheckResultId}
</delete>
<delete id="deleteMesMaterialCheckResultByMaterialCheckResultIds" parameterType="String">
delete from mes_material_check_result where material_check_result_id in
<foreach item="materialCheckResultId" collection="array" open="(" separator="," close=")">
#{materialCheckResultId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,116 @@
<?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.hw.mes.mapper.MesProductPlanDetailMapper">
<resultMap type="MesProductPlanDetail" id="MesProductPlanDetailResult">
<result property="planDetailId" column="plan_detail_id" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="planId" column="plan_id" />
<result property="planCode" column="plan_code" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="realBeginTime" column="real_begin_time" />
<result property="realEndTime" column="real_end_time" />
<result property="planDetailStatus" column="plan_detail_status" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectMesProductPlanDetailVo">
select plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan_detail
</sql>
<select id="selectMesProductPlanDetailList" parameterType="MesProductPlanDetail" resultMap="MesProductPlanDetailResult">
<include refid="selectMesProductPlanDetailVo"/>
<where>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="realBeginTime != null "> and real_begin_time = #{realBeginTime}</if>
<if test="realEndTime != null "> and real_end_time = #{realEndTime}</if>
<if test="planDetailStatus != null and planDetailStatus != ''"> and plan_detail_status = #{planDetailStatus}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectMesProductPlanDetailByPlanDetailId" parameterType="Long" resultMap="MesProductPlanDetailResult">
<include refid="selectMesProductPlanDetailVo"/>
where plan_detail_id = #{planDetailId}
</select>
<insert id="insertMesProductPlanDetail" parameterType="MesProductPlanDetail" useGeneratedKeys="true" keyProperty="planDetailId">
insert into mes_product_plan_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code,</if>
<if test="planId != null">plan_id,</if>
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="userId != null">user_id,</if>
<if test="userName != null">user_name,</if>
<if test="realBeginTime != null">real_begin_time,</if>
<if test="realEndTime != null">real_end_time,</if>
<if test="planDetailStatus != null and planDetailStatus != ''">plan_detail_status,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="remark != null">remark,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planDetailCode != null and planDetailCode != ''">#{planDetailCode},</if>
<if test="planId != null">#{planId},</if>
<if test="planCode != null and planCode != ''">#{planCode},</if>
<if test="userId != null">#{userId},</if>
<if test="userName != null">#{userName},</if>
<if test="realBeginTime != null">#{realBeginTime},</if>
<if test="realEndTime != null">#{realEndTime},</if>
<if test="planDetailStatus != null and planDetailStatus != ''">#{planDetailStatus},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="remark != null">#{remark},</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>
</trim>
</insert>
<update id="updateMesProductPlanDetail" parameterType="MesProductPlanDetail">
update mes_product_plan_detail
<trim prefix="SET" suffixOverrides=",">
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code = #{planDetailCode},</if>
<if test="planId != null">plan_id = #{planId},</if>
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
<if test="planDetailStatus != null and planDetailStatus != ''">plan_detail_status = #{planDetailStatus},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</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>
</trim>
where plan_detail_id = #{planDetailId}
</update>
<delete id="deleteMesProductPlanDetailByPlanDetailId" parameterType="Long">
delete from mes_product_plan_detail where plan_detail_id = #{planDetailId}
</delete>
<delete id="deleteMesProductPlanDetailByPlanDetailIds" parameterType="String">
delete from mes_product_plan_detail where plan_detail_id in
<foreach item="planDetailId" collection="array" open="(" separator="," close=")">
#{planDetailId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,241 @@
<?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.hw.mes.mapper.MesProductPlanMapper">
<resultMap type="MesProductPlan" id="MesProductPlanResult">
<result property="planId" column="plan_id" />
<result property="productOrderId" column="product_order_id" />
<result property="planCode" column="plan_code" />
<result property="dispatchCode" column="dispatch_code" />
<result property="materialId" column="material_id" />
<result property="materialBomId" column="material_bom_id" />
<result property="processId" column="process_id" />
<result property="processOrder" column="process_order" />
<result property="lastProcessId" column="last_process_id" />
<result property="stationId" column="station_id" />
<result property="userId" column="user_id" />
<result property="productionTime" column="production_time" />
<result property="planAmount" column="plan_amount" />
<result property="completeAmount" column="complete_amount" />
<result property="planBeginTime" column="plan_begin_time" />
<result property="planEndTime" column="plan_end_time" />
<result property="realBeginTime" column="real_begin_time" />
<result property="realEndTime" column="real_end_time" />
<result property="attachId" column="attach_id" />
<result property="planStatus" column="plan_status" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<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="planDeliveryDate" column="plan_delivery_date" />
<result property="materialName" column="material_name" />
</resultMap>
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
<collection property="mesProductPlanDetailList" notNullColumn="sub_plan_detail_id" javaType="java.util.List" resultMap="MesProductPlanDetailResult" />
</resultMap>
<resultMap type="MesProductPlanDetail" id="MesProductPlanDetailResult">
<result property="planDetailId" column="sub_plan_detail_id" />
<result property="planDetailCode" column="sub_plan_detail_code" />
<result property="planId" column="sub_plan_id" />
<result property="planCode" column="sub_plan_code" />
<result property="userId" column="sub_user_id" />
<result property="userName" column="sub_user_name" />
<result property="realBeginTime" column="sub_real_begin_time" />
<result property="realEndTime" column="sub_real_end_time" />
<result property="planDetailStatus" column="sub_plan_detail_status" />
<result property="isFlag" column="sub_is_flag" />
<result property="remark" column="sub_remark" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
</resultMap>
<sql id="selectMesProductPlanVo">
select plan_id, product_order_id, plan_code, dispatch_code, material_id, material_bom_id, process_id, process_order, last_process_id, station_id, user_id, production_time, plan_amount, complete_amount, plan_begin_time, plan_end_time, real_begin_time, real_end_time, attach_id, plan_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan
</sql>
<select id="selectMesProductPlanList" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
<include refid="selectMesProductPlanVo"/>
<where>
<if test="productOrderId != null "> and product_order_id = #{productOrderId}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="dispatchCode != null and dispatchCode != ''"> and dispatch_code = #{dispatchCode}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="materialBomId != null "> and material_bom_id = #{materialBomId}</if>
<if test="processId != null "> and process_id = #{processId}</if>
<if test="processOrder != null "> and process_order = #{processOrder}</if>
<if test="lastProcessId != null "> and last_process_id = #{lastProcessId}</if>
<if test="stationId != null "> and station_id = #{stationId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="productionTime != null "> and production_time = #{productionTime}</if>
<if test="planAmount != null "> and plan_amount = #{planAmount}</if>
<if test="completeAmount != null "> and complete_amount = #{completeAmount}</if>
<if test="planBeginTime != null "> and plan_begin_time = #{planBeginTime}</if>
<if test="planEndTime != null "> and plan_end_time = #{planEndTime}</if>
<if test="realBeginTime != null "> and real_begin_time = #{realBeginTime}</if>
<if test="realEndTime != null "> and real_end_time = #{realEndTime}</if>
<if test="attachId != null and attachId != ''"> and attach_id = #{attachId}</if>
<if test="planStatus != null and planStatus != ''"> and plan_status = #{planStatus}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectMesProductPlanByPlanId" parameterType="Long" resultMap="MesProductPlanMesProductPlanDetailResult">
select a.plan_id, a.product_order_id, a.plan_code, a.dispatch_code, a.material_id, a.material_bom_id, a.process_id, a.process_order, a.last_process_id, a.station_id, a.user_id, a.production_time, a.plan_amount, a.complete_amount, a.plan_begin_time, a.plan_end_time, a.real_begin_time, a.real_end_time, a.attach_id, a.plan_status, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,
b.plan_detail_id as sub_plan_detail_id, b.plan_detail_code as sub_plan_detail_code, b.plan_id as sub_plan_id, b.plan_code as sub_plan_code, b.user_id as sub_user_id, b.user_name as sub_user_name, b.real_begin_time as sub_real_begin_time, b.real_end_time as sub_real_end_time, b.plan_detail_status as sub_plan_detail_status, b.is_flag as sub_is_flag, b.remark as sub_remark, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
from mes_product_plan a
left join mes_product_plan_detail b on b.plan_id = a.plan_id
where a.plan_id = #{planId}
</select>
<insert id="insertMesProductPlan" parameterType="MesProductPlan" useGeneratedKeys="true" keyProperty="planId">
insert into mes_product_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if>
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="dispatchCode != null and dispatchCode != ''">dispatch_code,</if>
<if test="materialId != null">material_id,</if>
<if test="materialBomId != null">material_bom_id,</if>
<if test="processId != null">process_id,</if>
<if test="processOrder != null">process_order,</if>
<if test="lastProcessId != null">last_process_id,</if>
<if test="stationId != null">station_id,</if>
<if test="userId != null">user_id,</if>
<if test="productionTime != null">production_time,</if>
<if test="planAmount != null">plan_amount,</if>
<if test="completeAmount != null">complete_amount,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_end_time,</if>
<if test="realBeginTime != null">real_begin_time,</if>
<if test="realEndTime != null">real_end_time,</if>
<if test="attachId != null">attach_id,</if>
<if test="planStatus != null and planStatus != ''">plan_status,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="remark != null">remark,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if>
<if test="planCode != null and planCode != ''">#{planCode},</if>
<if test="dispatchCode != null and dispatchCode != ''">#{dispatchCode},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialBomId != null">#{materialBomId},</if>
<if test="processId != null">#{processId},</if>
<if test="processOrder != null">#{processOrder},</if>
<if test="lastProcessId != null">#{lastProcessId},</if>
<if test="stationId != null">#{stationId},</if>
<if test="userId != null">#{userId},</if>
<if test="productionTime != null">#{productionTime},</if>
<if test="planAmount != null">#{planAmount},</if>
<if test="completeAmount != null">#{completeAmount},</if>
<if test="planBeginTime != null">#{planBeginTime},</if>
<if test="planEndTime != null">#{planEndTime},</if>
<if test="realBeginTime != null">#{realBeginTime},</if>
<if test="realEndTime != null">#{realEndTime},</if>
<if test="attachId != null">#{attachId},</if>
<if test="planStatus != null and planStatus != ''">#{planStatus},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="remark != null">#{remark},</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>
</trim>
</insert>
<update id="updateMesProductPlan" parameterType="MesProductPlan">
update mes_product_plan
<trim prefix="SET" suffixOverrides=",">
<if test="productOrderId != null">product_order_id = #{productOrderId},</if>
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
<if test="dispatchCode != null and dispatchCode != ''">dispatch_code = #{dispatchCode},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialBomId != null">material_bom_id = #{materialBomId},</if>
<if test="processId != null">process_id = #{processId},</if>
<if test="processOrder != null">process_order = #{processOrder},</if>
<if test="lastProcessId != null">last_process_id = #{lastProcessId},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="productionTime != null">production_time = #{productionTime},</if>
<if test="planAmount != null">plan_amount = #{planAmount},</if>
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
<if test="planBeginTime != null">plan_begin_time = #{planBeginTime},</if>
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
<if test="attachId != null">attach_id = #{attachId},</if>
<if test="planStatus != null and planStatus != ''">plan_status = #{planStatus},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</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>
</trim>
where plan_id = #{planId}
</update>
<delete id="deleteMesProductPlanByPlanId" parameterType="Long">
delete from mes_product_plan where plan_id = #{planId}
</delete>
<delete id="deleteMesProductPlanByPlanIds" parameterType="String">
delete from mes_product_plan where plan_id in
<foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId}
</foreach>
</delete>
<delete id="deleteMesProductPlanDetailByPlanIds" parameterType="String">
delete from mes_product_plan_detail where plan_id in
<foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId}
</foreach>
</delete>
<delete id="deleteMesProductPlanDetailByPlanId" parameterType="Long">
delete from mes_product_plan_detail where plan_id = #{planId}
</delete>
<insert id="batchMesProductPlanDetail">
insert into mes_product_plan_detail( plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.planDetailId}, #{item.planDetailCode}, #{item.planId}, #{item.planCode}, #{item.userId}, #{item.userName}, #{item.realBeginTime}, #{item.realEndTime}, #{item.planDetailStatus}, #{item.isFlag}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
<select id="selectMesProductPlanJoinList" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
select mpp.plan_id, mpp.product_order_id, mpp.plan_code, mpp.dispatch_code, mpp.material_id, mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,
mpp.station_id, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time, mpp.real_begin_time, mpp.real_end_time,
mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_name
from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id
left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id
<where>
<if test="stationId != null "> and mpp.station_id = #{stationId}</if>
<if test="planStatus != null and planStatus != ''"> and mpp.plan_status = #{planStatus}</if>
</where>
</select>
</mapper>

@ -368,7 +368,7 @@ public class WmsMobileController extends BaseController {
}
/**
*
*
*/
@Log(title = "成品出库明细", businessType = BusinessType.INSERT)
@PostMapping(("/confirmProductOutstockDetail"))

@ -28,15 +28,15 @@ public class WmsRawInstockVo {
@NotNull(message="数量必须输入")
private BigDecimal instockAmount;
//采购订单号
@NotBlank(message="采购订单号必须输入")
private String poNo;
//批次号必须输入
@NotBlank(message="批次号必须输入")
private String batchCode;
//数量
@NotNull(message="物料ID必须输入")
private Long materialId;
// //采购订单号
// @NotBlank(message="采购订单号必须输入")
// private String poNo;
//
// //批次号必须输入
// @NotBlank(message="批次号必须输入")
// private String batchCode;
//
// //数量
// @NotNull(message="物料ID必须输入")
// private Long materialId;
}

@ -65,6 +65,7 @@ public class WmsProductOutstockDetailServiceImpl implements IWmsProductOutstockD
/**
*
*
*
* @param wmsProductOutstockDetail
* @return

@ -165,11 +165,11 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) {
String materialBarcode = wmsRawInstockVo.getMaterialBarcode();
// R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
// MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
// if (baseBarcodeInfo == null) {
// throw new ServiceException("物料编码有误");
// }
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料编码有误");
}
String locationCode = wmsRawInstockVo.getLocationCode();
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);
@ -185,7 +185,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
WmsRawInstock wmsRawInstock = new WmsRawInstock();
wmsRawInstock.setWarehouseId(baseLocation.getWarehouseId());
wmsRawInstock.setLocationCode(locationCode);
wmsRawInstock.setPoNo(wmsRawInstockVo.getPoNo());
wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo());
wmsRawInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL);
wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_PURCHASE);
wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
@ -198,10 +198,10 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
int rows = wmsRawInstockMapper.insertWmsRawInstock(wmsRawInstock);
//插入明细
insertWmsRawInstockDetail(wmsRawInstock, wmsRawInstockVo);
insertWmsRawInstockDetail(wmsRawInstock, wmsRawInstockVo, baseBarcodeInfo);
//更新库存
updateRawStock(wmsRawInstock, wmsRawInstockVo, baseLocation, userName, currentDate);
updateRawStock(wmsRawInstock, wmsRawInstockVo, baseLocation, baseBarcodeInfo, userName, currentDate);
//todo同步erp
return rows;
@ -210,16 +210,18 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
/**
* 使
*
* @param wmsRawInstock
* @param wmsRawInstockVo
* @param baseBarcodeInfo
*/
public void insertWmsRawInstockDetail(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo) {
public void insertWmsRawInstockDetail(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, MesBaseBarcodeInfo baseBarcodeInfo) {
WmsRawInstockDetail wmsRawInstockDetail = new WmsRawInstockDetail();
wmsRawInstockDetail.setRawInstockId(wmsRawInstock.getRawInstockId());
wmsRawInstockDetail.setLocationCode(wmsRawInstock.getLocationCode());
wmsRawInstockDetail.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode());
wmsRawInstockDetail.setInstockBatch(wmsRawInstockVo.getBatchCode());
wmsRawInstockDetail.setMaterialId(wmsRawInstockVo.getMaterialId());
wmsRawInstockDetail.setInstockBatch(baseBarcodeInfo.getBatchCode());
wmsRawInstockDetail.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawInstockDetail.setPoNo(wmsRawInstock.getPoNo());
wmsRawInstockDetail.setPlanAmount(wmsRawInstockVo.getInstockAmount());
wmsRawInstockDetail.setInstockAmount(wmsRawInstockVo.getInstockAmount());
@ -239,9 +241,9 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
* @param userName
* @param currentDate
*/
public void updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation,
String userName, Date currentDate) {
String instockBatch = wmsRawInstockVo.getBatchCode();
public void updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation
, MesBaseBarcodeInfo baseBarcodeInfo, String userName, Date currentDate) {
String instockBatch = baseBarcodeInfo.getBatchCode();
String locationCode = wmsRawInstock.getLocationCode();
//判断此库位的数量限制,是否还能入库
@ -267,7 +269,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawStock.setWarehouseId(wmsRawInstock.getWarehouseId());
wmsRawStock.setLocationCode(locationCode);
wmsRawStock.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW);
wmsRawStock.setMaterialId(wmsRawInstockVo.getMaterialId());
wmsRawStock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawStock.setInstockBatch(instockBatch);
// wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate());
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());

@ -412,6 +412,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
@Transactional(rollbackFor = Exception.class)
@Override
public int applyRawReturn(WmsRawReturn wmsRawReturn) {
//申请退库不指定库位,申请退库的多个物料生成多条退库
List<WmsRawReturnDetail> rawReturnDetails = wmsRawReturn.getWmsRawReturnDetailList();
//根据物料ID分组获取总申请数量
Map<Long, BigDecimal> rawReturnDetailMap = rawReturnDetails.stream()

Loading…
Cancel
Save