diff --git a/hw-api/hw-api-system/src/main/java/com/hw/system/api/model/LoginUser.java b/hw-api/hw-api-system/src/main/java/com/hw/system/api/model/LoginUser.java index fdca496..41ecba8 100644 --- a/hw-api/hw-api-system/src/main/java/com/hw/system/api/model/LoginUser.java +++ b/hw-api/hw-api-system/src/main/java/com/hw/system/api/model/LoginUser.java @@ -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; + } } diff --git a/hw-auth/src/main/java/com/hw/auth/controller/TokenController.java b/hw-auth/src/main/java/com/hw/auth/controller/TokenController.java index 680ea49..7e04335 100644 --- a/hw-auth/src/main/java/com/hw/auth/controller/TokenController.java +++ b/hw-auth/src/main/java/com/hw/auth/controller/TokenController.java @@ -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)); } diff --git a/hw-auth/src/main/java/com/hw/auth/form/LoginBody.java b/hw-auth/src/main/java/com/hw/auth/form/LoginBody.java index 1c724e8..730d4d6 100644 --- a/hw-auth/src/main/java/com/hw/auth/form/LoginBody.java +++ b/hw-auth/src/main/java/com/hw/auth/form/LoginBody.java @@ -2,7 +2,7 @@ package com.hw.auth.form; /** * 用户登录对象 - * + * * @author ruoyi */ public class LoginBody @@ -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; + } } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/SecurityConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/SecurityConstants.java index 4340e04..d797c91 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/SecurityConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/SecurityConstants.java @@ -2,7 +2,7 @@ package com.hw.common.core.constant; /** * 权限相关通用常量 - * + * * @author ruoyi */ public class SecurityConstants @@ -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"; } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/context/SecurityContextHolder.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/context/SecurityContextHolder.java index b02078b..4553379 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/context/SecurityContextHolder.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/context/SecurityContextHolder.java @@ -8,7 +8,7 @@ import com.hw.common.core.text.Convert; import com.hw.common.core.utils.StringUtils; /** - * 获取当前线程变量中的 用户id、用户名称、Token等信息 + * 获取当前线程变量中的 用户id、用户名称、Token等信息 * 注意: 必须在网关通过请求头的方法传入,同时在HeaderInterceptor拦截器设置值。 否则这里无法获取 * * @author ruoyi @@ -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); + } + } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/JwtUtils.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/JwtUtils.java index 40badef..2a64ac1 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/JwtUtils.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/JwtUtils.java @@ -42,7 +42,7 @@ public class JwtUtils /** * 根据令牌获取用户标识 - * + * * @param token 令牌 * @return 用户ID */ @@ -54,7 +54,7 @@ public class JwtUtils /** * 根据令牌获取用户标识 - * + * * @param claims 身份信息 * @return 用户ID */ @@ -65,7 +65,7 @@ public class JwtUtils /** * 根据令牌获取用户ID - * + * * @param token 令牌 * @return 用户ID */ @@ -77,7 +77,7 @@ public class JwtUtils /** * 根据身份信息获取用户ID - * + * * @param claims 身份信息 * @return 用户ID */ @@ -88,7 +88,7 @@ public class JwtUtils /** * 根据令牌获取用户名 - * + * * @param token 令牌 * @return 用户名 */ @@ -100,7 +100,7 @@ public class JwtUtils /** * 根据身份信息获取用户名 - * + * * @param claims 身份信息 * @return 用户名 */ @@ -111,7 +111,7 @@ public class JwtUtils /** * 根据身份信息获取键值 - * + * * @param claims 身份信息 * @param key 键 * @return 值 @@ -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); + } + } diff --git a/hw-common/hw-common-security/src/main/java/com/hw/common/security/interceptor/HeaderInterceptor.java b/hw-common/hw-common-security/src/main/java/com/hw/common/security/interceptor/HeaderInterceptor.java index 337abdb..0c4de90 100644 --- a/hw-common/hw-common-security/src/main/java/com/hw/common/security/interceptor/HeaderInterceptor.java +++ b/hw-common/hw-common-security/src/main/java/com/hw/common/security/interceptor/HeaderInterceptor.java @@ -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)) diff --git a/hw-common/hw-common-security/src/main/java/com/hw/common/security/service/TokenService.java b/hw-common/hw-common-security/src/main/java/com/hw/common/security/service/TokenService.java index afc983b..734a69a 100644 --- a/hw-common/hw-common-security/src/main/java/com/hw/common/security/service/TokenService.java +++ b/hw-common/hw-common-security/src/main/java/com/hw/common/security/service/TokenService.java @@ -21,7 +21,7 @@ import com.hw.system.api.model.LoginUser; /** * token验证处理 - * + * * @author ruoyi */ @Component @@ -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 rspMap = new HashMap(); @@ -171,4 +172,4 @@ public class TokenService { return ACCESS_TOKEN + token; } -} \ No newline at end of file +} diff --git a/hw-common/hw-common-security/src/main/java/com/hw/common/security/utils/SecurityUtils.java b/hw-common/hw-common-security/src/main/java/com/hw/common/security/utils/SecurityUtils.java index 49ef850..53d335b 100644 --- a/hw-common/hw-common-security/src/main/java/com/hw/common/security/utils/SecurityUtils.java +++ b/hw-common/hw-common-security/src/main/java/com/hw/common/security/utils/SecurityUtils.java @@ -11,7 +11,7 @@ import com.hw.system.api.model.LoginUser; /** * 权限获取工具类 - * + * * @author ruoyi */ public class SecurityUtils @@ -40,6 +40,14 @@ public class SecurityUtils return SecurityContextHolder.getUserKey(); } + /** + * 获取工位ID + */ + public static Long getStationd() + { + return SecurityContextHolder.getStationId(); + } + /** * 获取登录用户信息 */ @@ -81,7 +89,7 @@ public class SecurityUtils /** * 是否为管理员 - * + * * @param userId 用户ID * @return 结果 */ diff --git a/hw-gateway/src/main/java/com/hw/gateway/filter/AuthFilter.java b/hw-gateway/src/main/java/com/hw/gateway/filter/AuthFilter.java index 450788b..b3bf281 100644 --- a/hw-gateway/src/main/java/com/hw/gateway/filter/AuthFilter.java +++ b/hw-gateway/src/main/java/com/hw/gateway/filter/AuthFilter.java @@ -23,7 +23,7 @@ import reactor.core.publisher.Mono; /** * 网关鉴权 - * + * * @author ruoyi */ @Component @@ -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,4 +134,4 @@ public class AuthFilter implements GlobalFilter, Ordered { return -200; } -} \ No newline at end of file +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java index 61ac188..c182a5e 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java @@ -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 fields = new ArrayList(); 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 alterTagVos = new ArrayList(); R tdReturnMsg; diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java index 6df615f..8ec5af8 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordAlarmDataServiceImpl.java @@ -363,8 +363,7 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService { tdSelectDto.setSchemaFieldValues(listTdfields); List 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"); //查出每个计量设备最新的一条实时数据 diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java index 944610f..597cfec 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java @@ -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 fields = new ArrayList(); List field2s = new ArrayList(); 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> dnbInstant = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER).getData().getDataList(); R historyData = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER); ReportPointDnb report = new ReportPointDnb(); diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java index af4d49f..5d9bef2 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java @@ -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 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 list = productPlanDetailService.selectMesProductPlanDetailList(mesProductPlanDetail); + return success(list); + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java new file mode 100644 index 0000000..30ce786 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java @@ -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 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 list = mesProductPlanService.selectMesProductPlanList(mesProductPlan); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialCheckResult.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialCheckResult.java new file mode 100644 index 0000000..eb9559d --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialCheckResult.java @@ -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(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java new file mode 100644 index 0000000..5c89c1b --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java @@ -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 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 getMesProductPlanDetailList() + { + return mesProductPlanDetailList; + } + + public void setMesProductPlanDetailList(List 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(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java new file mode 100644 index 0000000..8113098 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java @@ -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(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailVo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailVo.java new file mode 100644 index 0000000..82e43d6 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailVo.java @@ -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; + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialCheckResultMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialCheckResultMapper.java new file mode 100644 index 0000000..be7ce64 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialCheckResultMapper.java @@ -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 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); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java new file mode 100644 index 0000000..3e902e4 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java @@ -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 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); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanMapper.java new file mode 100644 index 0000000..ee5816e --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanMapper.java @@ -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 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 mesProductPlanDetailList); + + + /** + * 通过生产派工主键删除生产计划明细信息 + * + * @param planId 生产派工ID + * @return 结果 + */ + public int deleteMesProductPlanDetailByPlanId(Long planId); + + + + /** + * 查询生产派工列表,Join product_order和base_material + * + * @param mesProductPlan 生产派工 + * @return 生产派工集合 + */ + public List selectMesProductPlanJoinList(MesProductPlan mesProductPlan); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java new file mode 100644 index 0000000..31c1abc --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java @@ -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 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); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java new file mode 100644 index 0000000..bbc1b8c --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java @@ -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 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_order和base_material + * + * @param mesProductPlan 生产派工 + * @return 生产派工 + */ + public List selectMesProductPlanJoinList(MesProductPlan mesProductPlan); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java new file mode 100644 index 0000000..c178071 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -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 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; + } + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java new file mode 100644 index 0000000..25a253f --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java @@ -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 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 mesProductPlanDetailList = mesProductPlan.getMesProductPlanDetailList(); + Long planId = mesProductPlan.getPlanId(); + if (StringUtils.isNotNull(mesProductPlanDetailList)) + { + List list = new ArrayList(); + for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) + { + mesProductPlanDetail.setPlanId(planId); + list.add(mesProductPlanDetail); + } + if (list.size() > 0) + { + mesProductPlanMapper.batchMesProductPlanDetail(list); + } + } + } + + + + + + + + /** + * 查询生产派工列表Join product_order和base_material + * + * @param mesProductPlan 生产派工 + * @return 生产派工 + */ + @Override + public List selectMesProductPlanJoinList(MesProductPlan mesProductPlan) + { + Long stationId = SecurityUtils.getStationd(); + System.out.println("stationId: " + stationId); + return mesProductPlanMapper.selectMesProductPlanJoinList(mesProductPlan); + } + +} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialCheckResultMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialCheckResultMapper.xml new file mode 100644 index 0000000..aa18f14 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialCheckResultMapper.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into mes_material_check_result + + plan_id, + plan_detail_id, + material_id, + standard_amount, + check_amount, + update_by, + update_time, + + + #{planId}, + #{planDetailId}, + #{materialId}, + #{standardAmount}, + #{checkAmount}, + #{updateBy}, + #{updateTime}, + + + + + update mes_material_check_result + + plan_id = #{planId}, + plan_detail_id = #{planDetailId}, + material_id = #{materialId}, + standard_amount = #{standardAmount}, + check_amount = #{checkAmount}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where material_check_result_id = #{materialCheckResultId} + + + + delete from mes_material_check_result where material_check_result_id = #{materialCheckResultId} + + + + delete from mes_material_check_result where material_check_result_id in + + #{materialCheckResultId} + + + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml new file mode 100644 index 0000000..656617b --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into mes_product_plan_detail + + 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, + + + #{planDetailCode}, + #{planId}, + #{planCode}, + #{userId}, + #{userName}, + #{realBeginTime}, + #{realEndTime}, + #{planDetailStatus}, + #{isFlag}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update mes_product_plan_detail + + plan_detail_code = #{planDetailCode}, + plan_id = #{planId}, + plan_code = #{planCode}, + user_id = #{userId}, + user_name = #{userName}, + real_begin_time = #{realBeginTime}, + real_end_time = #{realEndTime}, + plan_detail_status = #{planDetailStatus}, + is_flag = #{isFlag}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where plan_detail_id = #{planDetailId} + + + + delete from mes_product_plan_detail where plan_detail_id = #{planDetailId} + + + + delete from mes_product_plan_detail where plan_detail_id in + + #{planDetailId} + + + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml new file mode 100644 index 0000000..4fa70bc --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into mes_product_plan + + 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, + + + #{productOrderId}, + #{planCode}, + #{dispatchCode}, + #{materialId}, + #{materialBomId}, + #{processId}, + #{processOrder}, + #{lastProcessId}, + #{stationId}, + #{userId}, + #{productionTime}, + #{planAmount}, + #{completeAmount}, + #{planBeginTime}, + #{planEndTime}, + #{realBeginTime}, + #{realEndTime}, + #{attachId}, + #{planStatus}, + #{isFlag}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update mes_product_plan + + product_order_id = #{productOrderId}, + plan_code = #{planCode}, + dispatch_code = #{dispatchCode}, + material_id = #{materialId}, + material_bom_id = #{materialBomId}, + process_id = #{processId}, + process_order = #{processOrder}, + last_process_id = #{lastProcessId}, + station_id = #{stationId}, + user_id = #{userId}, + production_time = #{productionTime}, + plan_amount = #{planAmount}, + complete_amount = #{completeAmount}, + plan_begin_time = #{planBeginTime}, + plan_end_time = #{planEndTime}, + real_begin_time = #{realBeginTime}, + real_end_time = #{realEndTime}, + attach_id = #{attachId}, + plan_status = #{planStatus}, + is_flag = #{isFlag}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where plan_id = #{planId} + + + + delete from mes_product_plan where plan_id = #{planId} + + + + delete from mes_product_plan where plan_id in + + #{planId} + + + + + delete from mes_product_plan_detail where plan_id in + + #{planId} + + + + + delete from mes_product_plan_detail where plan_id = #{planId} + + + + 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 + + ( #{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}) + + + + + + + + + + + + + + + + + + diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java index d79d1fd..2e346a4 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java @@ -368,7 +368,7 @@ public class WmsMobileController extends BaseController { } /** - * 人工成品出库确认 + * 人工成品出库确认(适用于成品仓库库管的成品出库确认) */ @Log(title = "成品出库明细", businessType = BusinessType.INSERT) @PostMapping(("/confirmProductOutstockDetail")) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawInstockVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawInstockVo.java index cd2423b..c543f22 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawInstockVo.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawInstockVo.java @@ -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; } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockDetailServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockDetailServiceImpl.java index 190e29c..f8e39be 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockDetailServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockDetailServiceImpl.java @@ -65,6 +65,7 @@ public class WmsProductOutstockDetailServiceImpl implements IWmsProductOutstockD /** * 新增成品出库记录明细 + * 人工成品出库确认(适用于成品仓库库管的成品出库确认) * * @param wmsProductOutstockDetail 成品出库记录明细 * @return 结果 diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java index 8726f94..71b2026 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java @@ -165,11 +165,11 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) { String materialBarcode = wmsRawInstockVo.getMaterialBarcode(); -// R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); -// MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); -// if (baseBarcodeInfo == null) { -// throw new ServiceException("物料编码有误"); -// } + R 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()); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java index ff39b36..f0545c1 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java @@ -412,6 +412,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { @Transactional(rollbackFor = Exception.class) @Override public int applyRawReturn(WmsRawReturn wmsRawReturn) { + //申请退库不指定库位,申请退库的多个物料生成多条退库 List rawReturnDetails = wmsRawReturn.getWmsRawReturnDetailList(); //根据物料ID分组获取总申请数量 Map rawReturnDetailMap = rawReturnDetails.stream()