Merge remote-tracking branch 'origin/master'

master
夜笙歌 3 days ago
commit a7c70e552d

@ -201,6 +201,8 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String rawFlag;
private String prdBarcodeInfo;
public String getLocationCode() {
return locationCode;
@ -651,6 +653,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
this.rawFlag = rawFlag;
}
public String getPrdBarcodeInfo() {
return prdBarcodeInfo;
}
public void setPrdBarcodeInfo(String prdBarcodeInfo) {
this.prdBarcodeInfo = prdBarcodeInfo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -295,6 +295,8 @@ public class MesPurchaseOrder extends BaseEntity {
private String projectNo;
private Long materialBomId;
public Long getSerialNumber() {
return serialNumber;
@ -760,6 +762,14 @@ public class MesPurchaseOrder extends BaseEntity {
this.projectNo = projectNo;
}
public Long getMaterialBomId() {
return materialBomId;
}
public void setMaterialBomId(Long materialBomId) {
this.materialBomId = materialBomId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -29,6 +29,10 @@ public class PrintContentVo {
public static final String PRINT_TEMPLATE_RAW = "raw";
public static final String PRINT_TEMPLATE_PRODUCT = "product";
public static final String PRINT_TEMPLATE_BIND = "bind";
public static final String PRINT_TEMPLATE_SMALL = "small";
public static final String SMALL_LABEL_KEY_TEXT = "text";
public static final String SMALL_LABEL_KEY_QRCODE = "qrcode";
private String key;

@ -34,6 +34,9 @@ public class WmsWarehouseMaterial extends BaseEntity
private String materialName;
private String materialSpec;
public Long getWarehouseMaterialId() {
return warehouseMaterialId;
}
@ -104,6 +107,14 @@ public class WmsWarehouseMaterial extends BaseEntity
this.materialName = materialName;
}
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,44 @@
package com.hw.common.core.constant;
/**
* @Description:
* @ClassName: PrintConstants
* @Author : xins
* @Date :2024-11-7 13:51
* @Version :1.0
*/
public class PrintConstants {
public static final int TYPE_TEXT = 1;
public static final int TYPE_CHECKBOX = 2;
public static final int TYPE_QRCODE = 3;
public static final String PRINT_TYPE_RAW_LABEL = "1";
public static final String PRINT_TYPE_PRODUCT_LABEL = "3";
public static final String RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME = "materialName";
public static final String RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE = "materialCode";
public static final String RAW_MATERIAL_LABEL_KEY_PO_NO = "poNo";
public static final String RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC = "materialSpec";
public static final String RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_YES = "preMaterialYes";
public static final String RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_NO = "preMaterialNo";
public static final String RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE = "saleOrderCode";
public static final String RAW_MATERIAL_LABEL_KEY_QTY = "qty";
public static final String RAW_MATERIAL_LABEL_KEY_BATCH_CODE = "batchCode";
public static final String RAW_MATERIAL_LABEL_KEY_QC_RESULT_YES = "qcResultYes";
public static final String RAW_MATERIAL_LABEL_KEY_QC_RESULT_NO = "qcResultNo";
public static final String RAW_MATERIAL_LABEL_KEY_QRCODE = "qrcode";
public static final String RAW_MATERIAL_LABEL_KEY_BARCODE = "barcode";
public static final String PRODUCT_PLAN_CODE = "productPlanCode";
public static final String PRINT_TEMPLATE_RAW = "raw";
public static final String PRINT_TEMPLATE_PRODUCT = "product";
public static final String PRINT_TEMPLATE_BIND = "bind";
public static final String PRINT_TEMPLATE_SMALL = "small";
public static final String SMALL_LABEL_KEY_TEXT = "text";
public static final String SMALL_LABEL_KEY_QRCODE = "qrcode";
}

@ -42,7 +42,7 @@ public class MailUtils {
// 发送邮件
Transport.send(message);
System.out.println("邮件已成功发送!");
// System.out.println("邮件已成功发送!");
} catch (MessagingException e) {
e.printStackTrace();
throw new RuntimeException(e);
@ -90,7 +90,7 @@ public class MailUtils {
// 发送邮件
Transport.send(message);
System.out.println("邮件已成功发送!");
// System.out.println("邮件已成功发送!");
} catch (MessagingException e) {
e.printStackTrace();
throw new RuntimeException(e);

@ -114,4 +114,30 @@ public class DmsBaseDeviceLedgerController extends BaseController
{
return toAjax(dmsBaseDeviceLedgerService.deleteDmsBaseDeviceLedgerByDeviceIds(deviceIds));
}
/**
*
*/
// @RequiresPermissions("dms:ledger:list")
@GetMapping("/listAll")
public AjaxResult listAll(DmsBaseDeviceLedger dmsBaseDeviceLedger)
{
List<DmsBaseDeviceLedger> list = dmsBaseDeviceLedgerService.selectDmsBaseDeviceLedgerList(dmsBaseDeviceLedger);
return success(list);
}
/**
*
*
* @param deviceCodes
* @return
*/
@RequiresPermissions("wms:ledger:printDeviceLabels")
@Log(title = "设备", businessType = BusinessType.PRINT)
@GetMapping(value = "/printDeviceLabels/{deviceCodes}")
public AjaxResult printDeviceLabels(@PathVariable String[] deviceCodes) {
return success(dmsBaseDeviceLedgerService.printLabels(deviceCodes));
}
}

@ -106,6 +106,6 @@ public class DmsBillsInspectInstanceActivityController extends BaseController
@GetMapping("/selectUserIdByDmsBillsInspectInstanceActivityId/{lubeInstanceId}/userId/{userId}")
public boolean selectUserIdByDmsBillsInspectInstanceActivityId(@PathVariable("lubeInstanceId") Long lubeInstanceId,@PathVariable("userId") Long userId){
boolean b = dmsBillsInspectInstanceActivityService.selectUserIdByDmsBillsInspectInstanceActivityId(lubeInstanceId, userId);
return b;
return true;
}
}

@ -80,6 +80,15 @@ public class DmsBillsInspectInstance extends BaseEntity
/**多个状态时使用,以,隔开*/
private String inspectStatusStr;
private String planInspectCode;
public String getPlanInspectCode()
{
return planInspectCode;
}
public void setPlanInspectCode(String planInspectCode)
{
this.planInspectCode = planInspectCode;
}
private List<DmsInspectInstanceDetail> dmsInspectInstanceDetailList;

@ -100,6 +100,8 @@ public class DmsFaultInstanceActivity extends BaseEntity
private List<String> fileUrls;
private List<DmsInstanceFile> dmsInstanceFileList;
public Long getWfLength() {
return wfLength;
}
@ -288,6 +290,14 @@ public class DmsFaultInstanceActivity extends BaseEntity
this.fileUrls = fileUrls;
}
public List<DmsInstanceFile> getDmsInstanceFileList() {
return dmsInstanceFileList;
}
public void setDmsInstanceFileList(List<DmsInstanceFile> dmsInstanceFileList) {
this.dmsInstanceFileList = dmsInstanceFileList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -33,6 +33,8 @@ public class DmsInstanceFile extends BaseEntity
//file-list中需要有url才能正确预览图片
private String url;
private String name;
public String getUrl() {
return url;
}
@ -78,6 +80,14 @@ public class DmsInstanceFile extends BaseEntity
return filePath;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -14,6 +14,7 @@ import com.hw.common.core.web.domain.BaseEntity;
* @author Open Platform
* @date 2024-01-17
*/
public class DmsPlanInspect extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -69,7 +70,14 @@ public class DmsPlanInspect extends BaseEntity
private Long timeLimitDays;
private Long timeLimitHours;
private String routeName;
public void setRouteName(String routeName) {
this.routeName = routeName;
}
public String getRouteName() {
return routeName;
}
public Long getTimeLimitDays() {

@ -2,6 +2,7 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsBaseInspectRoute;
import org.apache.ibatis.annotations.Param;
/**
* 线Mapper
@ -60,4 +61,6 @@ public interface DmsBaseInspectRouteMapper
public int deleteDmsBaseInspectRouteByInspectRouteIds(Long[] inspectRouteIds);
Long selectAmountByInspectRouteId(Long InspectRouteId);
String selectRouteName(@Param("inspectRouteId") Long inspectRouteId);
}

@ -80,5 +80,5 @@ public interface DmsInspectInstanceDetailProjectMapper
* */
List<DmsInspectInstanceDetailProject> selectDmsInspectInstanceDetailProjectByInspectInstanceId(@Param("inspectInstanceId") Long inspectInstanceId, @Param("lineStep") Long lineStep);
Long selectProjectByStandardId(String inspectStandard);
Long selectProjectByStandardId(@Param("inspectStandard") String inspectStandard);
}

@ -75,4 +75,13 @@ public interface DmsInstanceFileMapper
*
* */
int deleteDmsInstanceFileByUpdate(Long targetId);
/**
* ;
*
* @param dmsInstanceFile ;
* @return ;
*/
public List<DmsInstanceFile> selectDmsInstanceFileConvertList(DmsInstanceFile dmsInstanceFile);
}

@ -2,6 +2,7 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsPlanMaintDetail;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -74,4 +75,5 @@ public interface DmsPlanMaintDetailMapper
List<DmsPlanMaintDetail> selectDmsPlanMaintDetailListByPlanMaintId(Long planMaintId);
Long selectStandardId(@Param("stationId") Long stationId);
}

@ -69,4 +69,13 @@ public interface IDmsBaseDeviceLedgerService
* @return
*/
public DmsBaseDeviceLedger selectDmsBaseDeviceLedgerByDeviceCode(String deviceCode);
/**
*
*
* @param deviceCodes
* @return
*/
public int printLabels(String[] deviceCodes);
}

@ -1,12 +1,17 @@
package com.hw.dms.service.impl;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.hw.common.core.constant.PrintConstants;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBaseDeviceLedgerMapper;
import com.hw.dms.domain.DmsBaseDeviceLedger;
@ -23,6 +28,9 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
@Autowired
private DmsBaseDeviceLedgerMapper dmsBaseDeviceLedgerMapper;
@Autowired
private StringRedisTemplate redisTemplate;
/**
*
*
@ -60,7 +68,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
DeviceLedger.setDeviceCode(dmsBaseDeviceLedger.getDeviceCode());
List<DmsBaseDeviceLedger> dmsBaseDeviceLedgerList = dmsBaseDeviceLedgerMapper.
selectDmsBaseDeviceLedgerList(DeviceLedger);
if (dmsBaseDeviceLedgerList.size()>0) {
if (dmsBaseDeviceLedgerList.size() > 0) {
throw new ServiceException("设备编号已存在");
}
dmsBaseDeviceLedger.setCreateBy(loginUser.getUsername());
@ -131,4 +139,44 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
return dmsBaseDeviceLedger;
}
/**
*
*
* @param deviceCodes
* @return
*/
@Override
public int printLabels(String[] deviceCodes) {
com.alibaba.fastjson.JSONArray printInfoJsonArr = new com.alibaba.fastjson.JSONArray();
com.alibaba.fastjson.JSONObject printContentJson = new com.alibaba.fastjson.JSONObject();
for (String deviceCode : deviceCodes) {
com.alibaba.fastjson.JSONObject printInfoObject = new com.alibaba.fastjson.JSONObject();
if (StringUtils.isNotEmpty(deviceCode)) {
printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_TEXT, deviceCode);
printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_QRCODE, deviceCode);
printInfoJsonArr.add(printInfoObject);
} else {
throw new ServiceException("请选择有设备编号的设备进行打印");
}
}
String printTemplate = PrintConstants.PRINT_TEMPLATE_SMALL;
printContentJson.put("template", printTemplate);
printContentJson.put("printContent", printInfoJsonArr.toString());
try {
// String hostIp = IpUtils.getIpAddr();
String hostIp="10.10.3.119";
String printKey = "print_" + hostIp;
redisTemplate.opsForList().rightPush(printKey, printContentJson.toString());
redisTemplate.expire(printKey,1, TimeUnit.DAYS);
// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString());
} catch (Exception e) {
throw new ServiceException("打印失败:" + e.getMessage());
}
return 1;
}
}

@ -127,6 +127,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
dmsInspectInstanceDetail.setDeviceId(deviceId);
dmsInspectInstanceDetail.setInstanceDetailStatus("1");
dmsInspectInstanceDetail.setInspectStandard(dmsInspectRouteDetail.getInspectStandard());
dmsInspectInstanceDetail.setInspectStatus("0");
dmsInspectInstanceDetailMapper.insertDmsInspectInstanceDetail(dmsInspectInstanceDetail);
Long projectId = dmsInspectInstanceDetailMapper.selectProjectId(dmsInspectRouteDetail.getInspectStandard());
DmsInspectProjectDevice queryInspectProjectDevice = new DmsInspectProjectDevice();

@ -2,10 +2,13 @@ package com.hw.dms.service.impl;
import java.util.Arrays;
import java.util.List;
import com.hw.common.core.constant.DmsConstants;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.dms.domain.*;
import com.hw.dms.mapper.DmsBillsFaultInstanceMapper;
import com.hw.dms.mapper.DmsInstanceFileMapper;
import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -25,6 +28,8 @@ public class DmsFaultInstanceActivityServiceImpl implements IDmsFaultInstanceAct
private DmsFaultInstanceActivityMapper dmsFaultInstanceActivityMapper;
@Autowired
private DmsBillsFaultInstanceMapper dmsBillsFaultInstanceMapper;
@Autowired
private DmsInstanceFileMapper dmsInstanceFileMapper;
/**
*
@ -47,7 +52,16 @@ public class DmsFaultInstanceActivityServiceImpl implements IDmsFaultInstanceAct
@Override
public List<DmsFaultInstanceActivity> selectDmsFaultInstanceActivityList(DmsFaultInstanceActivity dmsFaultInstanceActivity)
{
return dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityList(dmsFaultInstanceActivity);
List<DmsFaultInstanceActivity> dmsFaultInstanceActivities = dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityList(dmsFaultInstanceActivity);
for(DmsFaultInstanceActivity dfia:dmsFaultInstanceActivities){
DmsInstanceFile queryInstanceFile = new DmsInstanceFile();
queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY);
queryInstanceFile.setTargetId(dfia.getInstanceActivityId());
List<DmsInstanceFile> dmsInstanceFiles = dmsInstanceFileMapper.selectDmsInstanceFileConvertList(queryInstanceFile);
dfia.setDmsInstanceFileList(dmsInstanceFiles);
}
return dmsFaultInstanceActivities;
}
/**

@ -96,6 +96,10 @@ public class DmsInspectInstanceDetailProjectServiceImpl implements IDmsInspectIn
@Override
public List<DmsInspectInstanceDetailProject> selectDmsInspectInstanceDetailProjectByInspectInstanceId(Long inspectInstanceId, Long lineStep) {
return dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInspectInstanceId(inspectInstanceId,lineStep);
List<DmsInspectInstanceDetailProject> detailProjects = dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInspectInstanceId(inspectInstanceId, lineStep);
for (DmsInspectInstanceDetailProject detailProject : detailProjects) {
detailProject.setProjectStepOrder(lineStep);
}
return detailProjects;
}
}

@ -85,6 +85,12 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
public List<DmsPlanInspect> selectDmsPlanInspectList(DmsPlanInspect dmsPlanInspect)
{
List<DmsPlanInspect> dmsPlanInspects = dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect);
for (DmsPlanInspect planInspect : dmsPlanInspects) {
String routeName = dmsBaseInspectRouteMapper.selectRouteName(planInspect.getInspectRouteId());
planInspect.setRouteName(routeName);
}
for (DmsPlanInspect d : dmsPlanInspects) {
Long timeLimit = d.getTimeLimit();
d.setTimeLimitDays(timeLimit / (24 * 60 * 60L));

@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="inspectProjectCode != null">inspect_project_code,</if>
<if test="inspectProject != null and inspectProject != ''">inspect_project,</if>
<if test="inspectProjectProperty != null and inspectProjectProperty != ''">inspect_project_property,</if>
<if test="inspectType != null and inspectType != ''">inspect_type,</if>
<if test="recordMethod != null">record_method,</if>
<if test="upLimit != null">up_limit,</if>
@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inspectProjectCode != null">#{inspectProjectCode},</if>
<if test="inspectProject != null and inspectProject != ''">#{inspectProject},</if>
<if test="inspectProjectProperty != null">#{inspectProjectProperty},</if>
<if test="inspectType != null and inspectType != ''">#{inspectType},</if>
<if test="recordMethod != null">#{recordMethod},</if>
<if test="upLimit != null">#{upLimit},</if>

@ -102,4 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAmountByInspectRouteId" parameterType="Long" resultType="Long">
select count(*) from dms_inspect_route_detail where inspect_route_id = #{inspectRouteId}
</select>
<select id="selectRouteName" resultType="java.lang.String" parameterType="java.lang.Long">
SELECT route_name routeName FROM `hwjy-cloud`.dms_base_inspect_route where inspect_route_id = #{inspectRouteId}
</select>
</mapper>

@ -210,6 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
</where>
order by dbfi.repair_instance_id desc
</select>

@ -26,32 +26,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDmsBillsInspectInstanceVo">
select inspect_instance_id, plan_inspect_id, wf_process_id, inspect_type, bills_inspect_code, plan_begin_time,plan_end_time, real_begin_time, real_end_time, inspect_status, is_flag, remark, create_by, create_time, update_by, update_time from dms_bills_inspect_instance
select
a.inspect_instance_id,
a.plan_inspect_id,
a.wf_process_id,
a.inspect_type,
a.bills_inspect_code,
a.plan_begin_time,
a.plan_end_time,
a.real_begin_time,
a.real_end_time,
a.inspect_status,
a.is_flag,
b.remark,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
b.plan_inspect_code,
b.performer
from
dms_bills_inspect_instance a left join dms_plan_inspect b on a.plan_inspect_id = b.plan_inspect_id
</sql>
<select id="selectDmsBillsInspectInstanceList" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
<include refid="selectDmsBillsInspectInstanceVo"/>
<where>
<if test="planInspectId != null "> and plan_inspect_id like concat('%',#{planInspectId},'%') </if>
<if test="inspectInstanceId != null "> and inspect_instance_id = #{inspectInstanceId}</if>
<if test="wfProcessId != null "> and wf_process_id = #{wfProcessId}</if>
<if test="inspectType != null and inspectType != ''"> and inspect_type = #{inspectType}</if>
<if test="billsInspectCode != null and billsInspectCode != ''"> and bills_inspect_code = #{billsInspectCode}</if>
<if test="planBeginTime != null "> and plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>plan_end_time </if>
<if test="realBeginTime != null "> and real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime}>real_end_time</if>
<if test="inspectStatus != null and inspectStatus != ''"> and inspect_status = #{inspectStatus}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
<if test="planInspectId != null "> and a.plan_inspect_id like concat('%',#{planInspectId},'%') </if>
<if test="inspectInstanceId != null "> and a.inspect_instance_id = #{inspectInstanceId}</if>
<if test="wfProcessId != null "> and a.wf_process_id = #{wfProcessId}</if>
<if test="inspectType != null and inspectType != ''"> and a.inspect_type = #{inspectType}</if>
<if test="billsInspectCode != null and billsInspectCode != ''"> and a.bills_inspect_code = #{billsInspectCode}</if>
<if test="planBeginTime != null "> and a.plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>a.plan_end_time </if>
<if test="realBeginTime != null "> and a.real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime}>a.real_end_time</if>
<if test="inspectStatus != null and inspectStatus != ''"> and a.inspect_status = #{inspectStatus}</if>
<if test="isFlag != null and isFlag != ''"> and a.is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectPoint" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
<include refid="selectDmsBillsInspectInstanceVo"/>
where inspect_type = 2
where a.inspect_type = 2
</select>
<select id="selectInspection" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
<include refid="selectDmsBillsInspectInstanceVo"/>
where inspect_type = 1
where a.inspect_type = 1
</select>
<select id="selectDmsBillsInspectInstanceByInspectInstanceId" parameterType="Long" resultMap="DmsBillsInspectInstanceResult">
@ -65,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInspectId != null">plan_inspect_id,</if>
<if test="wfProcessId != null">wf_process_id,</if>
<if test="inspectType != null and inspectType != ''">inspect_type,</if>
<if test="inspectRouteId != null and inspectRouteId != ''">inspect_route_id,</if>
<if test="billsInspectCode != null">bills_inspect_code,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_end_time,</if>
@ -82,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInspectId != null">#{planInspectId},</if>
<if test="wfProcessId != null">#{wfProcessId},</if>
<if test="inspectType != null and inspectType != ''">#{inspectType},</if>
<if test="inspectRouteId != null and inspectRouteId != ''">#{inspectRouteId},</if>
<if test="billsInspectCode != null">#{billsInspectCode},</if>
<if test="planBeginTime != null">#{planBeginTime},</if>
<if test="planEndTime != null">#{planEndTime},</if>
@ -141,10 +163,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectNewestDmsBillsInspectInstance" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
select dbii.inspect_instance_id, dbii.plan_inspect_id, dbii.wf_process_id, dbii.inspect_type, dbii.bills_inspect_code,
dbii.plan_begin_time,dbii.plan_end_time, dbii.real_begin_time, dbii.real_end_time, dbii.inspect_status,dbii.create_time,
dbir.route_name
from dms_bills_inspect_instance dbii left join dms_base_inspect_route dbir on dbii.inspect_route_id=dbir.inspect_route_id
select
dbii.inspect_instance_id,
dbii.plan_inspect_id,
dbii.wf_process_id,
dbii.inspect_type,
dbii.bills_inspect_code,
dbii.plan_begin_time,
dbii.plan_end_time,
dbii.real_begin_time,
dbii.real_end_time,
dbii.inspect_status,
dbii.create_time,
dbir.route_name,a.plan_inspect_code
from
dms_bills_inspect_instance dbii
left join dms_base_inspect_route dbir on
dbii.inspect_route_id = dbir.inspect_route_id left join dms_plan_inspect a on dbii.plan_inspect_id = a.plan_inspect_id
<where>
<if test="inspectRouteId != null "> and dbii.inspect_route_id = #{inspectRouteId}</if>

@ -29,23 +29,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDmsBillsMaintInstanceVo">
select maint_instance_id, plan_maint_id, wf_process_id, bills_maint_code, plan_begin_time, real_begin_time, plan_end_time, real_end_time, maint_status, maint_comp_rate, is_flag, remark, create_by, create_time, update_by, update_time from dms_bills_maint_instance
select
a.maint_instance_id,
a.plan_maint_id,
a.wf_process_id,
a.bills_maint_code,
a.plan_begin_time,
a.real_begin_time,
a.plan_end_time,
a.real_end_time,
a.maint_status,
a.maint_comp_rate,
a.is_flag,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
b.maint_supervisor,
b.remark
from
dms_bills_maint_instance a left join dms_plan_maint b on a.plan_maint_id = b.plan_maint_id
</sql>
<select id="selectDmsBillsMaintInstanceList" parameterType="DmsBillsMaintInstance" resultMap="DmsBillsMaintInstanceResult">
<include refid="selectDmsBillsMaintInstanceVo"/>
<where>
<if test="planMaintId != null "> and plan_maint_id = #{planMaintId}</if>
<if test="maintInstanceId != null "> and maint_instance_id = #{maintInstanceId}</if>
<if test="wfProcessId != null "> and wf_process_id = #{wfProcessId}</if>
<if test="billsMaintCode != null and billsMaintCode != ''"> and bills_maint_code like concat('%',#{billsMaintCode},'%') </if>
<if test="planBeginTime != null "> and plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>plan_end_time</if>
<if test="realBeginTime != null "> and real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime} > real_end_time</if>
<if test="maintStatus != null "> and maint_status = #{maintStatus}</if>
<if test="maintCompRate != null "> and maint_comp_rate = #{maintCompRate}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="planMaintId != null "> and a.plan_maint_id = #{planMaintId}</if>
<if test="maintInstanceId != null "> and a.maint_instance_id = #{maintInstanceId}</if>
<if test="wfProcessId != null "> and a.wf_process_id = #{wfProcessId}</if>
<if test="billsMaintCode != null and billsMaintCode != ''"> and a.bills_maint_code like concat('%',#{billsMaintCode},'%') </if>
<if test="planBeginTime != null "> and a.plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>a.plan_end_time</if>
<if test="realBeginTime != null "> and a.real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime} > a.real_end_time</if>
<if test="maintStatus != null "> and a.maint_status = #{maintStatus}</if>
<if test="maintCompRate != null "> and a.maint_comp_rate = #{maintCompRate}</if>
<if test="isFlag != null "> and a.is_flag = #{isFlag}</if>
</where>
</select>

@ -76,4 +76,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteDmsInstanceFileByUpdate">
delete from dms_instance_file where target_type = 1 and target_id =#{targetId}
</delete>
<select id="selectDmsInstanceFileConvertList" parameterType="DmsInstanceFile" resultMap="DmsInstanceFileResult">
select instance_file_id, target_type, target_id, file_path as name,file_path as url from dms_instance_file
<where>
<if test="targetType != null and targetType != ''"> and target_type = #{targetType}</if>
<if test="targetId != null "> and target_id = #{targetId}</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
</where>
</select>
</mapper>

@ -138,16 +138,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectDmsPlanMaintDetailListByPlanMaintId" parameterType="Long" resultMap="DmsPlanMaintDetailResult">
select a.plan_maint_detail_id, a.plan_maint_id, a.device_id, a.maint_station_id,
a.maint_standard_id, a.operation_description,b.device_name,c.maint_station_name,d.maint_protocol
from dms_plan_maint_detail a
left join dms_base_device_ledger b on a.device_id = b.device_id
left join dms_base_maint_station c on b.device_type_id = c.device_type_id
left join dms_base_maint_standard d on a.maint_station_id = d.maint_standard_id
where a.plan_maint_id = #{planMaintId}
select
a.plan_maint_detail_id,
a.plan_maint_id,
a.device_id,
a.maint_station_id,
a.maint_standard_id,
a.operation_description,
b.device_name,
c.maint_station_code,
d.maint_protocol
from
dms_plan_maint_detail a
left join dms_base_device_ledger b on
a.device_id = b.device_id
left join dms_base_maint_station c on
a.maint_station_id = c.maint_station_id
left join dms_base_maint_standard d on
a.maint_standard_id = d.maint_standard_id
where
a.plan_maint_id = #{planMaintId}
</select>
<select id="selectStationIdByCode" resultType="java.lang.Long" parameterType="java.lang.String">
SELECT x.maint_station_id FROM `hwjy-cloud`.dms_base_maint_station x where x.maint_station_code = #{maintStationCode}
</select>
<select id="selectStandardId" resultType="java.lang.Long" parameterType="java.lang.Long">
select
dbms.maint_standard_id
from
`hwjy-cloud`.dms_base_maint_station x left join dms_base_maint_standard dbms on x.protocol_code = dbms.maint_standard_code
where
x.maint_station_id = #{stationId}
</select>
</mapper>

@ -112,7 +112,7 @@ public class TWTempertureDataController extends BaseController
}
}
System.out.println(JSONArray.toJSONString(list));
// System.out.println(JSONArray.toJSONString(list));
return success(list);
}

@ -570,7 +570,7 @@ public class RecordAlarmDataServiceImpl implements IRecordAlarmDataService {
public R<Boolean> dnthAlarmTask() {
List<RecordAlarmRule> types = recordAlarmRuleMapper.selectEnergyTypes();
for (RecordAlarmRule rule : types) {
System.out.println("kaishile");
// System.out.println("kaishile");
Long timeRange = rule.getTimeRange();
if (timeRange == 0){
timeRange = 1L;

@ -63,7 +63,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @Description:ERP,使
*/
public int syncDeptInfoFromErp1(int startRow) throws Exception {
System.out.println("startRow=" + startRow);
// System.out.println("startRow=" + startRow);
K3CloudApi api = new K3CloudApi();
JSONObject queryJson = new JSONObject();
String formId = "BD_Department";
@ -88,7 +88,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
if (StringUtils.isEmpty(result)) {
return 1;
}
System.out.println("部门单据查询接口: " + result);
// System.out.println("部门单据查询接口: " + result);
JSONArray resultArray = JSONArray.parseArray(result);
if (resultArray == null) {
return 1;
@ -150,7 +150,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
// }
// }
System.out.println("size:" + resultArray.size());
// System.out.println("size:" + resultArray.size());
// System.out.println(resultArray);
//如果返回的数组的数量等于分页数量,则继续获取下一页数据
if (resultArray.size() == limit) {
@ -183,7 +183,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @Description:ERP,使
*/
public int syncUnitInfoFromErp(int startRow, String maxErpModifyDate) throws Exception {
System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate);
// System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate);
K3CloudApi api = new K3CloudApi();
JSONObject queryJson = new JSONObject();
String formId = "BD_Unit";
@ -201,7 +201,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
queryJson.put("SubSystemId", "");
//条件查询
System.out.println("maxErpModifyDate=" + maxErpModifyDate);
// System.out.println("maxErpModifyDate=" + maxErpModifyDate);
if (StringUtils.isNotEmpty(maxErpModifyDate)) {
String filterString = "FModifyDate >'" + maxErpModifyDate + "'";
queryJson.put("FilterString", filterString);
@ -274,7 +274,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
}
System.out.println("size:" + resultArray.size());
// System.out.println("size:" + resultArray.size());
// System.out.println(resultArray);
//如果返回的数组的数量等于分页数量,则继续获取下一页数据
if (resultArray.size() == limit) {
@ -305,7 +305,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
* @Description:ERP,使
*/
public int syncSupplierInfoFromErp(int startRow, String maxErpModifyDate) throws Exception {
System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate);
// System.out.println("startRow=" + startRow + ",,,maxErpModifyDate=" + maxErpModifyDate);
K3CloudApi api = new K3CloudApi();
JSONObject queryJson = new JSONObject();
String formId = "BD_Supplier";
@ -323,7 +323,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
queryJson.put("SubSystemId", "");
//条件查询
System.out.println("maxErpModifyDate=" + maxErpModifyDate);
// System.out.println("maxErpModifyDate=" + maxErpModifyDate);
if (StringUtils.isNotEmpty(maxErpModifyDate)) {
String filterString = "FModifyDate >'" + maxErpModifyDate + "'";
queryJson.put("FilterString", filterString);
@ -1042,7 +1042,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesPurchaseOrder.setTondBase(tondBase);
mesPurchaseOrder.setSupplierId(supplierId);
mesPurchaseOrder.setUpdateTime(currentDate);
mesPurchaseOrder.setOrderStatus(MesConstants.MES_PURCHASE_ORDER_STATUS_TOPURCHASE);
if (approveDate != null) {
mesPurchaseOrder.setApproveDate(conversionERPTime(approveDate));
@ -1066,6 +1066,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesPurchaseOrder.setPurchaseOrderId(existedPurchaseOrder.getPurchaseOrderId());
toUpdatePurchaseOrderList.add(mesPurchaseOrder);
} else {
mesPurchaseOrder.setOrderStatus(MesConstants.MES_PURCHASE_ORDER_STATUS_TOPURCHASE);
toInsertPurchaseOrderList.add(mesPurchaseOrder);
}
} catch (Exception e) {

@ -132,7 +132,7 @@ public class RyTask
}
public void syncRawMaterialDeliveryInformationToERP(){
System.out.println("++定时同步原材料库信息给ERP++syncRawMaterialDeliveryInformationToERP");
System.out.println("++定时同步原材料库信息给ERP++syncRawMaterialDeliveryInformationToERP");
remoteWmsService.synchronizeRawMaterialDeliveryInformationToERP(SecurityConstants.INNER);
}

@ -11,9 +11,11 @@ import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.MesSaleOrderRelate;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.domain.vo.*;
import com.hw.mes.service.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -51,6 +53,9 @@ public class MesApiController extends BaseController {
@Autowired
private IMesBaseMaterialInfoService mesBaseMaterialInfoService;
@Autowired
private IMesSaleOrderService mesSaleOrderService;
/**
*
@ -387,4 +392,12 @@ public class MesApiController extends BaseController {
public AjaxResult productPlanDetailContinue(@Validated @RequestBody MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
return success(productPlanDetailService.productPlanDetailContinue(mesProductPlanDetailPauseVo));
}
@GetMapping("/selectSaleOrderRelates")
public TableDataInfo selectSaleOrderRelates(MesSaleOrderRelate mesSaleOrderRelate) {
startPage();
List<MesSaleOrderRelate> list = mesSaleOrderService.selectMesSaleOrderRelateJoinProductList(mesSaleOrderRelate);
return getDataTable(list);
}
}

@ -10,6 +10,7 @@ import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseBindBarcode;
import com.hw.mes.api.domain.MesPurchaseOrder;
import com.hw.mes.domain.MesPrdBarcodeInfo;
import com.hw.mes.service.IMesBaseMaterialInfoService;
import com.hw.mes.service.IMesPurchaseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
@ -432,4 +433,14 @@ public class MesBaseBarcodeInfoController extends BaseController
return R.ok(mesBaseBarcodeInfoService.getBarcodeInfoByBindBarcode(bindBarcode));
}
/**
*
*/
@RequiresPermissions("mes:barcode:listPrdBarcode")
@GetMapping("/listPrdBarcode")
public AjaxResult listPrdBarcode(MesPrdBarcodeInfo mesPrdBarcodeInfo)
{
return success(mesBaseBarcodeInfoService.selectMesPrdBarcodeInfoList(mesPrdBarcodeInfo));
}
}

@ -295,4 +295,21 @@ public class MesProductPlanController extends BaseController {
}
}
/**
*
*/
@Log(title = "生产明细统计", businessType = BusinessType.START)
@PostMapping("/generateProduceStatisticsDetail")
// @InnerAuth
public R<?> generateProduceStatisticsDetail() {
try {
mesProductPlanDetailService.generateProduceStatisticsDetail("");
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.fail(e.getMessage());
}
}
}

@ -5,7 +5,10 @@ import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.domain.R;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.mes.api.domain.MesOrderBind;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.service.IMesMaterialBomService;
import com.hw.mes.service.IMesOrderBindService;
import com.hw.mes.service.IMesSaleOrderService;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,6 +46,9 @@ public class MesPurchaseOrderController extends BaseController
@Autowired
private IMesSaleOrderService mesSaleOrderService;
@Autowired
private IMesMaterialBomService mesMaterialBomService;
@Autowired
private IMesOrderBindService mesOrderBindService;
@ -78,7 +84,7 @@ public class MesPurchaseOrderController extends BaseController
@GetMapping(value = "/{purchaseOrderId}")
public AjaxResult getInfo(@PathVariable("purchaseOrderId") Long purchaseOrderId)
{
return success(mesPurchaseOrderService.selectMesPurchaseOrderByPurchaseOrderId(purchaseOrderId));
return success(mesPurchaseOrderService.selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(purchaseOrderId));
}
/**
@ -235,6 +241,18 @@ public class MesPurchaseOrderController extends BaseController
}
/**
* bom
* @param mesMaterialBom
* @return
*/
@GetMapping("/getMaterialBoms")
public AjaxResult getMaterialBoms(MesMaterialBom mesMaterialBom)
{
List<MesMaterialBom> list = mesMaterialBomService.selectMesMaterialBomList(mesMaterialBom);
return success(list);
}
/**
* raw_instock(group by)
@ -247,6 +265,17 @@ public class MesPurchaseOrderController extends BaseController
}
/**
*
*/
@GetMapping("/getOrderBinds")
public AjaxResult getOrderBinds(MesOrderBind mesOrderBind)
{
List<MesOrderBind> list = mesOrderBindService.selectMesOrderBindJoinProductList(mesOrderBind);
return success(list);
}
/**
*

@ -0,0 +1,140 @@
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_prd_barcode_info
*
* @author xins
* @date 2024-11-07
*/
public class MesPrdBarcodeInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long prdBarcodeId;
/** 小包条码内容 */
@Excel(name = "小包条码内容")
private String prdBarcodeInfo;
/** 喷码标识,1-已喷印0-未喷印 */
@Excel(name = "喷码标识,1-已喷印0-未喷印")
private String printFlag;
/** 关联mes_base_barcode_info里的大条码 */
@Excel(name = "关联mes_base_barcode_info里的大条码")
private String mesBarcodeInfo;
/** 绑定托盘号 */
@Excel(name = "绑定托盘号")
private String palletInfoCode;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date creatTime;
/** 喷印时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "喷印时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date printTime;
/** 绑定时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bindTime;
public void setPrdBarcodeId(Long prdBarcodeId)
{
this.prdBarcodeId = prdBarcodeId;
}
public Long getPrdBarcodeId()
{
return prdBarcodeId;
}
public void setPrdBarcodeInfo(String prdBarcodeInfo)
{
this.prdBarcodeInfo = prdBarcodeInfo;
}
public String getPrdBarcodeInfo()
{
return prdBarcodeInfo;
}
public void setPrintFlag(String printFlag)
{
this.printFlag = printFlag;
}
public String getPrintFlag()
{
return printFlag;
}
public void setMesBarcodeInfo(String mesBarcodeInfo)
{
this.mesBarcodeInfo = mesBarcodeInfo;
}
public String getMesBarcodeInfo()
{
return mesBarcodeInfo;
}
public void setPalletInfoCode(String palletInfoCode)
{
this.palletInfoCode = palletInfoCode;
}
public String getPalletInfoCode()
{
return palletInfoCode;
}
public void setCreatTime(Date creatTime)
{
this.creatTime = creatTime;
}
public Date getCreatTime()
{
return creatTime;
}
public void setPrintTime(Date printTime)
{
this.printTime = printTime;
}
public Date getPrintTime()
{
return printTime;
}
public void setBindTime(Date bindTime)
{
this.bindTime = bindTime;
}
public Date getBindTime()
{
return bindTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("prdBarcodeId", getPrdBarcodeId())
.append("prdBarcodeInfo", getPrdBarcodeInfo())
.append("printFlag", getPrintFlag())
.append("mesBarcodeInfo", getMesBarcodeInfo())
.append("palletInfoCode", getPalletInfoCode())
.append("creatTime", getCreatTime())
.append("printTime", getPrintTime())
.append("bindTime", getBindTime())
.toString();
}
}

@ -0,0 +1,339 @@
package com.hw.mes.domain;
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_produce_statistics_detail
*
* @author xins
* @date 2024-11-07
*/
public class MesProduceStatisticsDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long statisticsDetailId;
/** 生产工单ID */
@Excel(name = "生产工单ID")
private Long productOrderId;
/** 销售订单ID */
@Excel(name = "销售订单ID")
private Long saleOrderId;
/** 销售订单号 */
@Excel(name = "销售订单号")
private String saleorderCode;
/** 生产计划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 */
@Excel(name = "生产计划明细ID")
private Long planDetailId;
/** 生产计划明细编号 */
@Excel(name = "生产计划明细编号")
private String planDetailCode;
/** 生产成品ID */
@Excel(name = "生产成品ID")
private Long productId;
/** 生产成名编码 */
@Excel(name = "生产成名编码")
private String productCode;
/** 生产成品名称 */
@Excel(name = "生产成品名称")
private String productName;
/** 生产成品规格 */
@Excel(name = "生产成品规格")
private String productSpec;
/** 操作人员ID关联sys_user的user_id */
@Excel(name = "操作人员ID关联sys_user的user_id")
private Long userId;
/** 操作人员名称关联sys_user的nick_name */
@Excel(name = "操作人员名称关联sys_user的nick_name")
private String nickName;
/** 工序ID */
@Excel(name = "工序ID")
private Long processId;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 计划开始时间 */
@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;
/** 生产用时(单位S) */
@Excel(name = "生产用时(单位S)")
private Long produceTime;
/** 生产统计明细使用物料情况;车间生产派工信息 */
private List<MesProduceStatisticsDetailMaterial> mesProduceStatisticsDetailMaterialList;
public void setStatisticsDetailId(Long statisticsDetailId)
{
this.statisticsDetailId = statisticsDetailId;
}
public Long getStatisticsDetailId()
{
return statisticsDetailId;
}
public void setProductOrderId(Long productOrderId)
{
this.productOrderId = productOrderId;
}
public Long getProductOrderId()
{
return productOrderId;
}
public void setSaleOrderId(Long saleOrderId)
{
this.saleOrderId = saleOrderId;
}
public Long getSaleOrderId()
{
return saleOrderId;
}
public void setSaleorderCode(String saleorderCode)
{
this.saleorderCode = saleorderCode;
}
public String getSaleorderCode()
{
return saleorderCode;
}
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 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 setProductId(Long productId)
{
this.productId = productId;
}
public Long getProductId()
{
return productId;
}
public void setProductCode(String productCode)
{
this.productCode = productCode;
}
public String getProductCode()
{
return productCode;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setProductSpec(String productSpec)
{
this.productSpec = productSpec;
}
public String getProductSpec()
{
return productSpec;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setNickName(String nickName)
{
this.nickName = nickName;
}
public String getNickName()
{
return nickName;
}
public void setProcessId(Long processId)
{
this.processId = processId;
}
public Long getProcessId()
{
return processId;
}
public void setProcessName(String processName)
{
this.processName = processName;
}
public String getProcessName()
{
return processName;
}
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 setProduceTime(Long produceTime)
{
this.produceTime = produceTime;
}
public Long getProduceTime()
{
return produceTime;
}
public List<MesProduceStatisticsDetailMaterial> getMesProduceStatisticsDetailMaterialList()
{
return mesProduceStatisticsDetailMaterialList;
}
public void setMesProduceStatisticsDetailMaterialList(List<MesProduceStatisticsDetailMaterial> mesProduceStatisticsDetailMaterialList)
{
this.mesProduceStatisticsDetailMaterialList = mesProduceStatisticsDetailMaterialList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("statisticsDetailId", getStatisticsDetailId())
.append("productOrderId", getProductOrderId())
.append("saleOrderId", getSaleOrderId())
.append("saleorderCode", getSaleorderCode())
.append("planId", getPlanId())
.append("planCode", getPlanCode())
.append("planDetailId", getPlanDetailId())
.append("planDetailCode", getPlanDetailCode())
.append("productId", getProductId())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("productSpec", getProductSpec())
.append("userId", getUserId())
.append("nickName", getNickName())
.append("processId", getProcessId())
.append("processName", getProcessName())
.append("planBeginTime", getPlanBeginTime())
.append("planEndTime", getPlanEndTime())
.append("realBeginTime", getRealBeginTime())
.append("realEndTime", getRealEndTime())
.append("produceTime", getProduceTime())
.append("createTime", getCreateTime())
.append("mesProduceStatisticsDetailMaterialList", getMesProduceStatisticsDetailMaterialList())
.toString();
}
}

@ -0,0 +1,122 @@
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_produce_statistics_detail_material
*
* @author xins
* @date 2024-11-07
*/
public class MesProduceStatisticsDetailMaterial extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long statisticsDetailMaterialId;
/** 生产统计明细ID */
@Excel(name = "生产统计明细ID")
private Long statisticsDetailId;
/** 物料ID */
@Excel(name = "物料ID")
private Long materialId;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料规格 */
@Excel(name = "物料规格")
private String materialSpec;
/** 使用数量 */
@Excel(name = "使用数量")
private BigDecimal usedAmount;
public void setStatisticsDetailMaterialId(Long statisticsDetailMaterialId)
{
this.statisticsDetailMaterialId = statisticsDetailMaterialId;
}
public Long getStatisticsDetailMaterialId()
{
return statisticsDetailMaterialId;
}
public void setStatisticsDetailId(Long statisticsDetailId)
{
this.statisticsDetailId = statisticsDetailId;
}
public Long getStatisticsDetailId()
{
return statisticsDetailId;
}
public void setMaterialId(Long materialId)
{
this.materialId = materialId;
}
public Long getMaterialId()
{
return materialId;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialSpec(String materialSpec)
{
this.materialSpec = materialSpec;
}
public String getMaterialSpec()
{
return materialSpec;
}
public void setUsedAmount(BigDecimal usedAmount)
{
this.usedAmount = usedAmount;
}
public BigDecimal getUsedAmount()
{
return usedAmount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("statisticsDetailMaterialId", getStatisticsDetailMaterialId())
.append("statisticsDetailId", getStatisticsDetailId())
.append("materialId", getMaterialId())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialSpec", getMaterialSpec())
.append("usedAmount", getUsedAmount())
.toString();
}
}

@ -200,6 +200,9 @@ public class MesProductPlan extends BaseEntity
private Long productId;//针对内部生产5楼的成品ID
private String materialClassfication;
public Long getSaleOrderId() {
return saleOrderId;
}
@ -597,6 +600,14 @@ public class MesProductPlan extends BaseEntity
this.productId = productId;
}
public String getMaterialClassfication() {
return materialClassfication;
}
public void setMaterialClassfication(String materialClassfication) {
this.materialClassfication = materialClassfication;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -71,6 +71,11 @@ public class MesProductPlanDetail extends BaseEntity
private String rawMaterialBarcode;
private String statisticsFlag;//统计标识,用来查询判断条件使用
private String nickName;
public void setPlanDetailId(Long planDetailId)
{
this.planDetailId = planDetailId;
@ -211,6 +216,22 @@ public class MesProductPlanDetail extends BaseEntity
this.rawMaterialBarcode = rawMaterialBarcode;
}
public String getStatisticsFlag() {
return statisticsFlag;
}
public void setStatisticsFlag(String statisticsFlag) {
this.statisticsFlag = statisticsFlag;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -199,6 +199,8 @@ public class MesSaleOrder extends BaseEntity {
private Long virtualSaleOrderId;
private String parentIds;
public String getMaterialModel() {
return materialModel;
@ -464,6 +466,14 @@ public class MesSaleOrder extends BaseEntity {
this.virtualSaleOrderId = virtualSaleOrderId;
}
public String getParentIds() {
return parentIds;
}
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,145 @@
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_status_change_info
*
* @author xins
* @date 2024-11-07
*/
public class MesStatusChangeInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long statusChangeInfoId;
/** 变化类型1mes_product_order */
@Excel(name = "变化类型", readConverterExp = "1=mes_product_order")
private String changeType;
/** 变化ID */
@Excel(name = "变化ID")
private Long changeId;
/** 老状态 */
@Excel(name = "老状态")
private String oldStatus;
/** 新状态 */
@Excel(name = "新状态")
private String newStatus;
/** 创建人 */
@Excel(name = "创建人")
private String changeBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date changeTime;
private Long productOrderId;
private Long planDetailId;
public void setStatusChangeInfoId(Long statusChangeInfoId)
{
this.statusChangeInfoId = statusChangeInfoId;
}
public Long getStatusChangeInfoId()
{
return statusChangeInfoId;
}
public void setChangeType(String changeType)
{
this.changeType = changeType;
}
public String getChangeType()
{
return changeType;
}
public void setChangeId(Long changeId)
{
this.changeId = changeId;
}
public Long getChangeId()
{
return changeId;
}
public void setOldStatus(String oldStatus)
{
this.oldStatus = oldStatus;
}
public String getOldStatus()
{
return oldStatus;
}
public void setNewStatus(String newStatus)
{
this.newStatus = newStatus;
}
public String getNewStatus()
{
return newStatus;
}
public void setChangeBy(String changeBy)
{
this.changeBy = changeBy;
}
public String getChangeBy()
{
return changeBy;
}
public void setChangeTime(Date changeTime)
{
this.changeTime = changeTime;
}
public Date getChangeTime()
{
return changeTime;
}
public Long getProductOrderId() {
return productOrderId;
}
public void setProductOrderId(Long productOrderId) {
this.productOrderId = productOrderId;
}
public Long getPlanDetailId() {
return planDetailId;
}
public void setPlanDetailId(Long planDetailId) {
this.planDetailId = planDetailId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("statusChangeInfoId", getStatusChangeInfoId())
.append("changeType", getChangeType())
.append("changeId", getChangeId())
.append("oldStatus", getOldStatus())
.append("newStatus", getNewStatus())
.append("changeBy", getChangeBy())
.append("changeTime", getChangeTime())
.toString();
}
}

@ -60,11 +60,20 @@ public interface MesOrderBindMapper
public int deleteMesOrderBindByOrderBindIds(Long[] orderBindIds);
/**
* ,Join material
* ,Join material and product and saleorder
*
* @param mesOrderBind
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinList(MesOrderBind mesOrderBind);
/**
* ,Join product
*
* @param mesOrderBind
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind);
}

@ -0,0 +1,61 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesPrdBarcodeInfo;
/**
* Mapper
*
* @author xins
* @date 2024-11-07
*/
public interface MesPrdBarcodeInfoMapper
{
/**
*
*
* @param prdBarcodeId
* @return
*/
public MesPrdBarcodeInfo selectMesPrdBarcodeInfoByPrdBarcodeId(Long prdBarcodeId);
/**
*
*
* @param mesPrdBarcodeInfo
* @return
*/
public List<MesPrdBarcodeInfo> selectMesPrdBarcodeInfoList(MesPrdBarcodeInfo mesPrdBarcodeInfo);
/**
*
*
* @param mesPrdBarcodeInfo
* @return
*/
public int insertMesPrdBarcodeInfo(MesPrdBarcodeInfo mesPrdBarcodeInfo);
/**
*
*
* @param mesPrdBarcodeInfo
* @return
*/
public int updateMesPrdBarcodeInfo(MesPrdBarcodeInfo mesPrdBarcodeInfo);
/**
*
*
* @param prdBarcodeId
* @return
*/
public int deleteMesPrdBarcodeInfoByPrdBarcodeId(Long prdBarcodeId);
/**
*
*
* @param prdBarcodeIds
* @return
*/
public int deleteMesPrdBarcodeInfoByPrdBarcodeIds(Long[] prdBarcodeIds);
}

@ -0,0 +1,87 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesProduceStatisticsDetail;
import com.hw.mes.domain.MesProduceStatisticsDetailMaterial;
/**
* Mapper
*
* @author xins
* @date 2024-11-07
*/
public interface MesProduceStatisticsDetailMapper
{
/**
*
*
* @param statisticsDetailId
* @return
*/
public MesProduceStatisticsDetail selectMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailList(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public int insertMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public int updateMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param statisticsDetailId
* @return
*/
public int deleteMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
/**
*
*
* @param statisticsDetailIds
* @return
*/
public int deleteMesProduceStatisticsDetailByStatisticsDetailIds(Long[] statisticsDetailIds);
/**
* 使;
*
* @param statisticsDetailIds
* @return
*/
public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailIds(Long[] statisticsDetailIds);
/**
* 使;
*
* @param mesProduceStatisticsDetailMaterialList 使;
* @return
*/
public int batchMesProduceStatisticsDetailMaterial(List<MesProduceStatisticsDetailMaterial> mesProduceStatisticsDetailMaterialList);
/**
* 使;
*
* @param statisticsDetailId ID
* @return
*/
public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId(Long statisticsDetailId);
}

@ -94,4 +94,12 @@ public interface MesProductPlanDetailMapper
public MesProductPlanDetail selectMesProductPlanDetailByMaterialBarcode(String materialBarcode);
/**
* ,使
*
* @param mesProductPlanDetail
* @return
*/
public List<MesProductPlanDetail> selectMesProductPlanDetailList4Statistics(MesProductPlanDetail mesProductPlanDetail);
}

@ -145,4 +145,13 @@ public interface MesProductPlanMapper
public List<MesProductPlan> selectOnlyConflictMesProductPlans(MesProductPlan mesProductPlan);
/**
*
*
* @param planId ID
* @return
*/
public MesProductPlan selectOnlyMesProductPlanByPlanId(Long planId);
}

@ -151,5 +151,14 @@ public interface MesPurchaseOrderMapper
*/
public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId);
/**
* ,Join material
*
* @param purchaseOrderId
* @return
*/
public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId);
}

@ -0,0 +1,70 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesStatusChangeInfo;
/**
* Mapper
*
* @author xins
* @date 2024-11-07
*/
public interface MesStatusChangeInfoMapper
{
/**
*
*
* @param statusChangeInfoId
* @return
*/
public MesStatusChangeInfo selectMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId);
/**
*
*
* @param mesStatusChangeInfo
* @return
*/
public List<MesStatusChangeInfo> selectMesStatusChangeInfoList(MesStatusChangeInfo mesStatusChangeInfo);
/**
*
*
* @param mesStatusChangeInfo
* @return
*/
public int insertMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo);
/**
*
*
* @param mesStatusChangeInfo
* @return
*/
public int updateMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo);
/**
*
*
* @param statusChangeInfoId
* @return
*/
public int deleteMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId);
/**
*
*
* @param statusChangeInfoIds
* @return
*/
public int deleteMesStatusChangeInfoByStatusChangeInfoIds(Long[] statusChangeInfoIds);
/**
* ,productOrderIdplanDetailId
*
* @param mesStatusChangeInfo
* @return
*/
public List<MesStatusChangeInfo> selectMesStatusChangeInfoListByProduce(MesStatusChangeInfo mesStatusChangeInfo);
}

@ -2,6 +2,7 @@ package com.hw.mes.service;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseBindBarcode;
import com.hw.mes.domain.MesPrdBarcodeInfo;
import com.hw.mes.domain.vo.MesBindBarcodeVo;
import org.springframework.transaction.annotation.Transactional;
@ -240,4 +241,13 @@ public interface IMesBaseBarcodeInfoService {
* @param mesBaseBarcodeInfo
*/
public int updateMergeRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo);
/**
*
* @param mesPrdBarcodeInfo
* @return
*/
public List<MesPrdBarcodeInfo> selectMesPrdBarcodeInfoList(MesPrdBarcodeInfo mesPrdBarcodeInfo);
}

@ -67,4 +67,12 @@ public interface IMesOrderBindService
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinList(MesOrderBind mesOrderBind);
/**
* ,Join product
*
* @param mesOrderBind
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind);
}

@ -132,4 +132,10 @@ public interface IMesProductPlanDetailService {
* @return
*/
public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo);
/**
*
* @param time
*/
public void generateProduceStatisticsDetail(String time);
}

@ -158,4 +158,12 @@ public interface IMesPurchaseOrderService
* @return
*/
public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId);
/**
* ,join material
*
* @param purchaseOrderId
* @return
*/
public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId);
}

@ -91,4 +91,11 @@ public interface IMesSaleOrderService
* @return
*/
public List<MesSaleOrderRelate> selectMesSaleOrderRelateJoinList(Long saleOrderId);
/**
* join product
* @param mesSaleOrderRelate
* @return
*/
public List<MesSaleOrderRelate> selectMesSaleOrderRelateJoinProductList(MesSaleOrderRelate mesSaleOrderRelate);
}

@ -16,9 +16,6 @@ import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesBindBarcodeVo;
import com.hw.mes.mapper.*;
import com.hw.mes.service.IMesBaseBarcodeInfoService;
import com.hw.printer.api.RemotePrinterService;
import com.hw.printer.api.domain.vo.PrintContentVo;
import com.hw.printer.api.domain.vo.PrinterVo;
import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.WmsWarehouseMaterial;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
@ -31,7 +28,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -85,6 +81,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Autowired
private MesRaiseCapitalBomMapper mesRaiseCapitalBomMapper;
@Autowired
private MesPrdBarcodeInfoMapper mesPrdBarcodeInfoMapper;
@Autowired
private MesConfig mesConfig;
@ -92,6 +91,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Resource
private RemoteWmsService remoteWmsService;
public final String splitCharacter = "/";
public final int materialNameLength = 4;
/**
*
*
@ -295,11 +297,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setPurchaseOrderId(mesBaseBarcodeInfo.getPurchaseOrderId());
queryBaseBarcodeInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
queryBaseBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR);
List<MesBaseBarcodeInfo> baseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo);
if (baseBarcodeInfos != null && !baseBarcodeInfos.isEmpty()) {
throw new ServiceException("已经有此物料固定条码,无需重复生成");
throw new ServiceException("已经有此采购订单物料固定条码,无需重复生成");
}
String barcodeInfo = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
@ -655,15 +658,14 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String printTemplate = "";
if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
printTemplate = PrintContentVo.PRINT_TEMPLATE_RAW;
printTemplate = PrintConstants.PRINT_TEMPLATE_RAW;
} else if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {
printTemplate = PrintContentVo.PRINT_TEMPLATE_PRODUCT;
printTemplate = PrintConstants.PRINT_TEMPLATE_PRODUCT;
} else if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
printTemplate = PrintContentVo.PRINT_TEMPLATE_BIND;
printTemplate = PrintConstants.PRINT_TEMPLATE_BIND;
}
printContentJson.put("template", printTemplate);
printContentJson.put("printContent", pintBarcodeJsonArr.toString());
System.out.println(printContentJson.toString());
try {
@ -708,21 +710,21 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String materialName = mesBaseBarcodeInfo.getMaterialName();
JSONObject printInfoObject = new JSONObject();
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE, mesBaseBarcodeInfo.getMaterialCode());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE, mesBaseBarcodeInfo.getSaleorderCode());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QRCODE, mesBaseBarcodeInfo.getBarcodeInfo());
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE, mesBaseBarcodeInfo.getMaterialCode());
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE, mesBaseBarcodeInfo.getSaleorderCode());
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_QRCODE, mesBaseBarcodeInfo.getBarcodeInfo());
if (printType.equals(PrinterVo.PRINT_TYPE_RAW_LABEL)) {
if (printType.equals(PrintConstants.PRINT_TYPE_RAW_LABEL)) {
// materialName = materialName.length() <= 10 ? "\n" + materialName : materialName;
// printMaterialName.setValue(materialName.replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
// printMaterialName.setType(PrintContentVo.TYPE_TEXT);
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName);
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName);
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BATCH_CODE, mesBaseBarcodeInfo.getBatchCode());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_PO_NO, mesBaseBarcodeInfo.getPoNo());
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo());
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_BATCH_CODE, mesBaseBarcodeInfo.getBatchCode());
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_PO_NO, mesBaseBarcodeInfo.getPoNo());
//常备物料为安全库存
@ -732,7 +734,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// printPreMaterial.setType(PrintContentVo.TYPE_CHECKBOX);
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? ""
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? ""
: mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
// PrintContentVo printQty = new PrintContentVo();
@ -743,13 +745,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// printQty.setType(PrintContentVo.TYPE_TEXT);
} else if (printType.equals(PrinterVo.PRINT_TYPE_PRODUCT_LABEL)) {
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName);
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? ""
} else if (printType.equals(PrintConstants.PRINT_TYPE_PRODUCT_LABEL)) {
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME, materialName);
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? ""
: mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo());
printInfoObject.put(PrintContentVo.PRODUCT_PLAN_CODE, mesBaseBarcodeInfo.getPlanCode());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QTY, "1");
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo());
printInfoObject.put(PrintConstants.PRODUCT_PLAN_CODE, mesBaseBarcodeInfo.getPlanCode());
printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_QTY, "1");
}
@ -898,16 +900,32 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String userName = SecurityUtils.getUsername();
Date currentDate = DateUtils.getNowDate();
if (productBarcodesArr != null) {
for (String productBarcode : productBarcodesArr) {
StringBuilder materialNameBuilder = new StringBuilder();
for (String oriProductBarcode : productBarcodesArr) {
//先根据之前的成品条码信息获取托盘信息
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcode);
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcode);
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(oriProductBarcode);
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品条码").append(productBarcode).append("不存在;");
} else {
productBarcodeInfoList.add(productBarcodeInfo);
allErrorMsgBuilder.append("成品/配对码").append(oriProductBarcode).append("不存在;");
}
if(productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){
productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodeInfo.getBindBarcode());
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品/配对码[").append(oriProductBarcode).append("]的成品不存在;");
}
}
productBarcodeInfoList.add(productBarcodeInfo);
MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate();
querySaleOrderRelate.setBindBarcode(productBarcodeInfo.getBarcodeInfo());
List<MesSaleOrderRelate> mesSaleOrderRelates = mesSaleOrderRelateMapper.selectMesSaleOrderRelateList(querySaleOrderRelate);
if(mesSaleOrderRelates!=null && !mesSaleOrderRelates.isEmpty()){
allErrorMsgBuilder.append("此条码[").append(oriProductBarcode).append("]已经生成过原材料条码;");
}
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodeInfo.getBarcodeInfo());
//多个成品条码绑定的条码必须相同
if (basePalletInfo != null) {
if (StringUtils.isEmpty(palletInfoCode)) {
@ -923,14 +941,20 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
basePalletInfoList.add(basePalletInfo);
}
allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcode, productBarcodeInfo, mesBaseBarcodeInfo));
allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcodeInfo.getBarcodeInfo(), productBarcodeInfo, mesBaseBarcodeInfo));
String materialName = productBarcodeInfo.getMaterialName();
materialName = materialName.substring(0,materialNameLength);
materialNameBuilder.append(splitCharacter).append(materialName);
}
barcodeInfo = Seq.getId(Seq.mesInternalVirtualBarcodeSeqType, Seq.mesInternalVirtualBarcodeCode);
String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,"");
//新建虚拟物料
materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate);
materialId = this.insertNewVirtualMaterial(barcodeInfo,mergeMaterialName, userName, currentDate);
} else {
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodes);
@ -1044,6 +1068,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// if (bindBarcodeRelate != null) {
// allErrorMsgBuilder.append("成品条码:").append(productBarcodeInfo.getBarcodeInfo()).append("已经生成过原材料条码;");
// }
//四楼到五楼,主要是多个成品合并到一个托盘后生成原材料条码需要保存以下信息,一个成品的保不保存无所谓
MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate();
saleOrderRelate.setBarcodeInfo(barcodeInfo);
@ -1240,6 +1268,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
*/
@Override
public List<MesBaseBarcodeInfo> selectBarCodeAllocationWarehouse(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec())
? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesBaseBarcodeInfoMapper.selectBarCodeAllocationWarehouse(mesBaseBarcodeInfo);
}
@ -1251,6 +1281,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
*/
@Override
public List<MesBaseBarcodeInfo> selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec())
? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesBaseBarcodeInfoMapper.selectWarehouseBarCodeList(mesBaseBarcodeInfo);
}
@ -1322,6 +1354,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
List<MesMaterialBom> toUpdatedMaterialBoms = new ArrayList<>();
StringBuilder errorMsgBuilder = new StringBuilder();
int materialNameLength = 4;
String splitCharacter = "|";
StringBuilder materialNameBuilder = new StringBuilder();//将多个物料的名称拼接(取前几个字符(materialNameLength)拼接,目前是前4个字符
for (MesSaleOrderRelate mesSaleOrderRelate : mesSaleOrderRelateList) {
if (mesSaleOrderRelate.getOrderAmount() == null || mesSaleOrderRelate.getOrderAmount().compareTo(BigDecimal.ONE) != 0) {
throw new ServiceException("请选择采购数量为1的采购订单信息");
@ -1398,6 +1433,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
dbOrderBind.setUpdateBy(userName);
mesOrderBindMapper.updateMesOrderBind(dbOrderBind);
String materialName = mesSaleOrderRelate.getMaterialName();
materialName = materialName.substring(0,materialNameLength);
materialNameBuilder.append(splitCharacter).append(materialName);
// materialCodes.add(mesPurchaseOrderVo.getMaterialCode());
}
@ -1405,11 +1444,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException(errorMsgBuilder.toString());
}
String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,"");
String barcodeInfo = Seq.getId(Seq.mesPurchaseVirtualBarcodeSeqType, Seq.mesPurchaseVirtualBarcodeCode);
//新建虚拟物料
Long materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate);
Long materialId = this.insertNewVirtualMaterial(barcodeInfo, mergeMaterialName,userName, currentDate);
//创建虚拟销售订单,保存对应的销售订单列表
MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesBaseBarcodeInfo.getSaleorderCode(), mesSaleOrderRelateList, userName, currentDate);
@ -1429,6 +1469,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
toInsertedBarcodeInfo.setSaleorderCode(mesBaseBarcodeInfo.getSaleorderCode());
toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO);
toInsertedBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_MERGE);
toInsertedBarcodeInfo.setAmount(new BigDecimal(mesSaleOrderRelateList.size()));
// toInsertedBarcodeInfo.setBarcodeSpec(materialCodes.toString());
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo);
@ -1449,11 +1490,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
public long insertNewVirtualMaterial(String barcodeInfo, String userName, Date currentDate) {
public long insertNewVirtualMaterial(String barcodeInfo, String materialName,String userName, Date currentDate) {
//虚拟成品和虚拟原材料用一个物料
MesBaseMaterialInfo mesBaseMaterialInfo = new MesBaseMaterialInfo();
mesBaseMaterialInfo.setMaterialCode(barcodeInfo);
mesBaseMaterialInfo.setMaterialName(barcodeInfo);
mesBaseMaterialInfo.setMaterialName(materialName);
mesBaseMaterialInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
// mesBaseMaterialInfo.setMaterialCategories(MesConstants.MES_MATERIAL_CATEGORIES_RAW);
mesBaseMaterialInfo.setActiveFlag(MesConstants.MES_MATERIAL_ALWAYS_FLAG_NO);
@ -1629,6 +1670,17 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
//修改后的合并信息
List<MesSaleOrderRelate> mesSaleOrderRelateList = mesBaseBarcodeInfo.getMesSaleOrderRelateList();
StringBuilder materialNameBuilder = new StringBuilder();
for(MesSaleOrderRelate mesSaleOrderRelate:mesSaleOrderRelateList){
String materialName = mesSaleOrderRelate.getMaterialName();
materialName = materialName.substring(0,materialNameLength);
materialNameBuilder.append(splitCharacter).append(materialName);
}
String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,"");
mesBaseBarcodeInfo.setAmount(new BigDecimal(mesSaleOrderRelateList.size()));
//数据库中的合并信息
MesSaleOrderRelate querySaleOrderRelateByBarcodeInfo = new MesSaleOrderRelate();
querySaleOrderRelateByBarcodeInfo.setBarcodeInfo(barcodeInfo);
@ -1699,7 +1751,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
MesBaseMaterialInfo virtualMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(mesBaseBarcodeInfo.getMaterialId());
virtualMaterialInfo.setMaterialName(mergeMaterialName);
mesBaseMaterialInfoMapper.updateMesBaseMaterialInfo(virtualMaterialInfo);
//生成条码
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
@ -1754,6 +1812,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
public StringBuilder handleInsertSaleOrderRelates(List<MesSaleOrderRelate> toInsertedSaleOrderRelateList, MesBaseBarcodeInfo baseBarcodeInfo,
MesMaterialBom virtualMaterialBom, String userName, Date currentDate) {
StringBuilder errorMsgBuilder = new StringBuilder();
if(toInsertedSaleOrderRelateList==null || toInsertedSaleOrderRelateList.isEmpty()){
return errorMsgBuilder;
}
List<MesMaterialBom> toUpdatedMaterialBoms = new ArrayList<>();
for (MesSaleOrderRelate mesSaleOrderRelate : toInsertedSaleOrderRelateList) {
if (mesSaleOrderRelate.getOrderAmount() == null || mesSaleOrderRelate.getOrderAmount().compareTo(BigDecimal.ONE) != 0) {
@ -1846,6 +1908,18 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
/**
*
* @param mesPrdBarcodeInfo
* @return
*/
@Override
public List<MesPrdBarcodeInfo> selectMesPrdBarcodeInfoList(MesPrdBarcodeInfo mesPrdBarcodeInfo){
return mesPrdBarcodeInfoMapper.selectMesPrdBarcodeInfoList(mesPrdBarcodeInfo);
}
// public MesPurchaseOrder insertVirtualPurchaseOrder(Long materialId, String barcodeInfo, BigDecimal sumOrderAmount,
// List<MesPurchaseOrderRelate> mesPurchaseOrderRelates,String userName, Date currentDate) {
// MesPurchaseOrder virtualPurchaseOrder = new MesPurchaseOrder();
@ -2280,4 +2354,5 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// }
//
// }
}

@ -157,6 +157,8 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
*/
@Override
public List<MesBaseMaterialInfo> selectMaterialInfos4AllocationWarehouse(MesBaseMaterialInfo mesBaseMaterialInfo) {
mesBaseMaterialInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseMaterialInfo.getMaterialSpec())
? mesBaseMaterialInfo.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesBaseMaterialInfoMapper.selectMaterialInfos4AllocationWarehouse(mesBaseMaterialInfo);
}

@ -3,26 +3,28 @@ package com.hw.mes.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.PrintConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.vo.MesPalletInfoBindVo;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.printer.api.RemotePrinterService;
import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.WmsWarehouseMaterial;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import com.hw.wms.api.domain.vo.WmsWarehouseMaterialExistVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBasePalletInfoMapper;
import com.hw.mes.domain.MesBasePalletInfo;
@ -48,8 +50,8 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
@Autowired
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
@Resource
private RemotePrinterService remotePrinterService;
@Autowired
private StringRedisTemplate redisTemplate;
@Resource
private RemoteWmsService remoteWmsService;
@ -153,7 +155,40 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
throw new ServiceException("此物料条码还未打印");
}
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getPalletInfoCode()) && mesBaseBarcodeInfo.getPalletInfoCode().equals(palletInfoCode)) {
if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
WmsWarehouseMaterial wmsWarehouseMaterial = new WmsWarehouseMaterial();
wmsWarehouseMaterial.setStorageId(mesBaseBarcodeInfo.getMaterialId());
R<Boolean> isExistWarehouseMaterial = remoteWmsService.isExistWarehouseMaterial(wmsWarehouseMaterial, SecurityConstants.INNER);
if (!isExistWarehouseMaterial.getData()) {
throw new ServiceException("此物料还没有配置仓库信息");
}
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
String oriPalletInfoCode="";
if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBindBarcode());
oriPalletInfoCode = productBarcodeInfo.getPalletInfoCode();
materialBarcode = productBarcodeInfo.getBarcodeInfo();
productBarcodeInfo.setPalletInfoCode(palletInfoCode);
productBarcodeInfo.setUpdateBy(userName);
productBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(productBarcodeInfo);
} else {
oriPalletInfoCode = mesBaseBarcodeInfo.getPalletInfoCode();
mesBaseBarcodeInfo.setPalletInfoCode(palletInfoCode);
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
if (StringUtils.isNotEmpty(oriPalletInfoCode) && oriPalletInfoCode.equals(palletInfoCode)) {
throw new ServiceException("已经绑定过");
}
@ -172,26 +207,10 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
throw new ServiceException("此物料条码存在原材料库存,不能绑定");
}
if(mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)){
WmsWarehouseMaterial wmsWarehouseMaterial = new WmsWarehouseMaterial();
wmsWarehouseMaterial.setStorageId(mesBaseBarcodeInfo.getMaterialId());
R<Boolean> isExistWarehouseMaterial = remoteWmsService.isExistWarehouseMaterial(wmsWarehouseMaterial, SecurityConstants.INNER);
if (!isExistWarehouseMaterial.getData()) {
throw new ServiceException("此物料还没有配置仓库信息");
}
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
mesBaseBarcodeInfo.setPalletInfoCode(palletInfoCode);
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
mesBasePalletInfo.setMaterialBarcode(materialBarcode);
mesBasePalletInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
mesBasePalletInfo.setMaterialCode(mesBasePalletInfo.getMaterialCode());
mesBasePalletInfo.setMaterialCode(mesBaseBarcodeInfo.getMaterialCode());
mesBasePalletInfo.setMaterialName(mesBaseBarcodeInfo.getMaterialName());
mesBasePalletInfo.setUpdateBy(userName);
mesBasePalletInfo.setUpdateTime(currentDate);
@ -209,24 +228,34 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
*/
@Override
public int printPalletInfoCodes(String[] palletInfoCodes) {
StringBuilder buffer = new StringBuilder();
com.alibaba.fastjson.JSONArray printInfoJsonArr = new com.alibaba.fastjson.JSONArray();
com.alibaba.fastjson.JSONObject printContentJson = new com.alibaba.fastjson.JSONObject();
for (String palletInfoCode : palletInfoCodes) {
if (StringUtils.isNotEmpty(palletInfoCode)) {
try {
HashMap<String, String> params = new HashMap<>();
params.put("text", palletInfoCode);
params.put("qrCode", palletInfoCode);
//调用的打印接口
remotePrinterService.printLocationLabel(params, SecurityConstants.INNER);
} catch (Exception e) {
buffer.append("打印托盘RFID编码报错——[编码内容:").append(palletInfoCode).append("]").append(e.getMessage());
com.alibaba.fastjson.JSONObject printInfoObject = new com.alibaba.fastjson.JSONObject();
if (StringUtils.isNotEmpty(palletInfoCode)) {
printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_TEXT, palletInfoCode);
printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_QRCODE, palletInfoCode);
printInfoJsonArr.add(printInfoObject);
} else {
throw new ServiceException("请选择有设备编号的设备进行打印");
}
}
}
if (buffer.length() == 0) {
return 1;
} else {
throw new ServiceException(buffer.toString());
String printTemplate = PrintConstants.PRINT_TEMPLATE_SMALL;
printContentJson.put("template", printTemplate);
printContentJson.put("printContent", printInfoJsonArr.toString());
try {
String hostIp = IpUtils.getIpAddr();
String printKey = "print_" + hostIp;
redisTemplate.opsForList().rightPush(printKey, printContentJson.toString());
redisTemplate.expire(printKey, 1, TimeUnit.DAYS);
// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString());
} catch (Exception e) {
throw new ServiceException("打印失败:" + e.getMessage());
}
return 1;
}
}

@ -101,7 +101,6 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
*/
@Override
public MesBaseStationInfo getLoginStationInfo() {
//TODO:正式时需要修改回来
String ipAddress = SecurityUtils.getLoginUser().getIpaddr();
// ipAddress = "192.168.2.25";

@ -386,7 +386,7 @@ public class MesImportImpl implements IMesImportService {
}
Cell amountCell = rowC.getCell(5);
Cell brandCell = rowC.getCell(6);
if (StringUtils.isNotEmpty(materialCode)) {
if (StringUtils.isNotEmpty(materialCode) && !materialCode.equals("物料编码")) {
MesBaseMaterialInfo materialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(materialCode);
if (StringUtils.isNotNull(materialInfo)) {
MesRaiseCapitalBom materialBom = new MesRaiseCapitalBom();

@ -104,4 +104,17 @@ public class MesOrderBindServiceImpl implements IMesOrderBindService {
? mesOrderBind.getSpecificationParameter().replaceAll("\\s+", "") : "");
return mesOrderBindMapper.selectMesOrderBindJoinList(mesOrderBind);
}
/**
* ,Join product
*
* @param mesOrderBind
* @return
*/
@Override
public List<MesOrderBind> selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind) {
return mesOrderBindMapper.selectMesOrderBindJoinList(mesOrderBind);
}
}

@ -22,6 +22,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
@ -52,6 +53,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
@Autowired
private MesProductOrderMapper mesProductOrderMapper;
@Autowired
private MesStatusChangeInfoMapper mesStatusChangeInfoMapper;
@Autowired
private MesProduceStatisticsDetailMapper mesProduceStatisticsDetailMapper;
@Autowired
private MesConfig mesConfig;
@ -365,7 +372,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
//如果是五楼拆分,校验是否有配对条码
if (StringUtils.isNotEmpty(mesProductPlanDetail.getProcessType())
&& mesProductPlanDetail.getProcessType().equals(MesConstants.MES_PROCESS_TYPE_FIFTH_SPLIT)) {
@ -528,7 +534,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
@Override
@Transactional(rollbackFor = Exception.class)
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail, String startType) {
//根据planId获取最新一条的生产计划明细
//根据planId和userId获取最新一条的生产计划明细
mesProductPlanDetail.setUserId(SecurityUtils.getUserId());
MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail);
//如果此计划有最新的计划明细
@ -665,14 +672,14 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
if (StringUtils.isNotEmpty(bindBarcodeInfo.getTransferredPlanDetailCode())) {
throw new ServiceException("此条码已经扫描使用过,不能再次使用");
}
// if (StringUtils.isNotEmpty(bindBarcodeInfo.getTransferredPlanDetailCode())) {
// throw new ServiceException("此条码已经扫描使用过,不能再次使用");
// }
MesProductPlan barcodeProductPlan;
if (bindBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {//如果是成品码则是4楼绑定的需要找到5楼生成的原材料条码
//四楼到5楼的装配开始时有可能柜体还没运输上来还未生成原材料条码,组装出库再判断
//四楼到5楼的装配开始时有可能柜体还没运输上来还未生成原材料条码,组装出库再判断
// MesBaseBindBarcode mesBaseBindBarcode = mesBaseBindBarcodeMapper.selectMesBaseBindBarcodeByBindBarcode(mesBaseBarcodeInfo.getBindBarcode());
// if (mesBaseBindBarcode ==null) {
// throw new ServiceException("未按成品条码生成原材料条码");
@ -693,8 +700,16 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
if (!barcodeProductPlan.getDispatchCode().equals(dispatchCode)) {
throw new ServiceException("此条码的派工单号为:" + barcodeProductPlan.getDispatchCode() + ",与此派工单号不符");
}
}
MesProductPlanDetail queryProductPlanDetail = new MesProductPlanDetail();
queryProductPlanDetail.setMaterialBarcode(materialBarcode);
queryProductPlanDetail.setUserId(SecurityUtils.getUserId());
List<MesProductPlanDetail> mesProductPlanDetails = mesProductPlanDetailMapper.selectMesProductPlanDetailList(queryProductPlanDetail);
if(mesProductPlanDetails!=null && !mesProductPlanDetails.isEmpty()){
throw new ServiceException("您已经扫描此条码开始过,请勿重复扫描");
}
}
bindBarcodeInfo.setTransferredPlanDetailCode(planDetailCode);
@ -754,7 +769,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
/**
*
*
@ -763,13 +777,13 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
*/
@Override
public int productPlanDetailPause(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ;
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId());
String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus();
// 明细状态1-未开始2-已开始3-已完成4-暂停9-异常完成(校验物料信息不完整)
//已开始的可以改为暂停
if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)){
if (!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)) {
String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus);
throw new ServiceException(String.format("此生产计划明细已经%s,不能暂停!", planDetailStatusPrompt));
}
@ -781,7 +795,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
/**
*
*
@ -790,13 +803,13 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
*/
@Override
public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ;
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId());
String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus();
// 明细状态1-未开始2-已开始3-已完成4-暂停9-异常完成(校验物料信息不完整)
//已开始的可以改为暂停
if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)){
if (!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)) {
String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus);
throw new ServiceException(String.format("此生产计划明细已经%s,不能继续!", planDetailStatusPrompt));
}
@ -807,4 +820,86 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}
/**
*
* @param time
*/
@Override
public void generateProduceStatisticsDetail(String time) {
MesProductPlanDetail queryProductPlandetail = new MesProductPlanDetail();
queryProductPlandetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH);
queryProductPlandetail.setStatisticsFlag("1");
List<MesProductPlanDetail> mesProductPlanDetailList = mesProductPlanDetailMapper.selectMesProductPlanDetailList4Statistics(queryProductPlandetail);
for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) {
MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
//易耗品标识,分摊到各个生产计划明细中
//计算工时
Date realBeginTime = mesProductPlanDetail.getRealBeginTime();
Date realEndTime = mesProductPlanDetail.getRealEndTime();
Long produceTime = realEndTime.getTime()-realBeginTime.getTime();
MesStatusChangeInfo queryStatusChangeInfo = new MesStatusChangeInfo();
queryStatusChangeInfo.setProductOrderId(mesProductPlan.getProductOrderId());
queryStatusChangeInfo.setPlanDetailId(mesProductPlanDetail.getPlanDetailId());
List<MesStatusChangeInfo> mesStatusChangeInfoList = mesStatusChangeInfoMapper.selectMesStatusChangeInfoListByProduce(queryStatusChangeInfo);
// Optional<MesStatusChangeInfo> result = mesStatusChangeInfoList.stream()
// .filter(msci -> (StringUtils.isEmpty(msci.getOldStatus()) && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED))
// || StringUtils.isNotEmpty(msci.getOldStatus()) && msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED)
// && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED))
// .findFirst();
// if(result.isPresent()){
// MesStatusChangeInfo startStatus = result.get();
// }
List<MesStatusChangeInfo> pause2StartOrFinishChangeInfoList = mesStatusChangeInfoList.stream()
.filter(msci -> StringUtils.isNotEmpty(msci.getOldStatus()) && ((msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)
&& msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED))
|| (msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)
&& msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)))).collect(Collectors.toList());
List<MesStatusChangeInfo> start2PauseChangeInfoList = mesStatusChangeInfoList.stream()
.filter(msci -> StringUtils.isNotEmpty(msci.getOldStatus()) && (msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)
&& msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE))).collect(Collectors.toList());
if (pause2StartOrFinishChangeInfoList.size() == start2PauseChangeInfoList.size()) {
for (int i = 0; i < pause2StartOrFinishChangeInfoList.size(); i++) {
MesStatusChangeInfo pause2StartOrFinishChangeInfo = pause2StartOrFinishChangeInfoList.get(i);
MesStatusChangeInfo start2PauseChangeInfo = start2PauseChangeInfoList.get(i);
Long startOrFinshChangeTimeL = pause2StartOrFinishChangeInfo.getChangeTime().getTime();
Long pauseChangeTimeL = start2PauseChangeInfo.getChangeTime().getTime();
produceTime = produceTime -(startOrFinshChangeTimeL-pauseChangeTimeL);
}
}
MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail();
mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId());
mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId());
mesProduceStatisticsDetail.setSaleorderCode(mesProductPlan.getSaleorderCode());
mesProduceStatisticsDetail.setPlanId(mesProductPlanDetail.getPlanId());
mesProduceStatisticsDetail.setPlanCode(mesProductPlan.getPlanCode());
mesProduceStatisticsDetail.setPlanDetailId(mesProductPlanDetail.getPlanDetailId());
mesProduceStatisticsDetail.setPlanDetailCode(mesProductPlanDetail.getPlanDetailCode());
mesProduceStatisticsDetail.setProductId(mesProductPlan.getMaterialId());
mesProduceStatisticsDetail.setUserId(mesProductPlanDetail.getUserId());
mesProduceStatisticsDetail.setNickName(mesProductPlanDetail.getNickName());
mesProduceStatisticsDetail.setProcessId(mesProductPlan.getProcessId());
mesProduceStatisticsDetail.setProcessName(mesProductPlan.getProcessName());
mesProduceStatisticsDetail.setPlanBeginTime(mesProductPlan.getPlanBeginTime());
mesProduceStatisticsDetail.setPlanEndTime(mesProductPlan.getRealEndTime());
mesProduceStatisticsDetail.setRealBeginTime(realBeginTime);
mesProduceStatisticsDetail.setRealEndTime(realEndTime);
mesProduceStatisticsDetail.setProduceTime(produceTime);
mesProduceStatisticsDetail.setCreateTime(new Date());
mesProduceStatisticsDetailMapper.insertMesProduceStatisticsDetail(mesProduceStatisticsDetail);
}
}
}

@ -585,4 +585,16 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId) {
return mesPurchaseOrderMapper.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId);
}
/**
* ,join material
*
* @param purchaseOrderId
* @return
*/
@Override
public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId) {
return mesPurchaseOrderMapper.selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(purchaseOrderId);
}
}

@ -1,6 +1,7 @@
package com.hw.mes.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -11,7 +12,9 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesSaleOrderRelate;
import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo;
import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.mes.mapper.MesMaterialBomMapper;
import com.hw.mes.mapper.MesSaleOrderRelateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -37,6 +40,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
@Autowired
private MesSaleOrderRelateMapper mesSaleOrderRelateMapper;
@Autowired
private MesMaterialBomMapper mesMaterialBomMapper;
/**
*
*
@ -116,7 +122,36 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
public List<MesSaleOrder> selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder) {
mesSaleOrder.setMaterialSpec(StringUtils.isNotEmpty(mesSaleOrder.getMaterialSpec())
? mesSaleOrder.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
if (mesSaleOrder.getMaterialId() != null) {
MesMaterialBom queryMaterialBom = new MesMaterialBom();
queryMaterialBom.setMaterialId(mesSaleOrder.getMaterialId());
List<MesMaterialBom> mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom);
if (mesMaterialBoms != null && !mesMaterialBoms.isEmpty()) {
StringBuilder parentIdsBuilder = new StringBuilder();
for (MesMaterialBom mesMaterialBom : mesMaterialBoms) {
String ancestors = mesMaterialBom.getAncestors();
int commaIndex = ancestors.indexOf(",");
if (commaIndex >= 0) {
String ancestorPostfix = ancestors.substring(commaIndex + 1);
commaIndex = ancestorPostfix.indexOf(",");
if (commaIndex >= 0) {
ancestorPostfix = ancestorPostfix.substring(commaIndex + 1);
}
parentIdsBuilder.append(",").append(ancestorPostfix);
}
}
String parentIds = parentIdsBuilder.toString().replaceFirst(",", "");
mesSaleOrder.setParentIds(parentIds);
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
} else {
return new ArrayList<>();
}
} else {
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
}
}
@ -173,11 +208,12 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
/**
* relatesaleorderId
*
* @param saleOrderId
* @return
*/
@Override
public List<MesSaleOrderRelate> getRelateProductsBySaleOrderId(Long saleOrderId){
public List<MesSaleOrderRelate> getRelateProductsBySaleOrderId(Long saleOrderId) {
MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate();
querySaleOrderRelate.setSaleOrderId(saleOrderId);
return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinProductList(querySaleOrderRelate);
@ -185,16 +221,25 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
/**
* relatesaleorderId
*
* @param saleOrderId
* @return
*/
@Override
public List<MesSaleOrderRelate> selectMesSaleOrderRelateJoinList(Long saleOrderId){
public List<MesSaleOrderRelate> selectMesSaleOrderRelateJoinList(Long saleOrderId) {
MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate();
querySaleOrderRelate.setSaleOrderId(saleOrderId);
return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinList(querySaleOrderRelate);
}
/**
* join product
* @param mesSaleOrderRelate
* @return
*/
@Override
public List<MesSaleOrderRelate> selectMesSaleOrderRelateJoinProductList(MesSaleOrderRelate mesSaleOrderRelate){
return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinProductList(mesSaleOrderRelate);
}
}

@ -103,13 +103,15 @@
<include refid="selectMesBaseBarcodeInfoVo"/>
<where>
<if test="printTime != null ">and bbi.print_time = #{printTime}</if>
<if test="purchaseOrderId != null ">and bbi.purchase_order_id = #{purchaseOrderId}</if>
<if test="printPerson != null and printPerson != ''">and bbi.print_person = #{printPerson}</if>
<if test="printFlag != null and printFlag != ''">and bbi.print_flag = #{printFlag}</if>
<if test="batchFlag != null and batchFlag != ''">and bbi.batch_flag = #{batchFlag}</if>
<if test="barcodeTypeStr != null and barcodeTypeStr != ''">and bbi.barcode_type in (${barcodeTypeStr})</if>
<if test="barcodeType != null and barcodeType != ''">and bbi.barcode_type = #{barcodeType}</if>
<if test="singleFlag != null and singleFlag != ''">and bbi.single_flag = #{singleFlag}</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info = #{barcodeInfo}</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info like concat('%', #{barcodeInfo},
'%')</if>
<if test="batchCode != null and batchCode != ''">and bbi.batch_code = #{batchCode}</if>
<if test="palletInfoCode != null and palletInfoCode != ''">and bbi.pallet_info_code = #{palletInfoCode}</if>
<if test="bindBarcode != null and bindBarcode != ''">and bbi.bind_barcode = #{bindBarcode}</if>
@ -136,8 +138,10 @@
<if test="productionDate != null ">and bbi.production_date = #{productionDate}</if>
<if test="acceptedDate != null ">and bbi.accepted_date = #{acceptedDate}</if>
<if test="lastOutstockDate != null ">and bbi.last_outstock_date = #{lastOutstockDate}</if>
<if test="planCode != null and planCode != ''">and bbi.plan_code = #{planCode}</if>
<if test="planDetailCode != null and planDetailCode != ''">and bbi.plan_detail_code = #{planDetailCode}</if>
<if test="planCode != null and planCode != ''">and bbi.plan_code like concat('%', #{planCode},
'%')</if>
<if test="planDetailCode != null and planDetailCode != ''">and bbi.plan_detail_code like concat('%', #{planDetailCode},
'%')</if>
<if test="saleOrderId != null ">and bbi.sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''">and bbi.saleorder_code like concat('%', #{saleorderCode},
'%')</if>
@ -154,6 +158,11 @@
or exists
(select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode}
and bbi.bind_barcode=mbbi.barcode_info)</if>
<if test="prdBarcodeInfo != null and prdBarcodeInfo != ''">
and exists
(select 1 from mes_prd_barcode_info mpbi where mpbi.prd_barcode_info like concat('%', #{prdBarcodeInfo}, '%')
and mpbi.mes_barcode_info=bbi.barcode_info)</if>
</where>
order by bbi.barcode_id desc
@ -437,6 +446,8 @@
and wlb.location_code = #{locationCode})
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>
<if test="materialName != null and materialName != ''">and bmi.material_name like concat('%', #{materialName},'%')</if>
<if test="materialSpec != null and materialSpec != ''">and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info like concat('%', #{barcodeInfo},'%')</if>
</where>
</select>
@ -455,6 +466,8 @@
<if test="locationCode != null and locationCode != ''"> and wlb.location_code = #{locationCode}</if>
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>
<if test="materialName != null and materialName != ''">and bmi.material_name like concat('%', #{materialName},'%')</if>
<if test="materialSpec != null and materialSpec != ''">and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and wlb.barcode_info like concat('%', #{barcodeInfo},'%')</if>
</where>
</select>

@ -311,6 +311,8 @@
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
'%')
</if>
<if test="materialSpec != null and materialSpec != ''">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="materialCategories != null and materialCategories != ''">and material_categories =
#{materialCategories}
</if>
@ -322,7 +324,6 @@
<if test="materialUnitId != null ">and material_unit_id = #{materialUnitId}</if>
<if test="materialUnit != null and materialUnit != ''">and material_unit = #{materialUnit}</if>
<if test="materialMatkl != null and materialMatkl != ''">and material_matkl = #{materialMatkl}</if>
<if test="materialSpec != null and materialSpec != ''">and material_spec = #{materialSpec}</if>
<if test="netWeight != null ">and net_weight = #{netWeight}</if>
<if test="grossWeight != null ">and gross_weight = #{grossWeight}</if>
<if test="factoryId != null ">and factory_id = #{factoryId}</if>

@ -169,4 +169,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by mob.order_bind_id desc
</select>
<select id="selectMesOrderBindJoinProductList" parameterType="MesOrderBind" resultMap="MesOrderBindResult">
select mob.order_bind_id, mob.safe_flag, mob.sale_order_id, mob.sale_order_code,
mob.purchase_order_id, mob.po_no, mob.bind_amount, mob.barcode_amount,
mob.product_id,pbmi.material_code as product_code,pbmi.material_name as product_name,pbmi.material_spec as product_spec,
mob.material_id,mbmi.material_code,mbmi.material_name,mbmi.material_spec
from mes_order_bind mob left join mes_base_material_info pbmi on mob.product_id=pbmi.material_id
<where>
<if test="mergeFlag != null and mergeFlag != ''"> and mob.bind_amount=1 and mob.barcode_amount=0 and mso.order_amount=1</if>
<if test="singleFlag != null and singleFlag != ''"> and mob.bind_amount &gt; mob.barcode_amount</if>
<if test="safeFlag != null and safeFlag != ''"> and mob.safe_flag = #{safeFlag}</if>
<if test="saleOrderId != null"> and mob.sale_order_id = #{saleOrderId}</if>
<if test="purchaseOrderId != null"> and mob.purchase_order_id = #{purchaseOrderId}</if>
<if test="saleOrderCode != null and saleOrderCode != ''"> and mob.sale_order_code like concat('%', #{saleOrderCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and pbmi.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and pbmi.product_name like concat('%', #{productName}, '%')</if>
</where>
order by mob.order_bind_id desc
</select>
</mapper>

@ -0,0 +1,86 @@
<?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.MesPrdBarcodeInfoMapper">
<resultMap type="MesPrdBarcodeInfo" id="MesPrdBarcodeInfoResult">
<result property="prdBarcodeId" column="prd_barcode_id" />
<result property="prdBarcodeInfo" column="prd_barcode_info" />
<result property="printFlag" column="print_flag" />
<result property="mesBarcodeInfo" column="mes_barcode_info" />
<result property="palletInfoCode" column="pallet_info_code" />
<result property="creatTime" column="creat_time" />
<result property="printTime" column="print_time" />
<result property="bindTime" column="bind_time" />
</resultMap>
<sql id="selectMesPrdBarcodeInfoVo">
select prd_barcode_id, prd_barcode_info, print_flag, mes_barcode_info, pallet_info_code, creat_time, print_time, bind_time from mes_prd_barcode_info
</sql>
<select id="selectMesPrdBarcodeInfoList" parameterType="MesPrdBarcodeInfo" resultMap="MesPrdBarcodeInfoResult">
<include refid="selectMesPrdBarcodeInfoVo"/>
<where>
<if test="prdBarcodeInfo != null and prdBarcodeInfo != ''"> and prd_barcode_info = #{prdBarcodeInfo}</if>
<if test="printFlag != null and printFlag != ''"> and print_flag = #{printFlag}</if>
<if test="mesBarcodeInfo != null and mesBarcodeInfo != ''"> and mes_barcode_info = #{mesBarcodeInfo}</if>
<if test="palletInfoCode != null and palletInfoCode != ''"> and pallet_info_code = #{palletInfoCode}</if>
<if test="creatTime != null "> and creat_time = #{creatTime}</if>
<if test="printTime != null "> and print_time = #{printTime}</if>
<if test="bindTime != null "> and bind_time = #{bindTime}</if>
</where>
</select>
<select id="selectMesPrdBarcodeInfoByPrdBarcodeId" parameterType="Long" resultMap="MesPrdBarcodeInfoResult">
<include refid="selectMesPrdBarcodeInfoVo"/>
where prd_barcode_id = #{prdBarcodeId}
</select>
<insert id="insertMesPrdBarcodeInfo" parameterType="MesPrdBarcodeInfo" useGeneratedKeys="true" keyProperty="prdBarcodeId">
insert into mes_prd_barcode_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="prdBarcodeInfo != null and prdBarcodeInfo != ''">prd_barcode_info,</if>
<if test="printFlag != null and printFlag != ''">print_flag,</if>
<if test="mesBarcodeInfo != null">mes_barcode_info,</if>
<if test="palletInfoCode != null">pallet_info_code,</if>
<if test="creatTime != null">creat_time,</if>
<if test="printTime != null">print_time,</if>
<if test="bindTime != null">bind_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="prdBarcodeInfo != null and prdBarcodeInfo != ''">#{prdBarcodeInfo},</if>
<if test="printFlag != null and printFlag != ''">#{printFlag},</if>
<if test="mesBarcodeInfo != null">#{mesBarcodeInfo},</if>
<if test="palletInfoCode != null">#{palletInfoCode},</if>
<if test="creatTime != null">#{creatTime},</if>
<if test="printTime != null">#{printTime},</if>
<if test="bindTime != null">#{bindTime},</if>
</trim>
</insert>
<update id="updateMesPrdBarcodeInfo" parameterType="MesPrdBarcodeInfo">
update mes_prd_barcode_info
<trim prefix="SET" suffixOverrides=",">
<if test="prdBarcodeInfo != null and prdBarcodeInfo != ''">prd_barcode_info = #{prdBarcodeInfo},</if>
<if test="printFlag != null and printFlag != ''">print_flag = #{printFlag},</if>
<if test="mesBarcodeInfo != null">mes_barcode_info = #{mesBarcodeInfo},</if>
<if test="palletInfoCode != null">pallet_info_code = #{palletInfoCode},</if>
<if test="creatTime != null">creat_time = #{creatTime},</if>
<if test="printTime != null">print_time = #{printTime},</if>
<if test="bindTime != null">bind_time = #{bindTime},</if>
</trim>
where prd_barcode_id = #{prdBarcodeId}
</update>
<delete id="deleteMesPrdBarcodeInfoByPrdBarcodeId" parameterType="Long">
delete from mes_prd_barcode_info where prd_barcode_id = #{prdBarcodeId}
</delete>
<delete id="deleteMesPrdBarcodeInfoByPrdBarcodeIds" parameterType="String">
delete from mes_prd_barcode_info where prd_barcode_id in
<foreach item="prdBarcodeId" collection="array" open="(" separator="," close=")">
#{prdBarcodeId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,190 @@
<?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.MesProduceStatisticsDetailMapper">
<resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult">
<result property="statisticsDetailId" column="statistics_detail_id" />
<result property="productOrderId" column="product_order_id" />
<result property="saleOrderId" column="sale_order_id" />
<result property="saleorderCode" column="saleorder_code" />
<result property="planId" column="plan_id" />
<result property="planCode" column="plan_code" />
<result property="planDetailId" column="plan_detail_id" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="productId" column="product_id" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="productSpec" column="product_spec" />
<result property="userId" column="user_id" />
<result property="nickName" column="nick_name" />
<result property="processId" column="process_id" />
<result property="processName" column="process_name" />
<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="produceTime" column="produce_time" />
<result property="createTime" column="create_time" />
</resultMap>
<resultMap id="MesProduceStatisticsDetailMesProduceStatisticsDetailMaterialResult" type="MesProduceStatisticsDetail" extends="MesProduceStatisticsDetailResult">
<collection property="mesProduceStatisticsDetailMaterialList" notNullColumn="sub_statistics_detail_material_id" javaType="java.util.List" resultMap="MesProduceStatisticsDetailMaterialResult" />
</resultMap>
<resultMap type="MesProduceStatisticsDetailMaterial" id="MesProduceStatisticsDetailMaterialResult">
<result property="statisticsDetailMaterialId" column="sub_statistics_detail_material_id" />
<result property="statisticsDetailId" column="sub_statistics_detail_id" />
<result property="materialId" column="sub_material_id" />
<result property="materialCode" column="sub_material_code" />
<result property="materialName" column="sub_material_name" />
<result property="materialSpec" column="sub_material_spec" />
<result property="usedAmount" column="sub_used_amount" />
</resultMap>
<sql id="selectMesProduceStatisticsDetailVo">
select statistics_detail_id, product_order_id, sale_order_id, saleorder_code, plan_id, plan_code, plan_detail_id, plan_detail_code, product_id, product_code, product_name, product_spec, user_id, nick_name, process_id, process_name, plan_begin_time, plan_end_time, real_begin_time, real_end_time, produce_time, create_time from mes_produce_statistics_detail
</sql>
<select id="selectMesProduceStatisticsDetailList" parameterType="MesProduceStatisticsDetail" resultMap="MesProduceStatisticsDetailResult">
<include refid="selectMesProduceStatisticsDetailVo"/>
<where>
<if test="productOrderId != null "> and product_order_id = #{productOrderId}</if>
<if test="saleOrderId != null "> and sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planDetailId != null "> and plan_detail_id = #{planDetailId}</if>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productSpec != null and productSpec != ''"> and product_spec = #{productSpec}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="processId != null "> and process_id = #{processId}</if>
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</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="produceTime != null "> and produce_time = #{produceTime}</if>
</where>
</select>
<select id="selectMesProduceStatisticsDetailByStatisticsDetailId" parameterType="Long" resultMap="MesProduceStatisticsDetailMesProduceStatisticsDetailMaterialResult">
select a.statistics_detail_id, a.product_order_id, a.sale_order_id, a.saleorder_code, a.plan_id, a.plan_code, a.plan_detail_id, a.plan_detail_code, a.product_id, a.product_code, a.product_name, a.product_spec, a.user_id, a.nick_name, a.process_id, a.process_name, a.plan_begin_time, a.plan_end_time, a.real_begin_time, a.real_end_time, a.produce_time, a.create_time,
b.statistics_detail_material_id as sub_statistics_detail_material_id, b.statistics_detail_id as sub_statistics_detail_id, b.material_id as sub_material_id, b.material_code as sub_material_code, b.material_name as sub_material_name, b.material_spec as sub_material_spec, b.used_amount as sub_used_amount
from mes_produce_statistics_detail a
left join mes_produce_statistics_detail_material b on b.statistics_detail_id = a.statistics_detail_id
where a.statistics_detail_id = #{statisticsDetailId}
</select>
<insert id="insertMesProduceStatisticsDetail" parameterType="MesProduceStatisticsDetail" useGeneratedKeys="true" keyProperty="statisticsDetailId">
insert into mes_produce_statistics_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null">saleorder_code,</if>
<if test="planId != null">plan_id,</if>
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="planDetailId != null">plan_detail_id,</if>
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code,</if>
<if test="productId != null">product_id,</if>
<if test="productCode != null">product_code,</if>
<if test="productName != null">product_name,</if>
<if test="productSpec != null">product_spec,</if>
<if test="userId != null">user_id,</if>
<if test="nickName != null">nick_name,</if>
<if test="processId != null">process_id,</if>
<if test="processName != null">process_name,</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="produceTime != null">produce_time,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null">#{saleorderCode},</if>
<if test="planId != null">#{planId},</if>
<if test="planCode != null and planCode != ''">#{planCode},</if>
<if test="planDetailId != null">#{planDetailId},</if>
<if test="planDetailCode != null and planDetailCode != ''">#{planDetailCode},</if>
<if test="productId != null">#{productId},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productName != null">#{productName},</if>
<if test="productSpec != null">#{productSpec},</if>
<if test="userId != null">#{userId},</if>
<if test="nickName != null">#{nickName},</if>
<if test="processId != null">#{processId},</if>
<if test="processName != null">#{processName},</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="produceTime != null">#{produceTime},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateMesProduceStatisticsDetail" parameterType="MesProduceStatisticsDetail">
update mes_produce_statistics_detail
<trim prefix="SET" suffixOverrides=",">
<if test="productOrderId != null">product_order_id = #{productOrderId},</if>
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="planId != null">plan_id = #{planId},</if>
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
<if test="planDetailId != null">plan_detail_id = #{planDetailId},</if>
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code = #{planDetailCode},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="productSpec != null">product_spec = #{productSpec},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="processId != null">process_id = #{processId},</if>
<if test="processName != null">process_name = #{processName},</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="produceTime != null">produce_time = #{produceTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where statistics_detail_id = #{statisticsDetailId}
</update>
<delete id="deleteMesProduceStatisticsDetailByStatisticsDetailId" parameterType="Long">
delete from mes_produce_statistics_detail where statistics_detail_id = #{statisticsDetailId}
</delete>
<delete id="deleteMesProduceStatisticsDetailByStatisticsDetailIds" parameterType="String">
delete from mes_produce_statistics_detail where statistics_detail_id in
<foreach item="statisticsDetailId" collection="array" open="(" separator="," close=")">
#{statisticsDetailId}
</foreach>
</delete>
<delete id="deleteMesProduceStatisticsDetailMaterialByStatisticsDetailIds" parameterType="String">
delete from mes_produce_statistics_detail_material where statistics_detail_id in
<foreach item="statisticsDetailId" collection="array" open="(" separator="," close=")">
#{statisticsDetailId}
</foreach>
</delete>
<delete id="deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId" parameterType="Long">
delete from mes_produce_statistics_detail_material where statistics_detail_id = #{statisticsDetailId}
</delete>
<insert id="batchMesProduceStatisticsDetailMaterial">
insert into mes_produce_statistics_detail_material( statistics_detail_material_id, statistics_detail_id, material_id, material_code, material_name, material_spec, used_amount) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.statisticsDetailMaterialId}, #{item.statisticsDetailId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.usedAmount})
</foreach>
</insert>
</mapper>

@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="stationId" column="station_id" />
<result property="attachName" column="attach_name" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectMesProductPlanDetailVo">
@ -43,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if test="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
</where>
order by plan_detail_status asc,plan_detail_id desc
</select>
@ -138,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
real_begin_time, real_end_time, plan_detail_status
from mes_product_plan_detail mppd
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planId == null "> and exists (select 1 from mes_product_plan mpp where mppd.plan_id=mpp.plan_id and mpp.station_id=#{stationId})</if>
</where>
@ -166,4 +169,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMesProductPlanDetailVo"/>
where material_barcode = #{materialBarcode}
</select>
<select id="selectMesProductPlanDetailList4Statistics" parameterType="MesProductPlanDetail" resultMap="MesProductPlanDetailResult">
select mppd.plan_detail_id, mppd.plan_detail_code, mppd.plan_id, mppd.plan_code, mppd.user_id, mppd.user_name,mppd.real_begin_time,
mppd.real_end_time,mppd.plan_detail_status,su.nick_name from mes_product_plan_detail mppd left join sys_user su on mppd.user_id=su.user_id
<where>
<if test="planDetailStatus != null and planDetailStatus != ''"> and mppd.plan_detail_status = #{planDetailStatus}</if>
<if test="statisticsFlag != null and statisticsFlag != ''"> and not exists (select 1 from mes_produce_statistics_detail mpsd where mppd.plan_detail_id=mpsd.plan_detail_id)</if>
</where>
order by plan_detail_code
</select>
</mapper>

@ -43,6 +43,7 @@
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="materialClassfication" column="material_classfication"/>
<result property="processName" column="process_name"/>
<result property="processType" column="process_type"/>
<result property="stationName" column="station_name"/>
@ -350,7 +351,7 @@
mpp.station_id, mpp.dispatch_amount, 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,mpo.sale_type,mpo.cabinet_channel,mpo.material_id as product_id,
mbmi.material_code,mbmi.material_name,mbmi.material_spec
mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.material_classfication
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>
@ -546,4 +547,42 @@
</select>
<select id="selectOnlyMesProductPlanByPlanId" parameterType="Long" resultMap="MesProductPlanResult">
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.final_process_flag,
a.station_id,
a.user_id,
a.production_time,
a.dispatch_amount,
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.sop_id,
a.plan_status,
a.is_flag,
a.remark,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
b.sale_order_id,
b.saleorder_code
from mes_product_plan a left join mes_product_order b on a.product_order_id = b.product_order_id
where a.plan_id = #{planId}
</select>
</mapper>

@ -299,7 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if>
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
<if test="alwaysFlag != null and alwaysFlag != ''"> and mbmi.always_flag = #{alwaysFlag}</if>
<if test="materialBomId != null"> and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mpo.material_id and mmb.ancestors like concat('0,', #{materialBomId}, '%') )</if>
</where>
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name
</select>
@ -474,7 +474,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productSpec != null and productSpec != ''">and replace(pbmi.material_spec,' ','') like concat('%', #{productSpec},
'%')</if>
</where>
order by mpo.po_no
order by mpo.create_time desc
</select>
@ -498,4 +498,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.purchase_order_id = #{purchaseOrderId}
</select>
<select id="selectMesPurchaseOrderJoinMaterialByPurchaseOrderId" parameterType="Long" resultMap="MesPurchaseOrderResult">
select a.purchase_order_id, a.po_no, a.document_status, a.material_id as erp_material_id,
a.material_code, a.material_name, a.order_amount, a.complete_amount, a.approve_date,a.specification_parameter,
a.erp_modify_date, a.plan_delivery_date, a.order_status, a.complete_date,
a.is_flag, a.src_bill_no,
a.purchase_org_id, a.tond_base, a.supplier_id,a.create_by, a.create_time, a.update_by, a.update_time,
mbmi1.material_id,mbmi1.material_code,mbmi1.material_name,mbmi1.material_spec
from mes_purchase_order a
left join mes_base_material_info mbmi1 on a.material_id = mbmi1.erp_id
where a.purchase_order_id = #{purchaseOrderId}
</select>
</mapper>

@ -270,7 +270,7 @@
<if test="saleOrderClassfication != null and saleOrderClassfication != ''">and mso.sale_order_classfication = #{saleOrderClassfication}</if>
<if test="relateFlag != null and relateFlag != ''">and exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id and msor.sale_order_id=#{virtualSaleOrderId})</if>
<if test="selectFlag != null and selectFlag != ''">and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id)</if>
<if test="parentIds != null and parentIds != ''">and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds}))</if>
</where>
order by mso.erp_modify_date desc
</select>

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMesSaleOrderRelateVo"/>
<where>
<if test="barcodeInfo != null and barcodeInfo != '' "> and barcode_info = #{barcodeInfo}</if>
<if test="bindBarcode != null and bindBarcode != '' "> and bind_barcode = #{bindBarcode}</if>
<if test="saleOrderId != null "> and sale_order_id = #{saleOrderId}</if>
<if test="relateSaleOrderId != null "> and relate_sale_order_id = #{relateSaleOrderId}</if>
<if test="purchaseOrderId != null "> and purchase_order_id = #{purchaseOrderId}</if>
@ -144,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="relateSaleOrderId != null "> and relate_sale_order_id = #{relateSaleOrderId}</if>
<if test="purchaseOrderId != null "> and purchase_order_id = #{purchaseOrderId}</if>
<if test="relateSaleOrderAmount != null "> and relate_sale_order_amount = #{relateSaleOrderAmount}</if>
<if test="virtualMaterialId != null "> and virtual_material_id = #{virtualMaterialId}</if>
</where>
</select>

@ -0,0 +1,89 @@
<?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.MesStatusChangeInfoMapper">
<resultMap type="MesStatusChangeInfo" id="MesStatusChangeInfoResult">
<result property="statusChangeInfoId" column="status_change_info_id" />
<result property="changeType" column="change_type" />
<result property="changeId" column="change_id" />
<result property="oldStatus" column="old_status" />
<result property="newStatus" column="new_status" />
<result property="changeBy" column="change_by" />
<result property="changeTime" column="change_time" />
</resultMap>
<sql id="selectMesStatusChangeInfoVo">
select status_change_info_id, change_type, change_id, old_status, new_status, change_by, change_time from mes_status_change_info
</sql>
<select id="selectMesStatusChangeInfoList" parameterType="MesStatusChangeInfo" resultMap="MesStatusChangeInfoResult">
<include refid="selectMesStatusChangeInfoVo"/>
<where>
<if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
<if test="changeId != null "> and change_id = #{changeId}</if>
<if test="oldStatus != null and oldStatus != ''"> and old_status = #{oldStatus}</if>
<if test="newStatus != null and newStatus != ''"> and new_status = #{newStatus}</if>
<if test="changeBy != null and changeBy != ''"> and change_by = #{changeBy}</if>
<if test="changeTime != null "> and change_time = #{changeTime}</if>
</where>
</select>
<select id="selectMesStatusChangeInfoByStatusChangeInfoId" parameterType="Long" resultMap="MesStatusChangeInfoResult">
<include refid="selectMesStatusChangeInfoVo"/>
where status_change_info_id = #{statusChangeInfoId}
</select>
<insert id="insertMesStatusChangeInfo" parameterType="MesStatusChangeInfo" useGeneratedKeys="true" keyProperty="statusChangeInfoId">
insert into mes_status_change_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="changeType != null and changeType != ''">change_type,</if>
<if test="changeId != null">change_id,</if>
<if test="oldStatus != null">old_status,</if>
<if test="newStatus != null and newStatus != ''">new_status,</if>
<if test="changeBy != null">change_by,</if>
<if test="changeTime != null">change_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="changeType != null and changeType != ''">#{changeType},</if>
<if test="changeId != null">#{changeId},</if>
<if test="oldStatus != null">#{oldStatus},</if>
<if test="newStatus != null and newStatus != ''">#{newStatus},</if>
<if test="changeBy != null">#{changeBy},</if>
<if test="changeTime != null">#{changeTime},</if>
</trim>
</insert>
<update id="updateMesStatusChangeInfo" parameterType="MesStatusChangeInfo">
update mes_status_change_info
<trim prefix="SET" suffixOverrides=",">
<if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
<if test="changeId != null">change_id = #{changeId},</if>
<if test="oldStatus != null">old_status = #{oldStatus},</if>
<if test="newStatus != null and newStatus != ''">new_status = #{newStatus},</if>
<if test="changeBy != null">change_by = #{changeBy},</if>
<if test="changeTime != null">change_time = #{changeTime},</if>
</trim>
where status_change_info_id = #{statusChangeInfoId}
</update>
<delete id="deleteMesStatusChangeInfoByStatusChangeInfoId" parameterType="Long">
delete from mes_status_change_info where status_change_info_id = #{statusChangeInfoId}
</delete>
<delete id="deleteMesStatusChangeInfoByStatusChangeInfoIds" parameterType="String">
delete from mes_status_change_info where status_change_info_id in
<foreach item="statusChangeInfoId" collection="array" open="(" separator="," close=")">
#{statusChangeInfoId}
</foreach>
</delete>
<select id="selectMesStatusChangeInfoListByProduce" parameterType="MesStatusChangeInfo" resultMap="MesStatusChangeInfoResult">
select status_change_info_id, change_type, change_id, old_status, new_status, change_by, change_time from mes_status_change_info
where (change_type='1' and change_id=#{productOrderId}) or (change_type='2' and change_id=#{planDetailId})
order by change_time
</select>
</mapper>

@ -67,6 +67,8 @@ public class WfProcessActivityServiceImpl implements IWfProcessActivityService
wfProcessFor.setTimeLimitDays(days);
wfProcessFor.setTimeLimitHours(hours/(60*60l));
}
}
return wfProcessActivities;
}

@ -91,7 +91,7 @@ public class WmsMove extends BaseEntity
private String applyBy;
/** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyDate;
@ -100,22 +100,22 @@ public class WmsMove extends BaseEntity
private String auditBy;
/** 审核时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditDate;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updateDate;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date beginTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;

@ -139,6 +139,9 @@ public class WmsRawReturn extends BaseEntity
private String productName;
private String executeStatusStr;
/** 原材料退库记录明细信息 */
private List<WmsRawReturnDetail> wmsRawReturnDetailList;
@ -437,6 +440,14 @@ public class WmsRawReturn extends BaseEntity
this.productName = productName;
}
public String getExecuteStatusStr() {
return executeStatusStr;
}
public void setExecuteStatusStr(String executeStatusStr) {
this.executeStatusStr = executeStatusStr;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -3,6 +3,7 @@ package com.hw.wms.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description: VO
@ -14,10 +15,14 @@ import javax.validation.constraints.NotBlank;
@Data
public class WmsProductOutstockAuditVo {
//审核状态
@NotBlank(message = "任务编号必须输入")
//任务编号
private String taskCode;
//成品出库记录ID
@NotNull(message = "成品出库记录ID必须输入")
private Long productOutstockId;
//审核状态
@NotBlank(message = "审核状态必须输入")
private String auditStatus;

@ -2,15 +2,14 @@ package com.hw.wms.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.PrintConstants;
import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.enums.WmsLocationStatus;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.security.utils.SecurityUtils;
//import com.hw.printer.api.RemotePrinterService;
import com.hw.printer.api.RemotePrinterService;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.domain.WmsLocationBarcode;
@ -19,10 +18,11 @@ import com.hw.wms.mapper.WmsBaseWarehouseMapper;
import com.hw.wms.mapper.WmsLocationBarcodeMapper;
import com.hw.wms.service.IWmsBaseLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@ -42,8 +42,8 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
@Autowired
private WmsLocationBarcodeMapper wmsLocationBarcodeMapper;
@Resource
private RemotePrinterService remotePrinterService;
@Autowired
private StringRedisTemplate redisTemplate;
/**
*
@ -220,8 +220,11 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
*/
@Override
public int printLabels(Long[] locationIds, int type) {
com.alibaba.fastjson.JSONArray printInfoJsonArr = new com.alibaba.fastjson.JSONArray();
com.alibaba.fastjson.JSONObject printContentJson = new com.alibaba.fastjson.JSONObject();
StringBuilder buffer = new StringBuilder();
for (Long locationId : locationIds) {
com.alibaba.fastjson.JSONObject printInfoObject = new com.alibaba.fastjson.JSONObject();
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationId(locationId);
String qrCode = "";
if (type == 1) {
@ -230,20 +233,28 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
qrCode = baseLocation.getContainerCode();
}
if (StringUtils.isNotEmpty(qrCode)) {
try {
HashMap<String, String> params = new HashMap<>();
params.put("text", qrCode);
params.put("qrCode", qrCode);
//调用的打印接口
remotePrinterService.printLocationLabel(params, SecurityConstants.INNER);
} catch (Exception e) {
buffer.append("打印料箱条码报错——[条码内容:").append(qrCode).append("]").append(e.getMessage());
}
printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_TEXT, qrCode);
printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_QRCODE, qrCode);
printInfoJsonArr.add(printInfoObject);
} else {
buffer.append("打印料箱条码为空——[库位条码:").append(baseLocation.getLocationCode()).append("]");
}
}
if (buffer.length() == 0) {
String printTemplate = PrintConstants.PRINT_TEMPLATE_SMALL;
printContentJson.put("template", printTemplate);
printContentJson.put("printContent", printInfoJsonArr.toString());
try {
String hostIp = IpUtils.getIpAddr();
String printKey = "print_" + hostIp;
redisTemplate.opsForList().rightPush(printKey, printContentJson.toString());
redisTemplate.expire(printKey,1, TimeUnit.DAYS);
// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString());
} catch (Exception e) {
throw new ServiceException("打印失败:" + e.getMessage());
}
return 1;
} else {
throw new ServiceException(buffer.toString());

@ -201,7 +201,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
throw new RuntimeException("没有绑定的成品条码信息!");
}
for(MesBaseBindBarcode baseBindBarcode:baseBindBarcodeList){
for (MesBaseBindBarcode baseBindBarcode : baseBindBarcodeList) {
this.saveWmsProductInstock(baseLocation.getWarehouseId(), locationCode,
baseBarcodeInfo.getPlanCode(), baseBarcodeInfo.getPlanDetailCode(), null,
baseBindBarcode.getProductId(), userName, currentDate);
@ -417,14 +417,32 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
* @return
*/
public int produceInstock(MesBaseBarcodeInfo baseBarcodeInfo, Long warehouseId, String productType, String operationType, String executeStatus, Long warehouseFloor) {
//半成品入库按原材料入库的柜体原料码进行入库
if (productType.equals(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_SEMI)) {
if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) {
throw new ServiceException("请按原材料柜体条码入库");
}
} else {//其他按成品条码入库
if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) {
} else {//其他按成品条码入库(四楼对内生产的可以按配对码入库)
String barcodeType = baseBarcodeInfo.getBarcodeType();
//判断条码信息如果是配对码,则需要通过配对码找成品条码入库
if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
String productBarcode = baseBarcodeInfo.getBindBarcode();
R<MesBaseBarcodeInfo> productBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER);
if (productBarcodeInfoR == null) {
throw new ServiceException("没找到成品条码");
}
MesBaseBarcodeInfo productBarcodeInfo = productBarcodeInfoR.getData();
if (productBarcodeInfo == null) {
throw new ServiceException("没找到成品条码!");
}
baseBarcodeInfo.setBarcodeInfo(productBarcodeInfo.getBarcodeInfo());
baseBarcodeInfo.setPlanCode(productBarcodeInfo.getPlanCode());
baseBarcodeInfo.setPlanDetailCode(productBarcodeInfo.getPlanDetailCode());
baseBarcodeInfo.setBatchCode(productBarcodeInfo.getBatchCode());
} else if (barcodeType.equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) {
} else {
throw new ServiceException("请按成品条码入库");
}
}
@ -433,19 +451,19 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
throw new ServiceException("此条码还未打印");
}
//如果执行状态不是已完成是agv入库则需要判断是否有入库记录避免重复提交如果执行状态是已完成人工入库则判断是否有此成品条码库存即可
if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) {
WmsProductInstock queryProductInstock = new WmsProductInstock();
queryProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());//productbatch是索引查出来再过滤性能更快
List<WmsProductInstock> wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock);
if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) {
List<WmsProductInstock> incompleteProductInstocks = wmsProductInstocks.stream().filter(
wmsProductInstock -> !wmsProductInstock.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)).collect(Collectors.toList());
if (incompleteProductInstocks != null && !incompleteProductInstocks.isEmpty()) {
throw new ServiceException("已经有此成品入库记录");
}
}
//判断是否已经入过库,不能重复入库
// if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) {
WmsProductInstock queryProductInstock = new WmsProductInstock();
queryProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());//productbatch是索引查出来再过滤性能更快
List<WmsProductInstock> wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock);
if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) {
// List<WmsProductInstock> incompleteProductInstocks = wmsProductInstocks.stream().filter(
// wmsProductInstock -> !wmsProductInstock.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)).collect(Collectors.toList());
// if (incompleteProductInstocks != null && !incompleteProductInstocks.isEmpty()) {
throw new ServiceException("已经有此成品入库记录");
// }
}
// }
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
@ -477,7 +495,6 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
}
/**
* ;,join material
*

@ -272,8 +272,8 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
}
List<WmsProductOutstockDetail> unConfirmedProductOutstockDetailList = wmsProductOutstockDetailList.stream().
filter(wpod ->!wpod.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_CONFIRM)).collect(Collectors.toList());
if(unConfirmedProductOutstockDetailList==null || unConfirmedProductOutstockDetailList.isEmpty()){
filter(wpod -> !wpod.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_CONFIRM)).collect(Collectors.toList());
if (unConfirmedProductOutstockDetailList == null || unConfirmedProductOutstockDetailList.isEmpty()) {
throw new ServiceException("没有待确认成品出库信息");
}
@ -317,13 +317,6 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
Long warehouseId = wmsProduceInstockVo.getWarehouseId();
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode);
BigDecimal availableAmount = getAvailableAmount(productStock); //可申请数量
if (availableAmount.compareTo(BigDecimal.ONE) < 0) {
throw new ServiceException("没有库存信息");
}
R<MesBaseBarcodeInfo> mesBaseBarcodeInfoData = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (mesBaseBarcodeInfoData == null) {
throw new ServiceException("物料条码有误");
@ -332,6 +325,37 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料条码有误!");
}
String barcodeType = mesBaseBarcodeInfo.getBarcodeType();
//判断条码信息如果是配对码,则需要通过配对码找成品条码入库
if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
String productBarcode = mesBaseBarcodeInfo.getBindBarcode();
R<MesBaseBarcodeInfo> productBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER);
if (productBarcodeInfoR == null) {
throw new ServiceException("没找到成品条码");
}
MesBaseBarcodeInfo productBarcodeInfo = productBarcodeInfoR.getData();
if (productBarcodeInfo == null) {
throw new ServiceException("没找到成品条码!");
}
mesBaseBarcodeInfo.setBarcodeInfo(productBarcodeInfo.getBarcodeInfo());
mesBaseBarcodeInfo.setBatchCode(productBarcodeInfo.getBatchCode());
mesBaseBarcodeInfo.setPlanCode(productBarcodeInfo.getPlanCode());
mesBaseBarcodeInfo.setPlanDetailCode(productBarcodeInfo.getPlanDetailCode());
} else if (barcodeType.equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) {
} else {
throw new ServiceException("请按成品条码入库");
}
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(mesBaseBarcodeInfo.getBarcodeInfo());
BigDecimal availableAmount = getAvailableAmount(productStock); //可申请数量
if (availableAmount.compareTo(BigDecimal.ONE) < 0) {
throw new ServiceException("没有库存信息");
}
Long materialId = mesBaseBarcodeInfo.getMaterialId();
Long saleOrderId = mesBaseBarcodeInfo.getSaleOrderId();
String saleorderCode = mesBaseBarcodeInfo.getSaleorderCode();
@ -343,7 +367,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
Long productOutstockId=null;
Long productOutstockId = null;
//如果是直接出库
if (outRequirement.equals(WmsConstants.WMS_WAREHOUSE_OUT_REQUIREMENT_DIRECT)) {
WmsProductOutstock wmsProductOutstock = new WmsProductOutstock();
@ -392,7 +416,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
}
List<WmsProductOutstock> auditPassProductOutstocks = saleProductOutstocks.stream().filter(wmsProductOutstock ->
wmsProductOutstock.getAuditStatus().equals(WmsConstants.WMS_AUDIT_STATUS_PASS)
wmsProductOutstock.getAuditStatus().equals(WmsConstants.WMS_AUDIT_STATUS_PASS)
).collect(Collectors.toList());
if (auditPassProductOutstocks == null || auditPassProductOutstocks.isEmpty()) {
throw new ServiceException("此销售订单[" + saleorderCode + "]的成品出库申请未审核通过");
@ -410,7 +434,6 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
}
//更新出库记录
if (applyQty.compareTo(currentOutstockQty) == 0) {
productOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
@ -425,6 +448,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
}
productOutstock.setUpdateDate(currentDate);
productOutstock.setUpdateBy(userName);
productOutstock.setProductBatch(materialBarcode);
wmsProductOutstockMapper.updateWmsProductOutstock(productOutstock);
wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());
@ -492,32 +516,52 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
public int auditProductOutstock(WmsProductOutstockAuditVo wmsProductOutstockAuditVo) {
String auditStatus = wmsProductOutstockAuditVo.getAuditStatus();
String auditReason = wmsProductOutstockAuditVo.getAuditReason();
String taskCode = wmsProductOutstockAuditVo.getTaskCode();
Long productOutstockId = wmsProductOutstockAuditVo.getProductOutstockId();
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
WmsProductOutstock queryProductOutstock = new WmsProductOutstock();
queryProductOutstock.setTaskCode(taskCode);
queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT);
List<WmsProductOutstock> wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock);
if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) {
throw new ServiceException("无待审核成品出库记录");
}
// WmsProductOutstock queryProductOutstock = new WmsProductOutstock();
// queryProductOutstock.setTaskCode(taskCode);
// queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT);
// List<WmsProductOutstock> wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock);
// if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) {
// throw new ServiceException("无待审核成品出库记录");
// }
WmsProductOutstock wmsProductOutstock = wmsProductOutstockMapper.selectWmsProductOutstockByProductOutstockId(productOutstockId);
//审核不通过,需要有审核意见
if (auditStatus.equalsIgnoreCase(WmsConstants.WMS_AUDIT_STATUS_FAIL)) {
if (StringUtils.isEmpty(auditReason)) {
throw new ServiceException("请输入审核意见");
}
WmsStockTotal queryStockTotal = new WmsStockTotal();
queryStockTotal.setWarehouseId(wmsProductOutstock.getWarehouseId());
queryStockTotal.setMaterialId(wmsProductOutstock.getProductId());
queryStockTotal.setSaleOrderId(wmsProductOutstock.getSaleOrderId());
List<WmsStockTotal> wmsStockTotals = wmsStockTotalMapper.selectOnlyWmsStockTotalList(queryStockTotal);
if (wmsStockTotals == null || wmsStockTotals.isEmpty()) {
throw new ServiceException("没有库存");
}
WmsStockTotal wmsStockTotal = wmsStockTotals.get(0);
wmsStockTotal.setOccupyAmount(wmsStockTotal.getOccupyAmount().subtract(wmsProductOutstock.getApplyQty()));
wmsStockTotal.setUpdateBy(userName);
wmsStockTotal.setUpdateDate(currentDate);
wmsStockTotalMapper.updateWmsStockTotal(wmsStockTotal);
wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
}
WmsProductOutstock wmsProductOutstock = new WmsProductOutstock();
wmsProductOutstock.setAuditStatus(auditStatus);
wmsProductOutstock.setAuditReason(auditReason);
wmsProductOutstock.setAuditBy(userName);
wmsProductOutstock.setAuditDate(currentDate);
wmsProductOutstock.setTaskCode(taskCode);
return wmsProductOutstockMapper.auditWmsProductOutstockByTaskCode(wmsProductOutstock);
return wmsProductOutstockMapper.updateWmsProductOutstock(wmsProductOutstock);
}
private static BigDecimal getAvailableAmount(WmsProductStock productStock) {

@ -545,8 +545,6 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
: wmsRawOutstock.getTaskType();
String warehouseType = baseWarehouse.getWarehouseType();
//TODO 判断质检状态,还是在实际出库时判断质检状态
String queryQualityStatus = WmsConstants.WMS_QUALITY_STATUS_PASS;
List<WmsRawOutstock> toInsertedRawOutstocks = new ArrayList<>();

@ -309,6 +309,9 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
// throw new ServiceException("输入数量需为1");
// }
// }
if (!wmsRawReturn.getMaterialId().equals(mesBaseBarcodeInfo.getMaterialId())) {
throw new ServiceException("退库物料不匹配");
}
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);
@ -485,6 +488,16 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
String taskCode = Seq.getId(Seq.rawReturnSeqType, Seq.rawReturnCode);
for (WmsRawReturn rawReturn : wmsRawReturns) {
if (baseWarehouse.getWarehouseFloor().equals(5L)) {
WmsRawReturn queryRawReturn = new WmsRawReturn();
queryRawReturn.setEndStationCode(rawReturn.getEndStationCode());
queryRawReturn.setExecuteStatusStr(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE + "," + WmsConstants.WMS_EXECUTE_STATUS_EXECUTING);
List<WmsRawReturn> wmsRawReturnList = wmsRawReturnMapper.selectWmsRawReturnList(queryRawReturn);
if (wmsRawReturnList != null && !wmsRawReturnList.isEmpty()) {
throw new ServiceException("此工位还有未完成的退库物料");
}
}
BigDecimal planAmount = rawReturn.getPlanAmount();
if (planAmount.compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("数量需大于0");
@ -505,7 +518,6 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
}
// /**
// * 申请退库
// *
@ -653,6 +665,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
/**
* 退
*
*
* @param taskCode 退
* @return 退VO
*/
@ -662,7 +675,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
WmsRawReturn queryRawReturn = new WmsRawReturn();
queryRawReturn.setTaskCode(taskCode);
List<WmsRawReturn> wmsRawReturnList = wmsRawReturnMapper.selectGetRawReturnByTaskCode(queryRawReturn);
if (wmsRawReturnList.size() > 0){
if (wmsRawReturnList.size() > 0) {
WmsRawReturn wmsRawReturn = wmsRawReturnList.get(0);
wmsRawReturnAuditReturnVo.setWmsRawReturn(wmsRawReturn);
wmsRawReturnAuditReturnVo.setWmsRawReturnDetailList(wmsRawReturnList);

@ -226,6 +226,12 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("库位不存在");
}
WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(oriLocation.getWarehouseId());
if(!baseWarehouse.getWarehouseInstockType().equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_SEMI)){
throw new ServiceException("请从半成品库出库");
}
//删除成品库存
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode);
if (productStock == null) {
@ -307,6 +313,11 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("库位不存在");
}
WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(targetLocation.getWarehouseId());
if(!baseWarehouse.getWarehouseInstockType().equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_PRODUCT)){
throw new ServiceException("请入成品库");
}
WmsProductStock queryProductStock = new WmsProductStock();
queryProductStock.setLocationCode(targetLocationCode);
List<WmsProductStock> productStocks = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock);

@ -113,6 +113,8 @@ public class WmsWarehouseMaterialServiceImpl implements IWmsWarehouseMaterialSer
*/
@Override
public List<WmsWarehouseMaterial> selectWmsWarehouseMaterialJoinList(WmsWarehouseMaterial wmsWarehouseMaterial) {
wmsWarehouseMaterial.setMaterialSpec(StringUtils.isNotEmpty(wmsWarehouseMaterial.getMaterialSpec())
? wmsWarehouseMaterial.getMaterialSpec().replaceAll("\\s+", "") : "");
return wmsWarehouseMaterialMapper.selectWmsWarehouseMaterialJoinList(wmsWarehouseMaterial);
}

@ -74,7 +74,7 @@
<if test="locationCode != null and locationCode != ''">and wps.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wps.stock_type = #{stockType}</if>
<if test="stockTypeStr != null and stockTypeStr != ''">and wps.stock_type in ('2','3')</if>
<if test="productBatch != null and productBatch != ''">and wps.product_batch = #{productBatch}</if>
<if test="productBatch != null and productBatch != ''">and wps.product_batch like concat('%', #{productBatch}, '%')</if>
<if test="qualityStatus != null and qualityStatus != ''">and wps.quality_status = #{qualityStatus}</if>
<if test="productId != null ">and wps.product_id = #{productId}</if>
<if test="planCode != null ">and wps.plan_code = #{planCode}</if>

@ -88,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="executeStatus != null and executeStatus != ''"> and execute_status = #{executeStatus}</if>
<if test="executeStatusStr != null and executeStatusStr != ''"> and execute_status in (${executeStatusStr})</if>
<if test="endStationCode != null and endStationCode != ''"> and end_station_code = #{endStationCode}</if>
<if test="applyBy != null and applyBy != ''"> and apply_by = #{applyBy}</if>
<if test="applyDate != null "> and apply_date = #{applyDate}</if>
<if test="auditBy != null and auditBy != ''"> and audit_by = #{auditBy}</if>

@ -334,7 +334,8 @@
'%')</if>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code like concat('%', #{saleorderCode}, '%')</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch = #{instockBatch}</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch like concat('%', #{instockBatch},
'%')</if>
<if test="instockDate != null ">and wrs.instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and wrs.last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wrs.quality_status = #{qualityStatus}</if>

@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialSpec" column="material_spec" />
</resultMap>
<sql id="selectWmsWarehouseMaterialVo">
@ -84,10 +85,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsWarehouseMaterialJoinList" parameterType="WmsWarehouseMaterial" resultMap="WmsWarehouseMaterialResult">
select wwm.warehouse_material_id,wwm.warehouse_id, wwm.warehouse_floor,wwm.location_code, wwm.storage_type, wwm.storage_id, wwm.create_time, wwm.create_by,
mbm.material_code,mbm.material_name
mbm.material_code,mbm.material_name,mbm.material_spec
from wms_warehouse_material wwm left join mes_base_material_info mbm on wwm.storage_id=mbm.material_id and wwm.storage_type='1'
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="materialCode != null and materialCode != ''">and mbm.material_code like concat('%', #{materialCode},'%')</if>
<if test="materialName != null and materialName != ''">and mbm.material_name like concat('%', #{materialName},
'%')
</if>
<if test="materialSpec != null and materialSpec != ''">and replace(mbm.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
</where>
</select>

@ -51,3 +51,21 @@ export function getDeviceLedgerList(query) {
params: query
})
}
// 查询设备台账信息列表
export function listAllLedger(query) {
return request({
url: '/dms/ledger/listAll',
method: 'get',
params: query
})
}
// 打印设备编码
export function printDeviceLabels(deviceId) {
return request({
url: '/dms/ledger/printDeviceLabels/'+deviceId,
method: 'get',
})
}

@ -187,3 +187,13 @@ export function mergeUpdateBarcode(data) {
data: data
})
}
// 查询小包条码信息列表
export function listPrdBarcode(query) {
return request({
url: '/mes/barcode/listPrdBarcode',
method: 'get',
params: query
})
}

@ -138,3 +138,23 @@ export function getPurchaseOrdersWithBind(query) {
params: query
})
}
// 获取生产bom List
export function getMaterialBoms(query) {
return request({
url: '/mes/purchaseOrder/getMaterialBoms',
method: 'get',
params: query
})
}
// 查询采购订单信息列表
export function getOrderBinds(query) {
return request({
url: '/mes/purchaseOrder/getOrderBinds',
method: 'get',
params: query
})
}

@ -52,3 +52,14 @@ export function listOrderBinds(query) {
params: query
})
}
// 查询销售订单关联信息列表
export function selectSaleOrderRelates(query) {
return request({
url: '/mes/api/selectSaleOrderRelates',
method: 'get',
params: query
})
}

@ -125,7 +125,6 @@
</el-button>
<el-popover
placement="top"
width="260"
@ -225,8 +224,8 @@
<!-- 添加或修改对内生产的原材料条码信息对话框 -->
<el-dialog :title="internalTitle" :visible.sync="internalOpen" width="500px" append-to-body>
<el-form ref="internalForm" :model="internalForm" :rules="internalRules" label-width="100px">
<el-form-item label="成品码" prop="productBarcode">
<el-form ref="internalForm" :model="internalForm" :rules="internalRules" label-width="120px">
<el-form-item label="成品或配对码" prop="productBarcode">
<el-input type="textarea" v-model="internalForm.productBarcode" placeholder="请输入或扫描成品条码,多个以,隔开"
class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button>
@ -290,10 +289,13 @@ import {
checkSemiOutstock,
reprintBarcodes
} from "@/api/board/barcode";
import {monitorSerialData} from "@/utils/serial"
import {noticeData} from "@/utils/notice";
export default {
name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_print_flag'],
mixins: [monitorSerialData],
data() {
return {
//
@ -511,7 +513,7 @@ export default {
planDetailCode: this.defineData.planDetailCode,
singleFlag: this.defineData.singleFlag,
saleOrderId: this.defineData.saleOrderId,
productId:this.defineData.productId,
productId: this.defineData.productId,
batchFlag: '0',
bindBarcode: bindBarcode,
barcodeType: "",
@ -524,7 +526,7 @@ export default {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
planDetailCode: this.defineData.planDetailCode,
productId : this.defineData.productId,
productId: this.defineData.productId,
saleOrderId: this.defineData.saleOrderId,
saleorderCode: this.defineData.saleorderCode,
materialBomId: this.defineData.materialBomId,
@ -535,6 +537,26 @@ export default {
this.queryParams.planDetailCode = this.defineData.planDetailCode;
this.queryParams.singleFlag = this.SINGLE_FLAG.INTERNAL;
this.queryParams.barcodeType = this.BARCODE_TYPE.RAW;
// if (!this.checkSerialConnected()) {
// this.$confirm('', '', {
// confirmButtonText: '',
// showClose: true,
// // beforeClose:async(action,instance,done)=>{
// // if(action==='confirm'){
// // }else{
// // this.connectSerialPort();
// // }
// //
// // },
// showCancelButton: true,
// type: 'warning'
// }).then(() => {
// this.connectSerial(this.setSerialData);
// }).catch(() => {
// });
// }
}
},
@ -718,6 +740,7 @@ export default {
printBindBarcodes(barcodeIds, printNumber).then(response => {
this.$modal.msgSuccess("打印条码成功");
this.getList();
this.closePopover();
}).catch(() => {
});
},
@ -917,6 +940,19 @@ export default {
},
setSerialData() {
if (this.internalForm.productBarcode && this.internalForm.productBarcode !== '') {
this.internalForm.productBarcode = "," + this.serialData;
} else {
this.internalForm.productBarcode = this.serialData;
}
// console.log(this.serialData)
},
}
};
</script>

@ -27,9 +27,10 @@
</el-form>
<el-divider content-position="center">物料信息</el-divider>
<el-divider v-if="materialVisible" content-position="center"></el-divider>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-if="materialVisible"
label-width="130px">
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleSelectMaterial"></el-button>
</el-form-item>
@ -40,6 +41,7 @@
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%;"
v-if="materialVisible"
>
<el-table-column
label="物料编号"
@ -122,7 +124,7 @@ export default {
'select-material': selectMaterial,
},
dicts: ['mes_safe_flag', 'mes_material_accessories_flag','wms_raw_return_task_type'],
dicts: ['mes_safe_flag', 'mes_material_accessories_flag', 'wms_raw_return_task_type'],
inject: ['closeRawReturnDialog'],
data() {
return {
@ -138,6 +140,7 @@ export default {
multiple: true,
//
showSearch: true,
materialVisible: false,
//
total: 0,
//
@ -221,6 +224,9 @@ export default {
wmsRawReturnList: []
}
if (this.form.warehouseFloor === 5) {
this.materialVisible = false;
}
}
if (this.defineData.maxPlanAmount) {
this.maxPlanAmount = this.defineData.maxPlanAmount
@ -261,24 +267,24 @@ export default {
submitMaterialForm() {
let selectedRow = this.$refs.materialRef.selectedRow;
let rawReturnObj = {
"warehouseId":this.form.warehouseId,
"planCode":this.form.planCode,
"planDetailCode":this.form.planDetailCode,
"productId":this.form.productId,
"endStationCode":this.form.endStationCode,
"applyReason":"",
"taskType":"",
"materialId":selectedRow.materialId,
"materialCode":selectedRow.materialCode,
"materialName":selectedRow.materialName,
"materialSpec":selectedRow.materialSpec,
"planAmount":null
"warehouseId": this.form.warehouseId,
"planCode": this.form.planCode,
"planDetailCode": this.form.planDetailCode,
"productId": this.form.productId,
"endStationCode": this.form.endStationCode,
"applyReason": "",
"taskType": "",
"materialId": selectedRow.materialId,
"materialCode": selectedRow.materialCode,
"materialName": selectedRow.materialName,
"materialSpec": selectedRow.materialSpec,
"planAmount": null
};
this.wmsRawReturnList.push(rawReturnObj);
this.materialOpen = false;
},
handleDeleteMaterial(row){
handleDeleteMaterial(row) {
},
@ -327,18 +333,23 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.wmsRawReturnList.length <= 0) {
this.$modal.msgWarning("请选择要退库的物料");
return;
}
for (const wmsRawReturn of this.wmsRawReturnList) {
if(wmsRawReturn.planAmount <=0){
this.$modal.msgWarning("退库数量需大于0");
if (this.form.warehouseFloor === 5) {
this.form.planAmount = 1;
this.wmsRawReturnList.push(this.form);
} else {
if (this.wmsRawReturnList.length <= 0) {
this.$modal.msgWarning("请选择要退库的物料");
return;
}
wmsRawReturn.applyReason = this.form.applyReason;
wmsRawReturn.taskType = this.form.taskType;
for (const wmsRawReturn of this.wmsRawReturnList) {
if (wmsRawReturn.planAmount <= 0) {
this.$modal.msgWarning("退库数量需大于0");
return;
}
wmsRawReturn.applyReason = this.form.applyReason;
wmsRawReturn.taskType = this.form.taskType;
}
}
this.submitloading = true;
@ -358,7 +369,6 @@ export default {
},
}
};
</script>

@ -0,0 +1,92 @@
<template>
<div>
<el-table v-loading="loading" :data="relateSaleOrderList">
<el-table-column label="销售订单号" align="center" prop="relateSaleOrderCode"/>
<el-table-column label="物料编码" align="center" prop="productCode"/>
<el-table-column label="物料名称" align="center" prop="productName"/>
<el-table-column label="物料规格" align="center" prop="productSpec"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="relateQueryParams.pageNum"
:limit.sync="relateQueryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { selectSaleOrderRelates } from "@/api/mes/saleOrder";
export default {
name: "SaleOrderRelates",
props: {
defineData: {
type: Object,
default: {}
}
},
inject: ['closeDialog'],
data() {
return {
//
loading: true,
//
total: 0,
relateSaleOrderList:[],
//
relateQueryParams: {
pageNum: 1,
pageSize: 10,
},
};
},
created() {
this.getData();
},
methods: {
getData() {
if (this.defineData.virtualMaterialId) {
this.getList();
}
},
/** 查询销售订单信息列表 */
getList() {
this.loading = true;
this.relateQueryParams.selectFlag = null;
this.relateQueryParams.relateFlag = "1";
this.relateQueryParams.virtualMaterialId = this.defineData.virtualMaterialId;
selectSaleOrderRelates(this.relateQueryParams).then(response => {
this.relateSaleOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
}
};
</script>
<style lang="less" scoped>
.el-table {
background-color: #fff0;
overflow-y: auto;
}
.roundBorder {
position: absolute;
transform: translate(-50%, -50%);
}
</style>

@ -41,10 +41,10 @@
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="completeCollectMaterials()">完成领料
</el-button>
<el-button size="mini" type="warning" v-if="(!$route.query || $route.query.id==='2')"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="handleMaterialConfirmForm()">扫描
</el-button>
<!-- <el-button size="mini" type="warning" v-if="(!$route.query || $route.query.id==='2')"-->
<!-- :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"-->
<!-- @click="handleMaterialConfirmForm()">扫描-->
<!-- </el-button>-->
<el-button size="mini" type="danger" @click="handleApplyRawReturn()"
v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">退料
@ -221,6 +221,13 @@
width="120"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleSaleOrderRelates(scope.row)"
v-if="scope.row.materialClassfication==='2'"
>详情</el-button>
<el-button
size="small"
style="margin-right: 12px"
@ -464,6 +471,16 @@
<div id="viewFile">
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</div>
<!-- 关联销售订单信息对话框 -->
<el-dialog title="关联信息" :visible.sync="relateDialogVisible" append-to-body>
<sale-order-relates ref="saleOrderRelatesRef" :defineData="saleOrderRelatesData"
v-if="relateDialogVisible"></sale-order-relates>
</el-dialog>
<!-- <el-dialog :visible.sync="assignModel" title="工位选择" width="80%">-->
<!-- <el-table :data="stationData" highlight-current-row-->
@ -524,6 +541,9 @@ import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {monitorSerialData} from "@/utils/serial";
import saleOrderRelates from "@/views/board/common/saleOrderRelates.vue";
const setState = (e) => {
if (e === '1') {
@ -545,6 +565,7 @@ export default {
components: {
'apply-raw-outstock': applyRawOutstock,
'apply-raw-return': applyRawReturn,
'sale-order-relates': saleOrderRelates,
Chart,
PrintPage,
WorkshopNotice,
@ -557,7 +578,7 @@ export default {
closeRawReturnDialog:this.closeRawReturnDialog
}
},
mixins: [noticeData],
mixins: [monitorSerialData, noticeData],
data() {
return {
fileList: [],
@ -580,6 +601,9 @@ export default {
taskType: '',
dialogVisible: false,
productPlanData: {},
relateDialogVisible:false,
saleOrderRelatesData: {},
form: {},
form1: {},
submitLoading: false,
@ -736,6 +760,7 @@ export default {
}
},
async mounted() {
this.firstConnectSerial();
// setInterval(() => {
// this.$notify.info({
// title: '',
@ -1562,6 +1587,26 @@ export default {
}
this.rawBackVisible = true;
if (!this.checkSerialConnected()) {
this.$confirm('请连接条码枪', '提示', {
confirmButtonText: '连接',
showClose: true,
// beforeClose:async(action,instance,done)=>{
// if(action==='confirm'){
// }else{
// this.connectSerialPort();
// }
//
// },
showCancelButton: true,
type: 'warning'
}).then(() => {
this.connectSerial(this.setSerialData);
}).catch(() => {
});
}
},
@ -1800,6 +1845,41 @@ export default {
});
},
firstConnectSerial() {
if (!this.checkSerialConnected()) {
this.$confirm('请连接条码枪', '提示', {
confirmButtonText: '连接',
showClose: true,
showCancelButton: true,
type: 'warning'
}).then(() => {
this.connectSerial(this.setSerialData);
}).catch(() => {
});
}
},
setSerialData() {
if (this.rawBackVisible) {
this.rawBackForm.materialBarcode = this.serialData;
} else {
this.input1 = this.serialData;
}
// console.log(this.serialData)
},
handleSaleOrderRelates(row){
this.saleOrderRelatesData = {
virtualMaterialId: row.materialId,
}
this.relateDialogVisible = true
},
}
}
</script>

@ -275,9 +275,9 @@
:visible.sync="productInstockVisible"
:title="productInstockTitle"
width="40%">
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px">
<el-form-item label="成品码" prop="materialBarcode">
<el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input>
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="98px">
<el-form-item label="成品/配对码" prop="materialBarcode">
<el-input v-model="productInstockForm.materialBarcode" placeholder="请扫描成品码或配对码" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -459,7 +459,7 @@ export default {
},
productInstockRules: {
materialBarcode: [
{required: true, message: "成品码不能为空", trigger: "blur"}
{required: true, message: "成品/配对码不能为空", trigger: "blur"}
],
},
submitLoading:false,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save