Compare commits

...

2 Commits

Author SHA1 Message Date
xs 44802a7114 Merge remote-tracking branch 'origin/master' 2 weeks ago
xs 6610b396e9 3.4.6
移库合库记录查询完善
设备码打印
增加成品条码和小包条码的查看
维修工单完善
2 weeks ago

@ -201,6 +201,8 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String rawFlag; private String rawFlag;
private String prdBarcodeInfo;
public String getLocationCode() { public String getLocationCode() {
return locationCode; return locationCode;
@ -651,6 +653,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
this.rawFlag = rawFlag; this.rawFlag = rawFlag;
} }
public String getPrdBarcodeInfo() {
return prdBarcodeInfo;
}
public void setPrdBarcodeInfo(String prdBarcodeInfo) {
this.prdBarcodeInfo = prdBarcodeInfo;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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); Transport.send(message);
System.out.println("邮件已成功发送!"); // System.out.println("邮件已成功发送!");
} catch (MessagingException e) { } catch (MessagingException e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e); throw new RuntimeException(e);
@ -90,7 +90,7 @@ public class MailUtils {
// 发送邮件 // 发送邮件
Transport.send(message); Transport.send(message);
System.out.println("邮件已成功发送!"); // System.out.println("邮件已成功发送!");
} catch (MessagingException e) { } catch (MessagingException e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e); throw new RuntimeException(e);

@ -114,4 +114,30 @@ public class DmsBaseDeviceLedgerController extends BaseController
{ {
return toAjax(dmsBaseDeviceLedgerService.deleteDmsBaseDeviceLedgerByDeviceIds(deviceIds)); 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));
}
} }

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

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

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

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

@ -1,12 +1,17 @@
package com.hw.dms.service.impl; package com.hw.dms.service.impl;
import java.util.List; 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.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; 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.common.security.utils.SecurityUtils;
import com.hw.system.api.model.LoginUser; import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBaseDeviceLedgerMapper; import com.hw.dms.mapper.DmsBaseDeviceLedgerMapper;
import com.hw.dms.domain.DmsBaseDeviceLedger; import com.hw.dms.domain.DmsBaseDeviceLedger;
@ -23,6 +28,9 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
@Autowired @Autowired
private DmsBaseDeviceLedgerMapper dmsBaseDeviceLedgerMapper; private DmsBaseDeviceLedgerMapper dmsBaseDeviceLedgerMapper;
@Autowired
private StringRedisTemplate redisTemplate;
/** /**
* *
* *
@ -60,7 +68,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
DeviceLedger.setDeviceCode(dmsBaseDeviceLedger.getDeviceCode()); DeviceLedger.setDeviceCode(dmsBaseDeviceLedger.getDeviceCode());
List<DmsBaseDeviceLedger> dmsBaseDeviceLedgerList = dmsBaseDeviceLedgerMapper. List<DmsBaseDeviceLedger> dmsBaseDeviceLedgerList = dmsBaseDeviceLedgerMapper.
selectDmsBaseDeviceLedgerList(DeviceLedger); selectDmsBaseDeviceLedgerList(DeviceLedger);
if (dmsBaseDeviceLedgerList.size()>0) { if (dmsBaseDeviceLedgerList.size() > 0) {
throw new ServiceException("设备编号已存在"); throw new ServiceException("设备编号已存在");
} }
dmsBaseDeviceLedger.setCreateBy(loginUser.getUsername()); dmsBaseDeviceLedger.setCreateBy(loginUser.getUsername());
@ -131,4 +139,44 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
return dmsBaseDeviceLedger; 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;
}
} }

@ -2,10 +2,13 @@ package com.hw.dms.service.impl;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import com.hw.common.core.constant.DmsConstants;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.dms.domain.*; import com.hw.dms.domain.*;
import com.hw.dms.mapper.DmsBillsFaultInstanceMapper; import com.hw.dms.mapper.DmsBillsFaultInstanceMapper;
import com.hw.dms.mapper.DmsInstanceFileMapper;
import com.hw.system.api.model.LoginUser; import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -25,6 +28,8 @@ public class DmsFaultInstanceActivityServiceImpl implements IDmsFaultInstanceAct
private DmsFaultInstanceActivityMapper dmsFaultInstanceActivityMapper; private DmsFaultInstanceActivityMapper dmsFaultInstanceActivityMapper;
@Autowired @Autowired
private DmsBillsFaultInstanceMapper dmsBillsFaultInstanceMapper; private DmsBillsFaultInstanceMapper dmsBillsFaultInstanceMapper;
@Autowired
private DmsInstanceFileMapper dmsInstanceFileMapper;
/** /**
* *
@ -47,7 +52,16 @@ public class DmsFaultInstanceActivityServiceImpl implements IDmsFaultInstanceAct
@Override @Override
public List<DmsFaultInstanceActivity> selectDmsFaultInstanceActivityList(DmsFaultInstanceActivity dmsFaultInstanceActivity) 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;
} }
/** /**

@ -76,4 +76,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteDmsInstanceFileByUpdate"> <delete id="deleteDmsInstanceFileByUpdate">
delete from dms_instance_file where target_type = 1 and target_id =#{targetId} delete from dms_instance_file where target_type = 1 and target_id =#{targetId}
</delete> </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> </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); return success(list);
} }

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

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

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

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

@ -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,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);
}

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

@ -16,9 +16,6 @@ import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesBindBarcodeVo; import com.hw.mes.domain.vo.MesBindBarcodeVo;
import com.hw.mes.mapper.*; import com.hw.mes.mapper.*;
import com.hw.mes.service.IMesBaseBarcodeInfoService; 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.RemoteWmsService;
import com.hw.wms.api.domain.WmsWarehouseMaterial; import com.hw.wms.api.domain.WmsWarehouseMaterial;
import com.hw.wms.api.domain.vo.WmsProductStockVo; import com.hw.wms.api.domain.vo.WmsProductStockVo;
@ -31,7 +28,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -85,6 +81,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Autowired @Autowired
private MesRaiseCapitalBomMapper mesRaiseCapitalBomMapper; private MesRaiseCapitalBomMapper mesRaiseCapitalBomMapper;
@Autowired
private MesPrdBarcodeInfoMapper mesPrdBarcodeInfoMapper;
@Autowired @Autowired
private MesConfig mesConfig; private MesConfig mesConfig;
@ -655,15 +654,14 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String printTemplate = ""; String printTemplate = "";
if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_RAW)) { 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)) { } 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)) { } 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("template", printTemplate);
printContentJson.put("printContent", pintBarcodeJsonArr.toString()); printContentJson.put("printContent", pintBarcodeJsonArr.toString());
System.out.println(printContentJson.toString());
try { try {
@ -708,21 +706,21 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String materialName = mesBaseBarcodeInfo.getMaterialName(); String materialName = mesBaseBarcodeInfo.getMaterialName();
JSONObject printInfoObject = new JSONObject(); JSONObject printInfoObject = new JSONObject();
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE, mesBaseBarcodeInfo.getMaterialCode()); printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE, mesBaseBarcodeInfo.getMaterialCode());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE, mesBaseBarcodeInfo.getSaleorderCode()); printInfoObject.put(PrintConstants.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_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; // materialName = materialName.length() <= 10 ? "\n" + materialName : materialName;
// printMaterialName.setValue(materialName.replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); // printMaterialName.setValue(materialName.replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
// printMaterialName.setType(PrintContentVo.TYPE_TEXT); // 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(PrintConstants.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BATCH_CODE, mesBaseBarcodeInfo.getBatchCode()); printInfoObject.put(PrintConstants.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_PO_NO, mesBaseBarcodeInfo.getPoNo());
//常备物料为安全库存 //常备物料为安全库存
@ -732,7 +730,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// printPreMaterial.setType(PrintContentVo.TYPE_CHECKBOX); // 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]", "")); : mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
// PrintContentVo printQty = new PrintContentVo(); // PrintContentVo printQty = new PrintContentVo();
@ -743,13 +741,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// printQty.setType(PrintContentVo.TYPE_TEXT); // printQty.setType(PrintContentVo.TYPE_TEXT);
} else if (printType.equals(PrinterVo.PRINT_TYPE_PRODUCT_LABEL)) { } else if (printType.equals(PrintConstants.PRINT_TYPE_PRODUCT_LABEL)) {
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_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? "" printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC, mesBaseBarcodeInfo.getBarcodeSpec() == null ? ""
: mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); : mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo()); printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_BARCODE, mesBaseBarcodeInfo.getBarcodeInfo());
printInfoObject.put(PrintContentVo.PRODUCT_PLAN_CODE, mesBaseBarcodeInfo.getPlanCode()); printInfoObject.put(PrintConstants.PRODUCT_PLAN_CODE, mesBaseBarcodeInfo.getPlanCode());
printInfoObject.put(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QTY, "1"); printInfoObject.put(PrintConstants.RAW_MATERIAL_LABEL_KEY_QTY, "1");
} }
@ -1846,6 +1844,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, // public MesPurchaseOrder insertVirtualPurchaseOrder(Long materialId, String barcodeInfo, BigDecimal sumOrderAmount,
// List<MesPurchaseOrderRelate> mesPurchaseOrderRelates,String userName, Date currentDate) { // List<MesPurchaseOrderRelate> mesPurchaseOrderRelates,String userName, Date currentDate) {
// MesPurchaseOrder virtualPurchaseOrder = new MesPurchaseOrder(); // MesPurchaseOrder virtualPurchaseOrder = new MesPurchaseOrder();

@ -3,26 +3,28 @@ package com.hw.mes.service.impl;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import com.hw.common.core.constant.MesConstants; 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.constant.SecurityConstants;
import com.hw.common.core.domain.R; import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils; 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.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.vo.MesPalletInfoBindVo; import com.hw.mes.domain.vo.MesPalletInfoBindVo;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper; import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.printer.api.RemotePrinterService;
import com.hw.wms.api.RemoteWmsService; import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.WmsWarehouseMaterial; import com.hw.wms.api.domain.WmsWarehouseMaterial;
import com.hw.wms.api.domain.vo.WmsProductStockVo; import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo; import com.hw.wms.api.domain.vo.WmsRawStockVo;
import com.hw.wms.api.domain.vo.WmsWarehouseMaterialExistVo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBasePalletInfoMapper; import com.hw.mes.mapper.MesBasePalletInfoMapper;
import com.hw.mes.domain.MesBasePalletInfo; import com.hw.mes.domain.MesBasePalletInfo;
@ -48,8 +50,8 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
@Autowired @Autowired
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper; private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
@Resource @Autowired
private RemotePrinterService remotePrinterService; private StringRedisTemplate redisTemplate;
@Resource @Resource
private RemoteWmsService remoteWmsService; private RemoteWmsService remoteWmsService;
@ -209,24 +211,34 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
*/ */
@Override @Override
public int printPalletInfoCodes(String[] palletInfoCodes) { 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) { for (String palletInfoCode : palletInfoCodes) {
if (StringUtils.isNotEmpty(palletInfoCode)) { if (StringUtils.isNotEmpty(palletInfoCode)) {
try { com.alibaba.fastjson.JSONObject printInfoObject = new com.alibaba.fastjson.JSONObject();
HashMap<String, String> params = new HashMap<>(); if (StringUtils.isNotEmpty(palletInfoCode)) {
params.put("text", palletInfoCode); printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_TEXT, palletInfoCode);
params.put("qrCode", palletInfoCode); printInfoObject.put(PrintConstants.SMALL_LABEL_KEY_QRCODE, palletInfoCode);
//调用的打印接口 printInfoJsonArr.add(printInfoObject);
remotePrinterService.printLocationLabel(params, SecurityConstants.INNER); } else {
} catch (Exception e) { throw new ServiceException("请选择有设备编号的设备进行打印");
buffer.append("打印托盘RFID编码报错——[编码内容:").append(palletInfoCode).append("]").append(e.getMessage());
} }
} }
} }
if (buffer.length() == 0) { String printTemplate = PrintConstants.PRINT_TEMPLATE_SMALL;
return 1; printContentJson.put("template", printTemplate);
} else { printContentJson.put("printContent", printInfoJsonArr.toString());
throw new ServiceException(buffer.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;
} }
} }

@ -109,7 +109,8 @@
<if test="barcodeTypeStr != null and barcodeTypeStr != ''">and bbi.barcode_type in (${barcodeTypeStr})</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="barcodeType != null and barcodeType != ''">and bbi.barcode_type = #{barcodeType}</if>
<if test="singleFlag != null and singleFlag != ''">and bbi.single_flag = #{singleFlag}</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="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="palletInfoCode != null and palletInfoCode != ''">and bbi.pallet_info_code = #{palletInfoCode}</if>
<if test="bindBarcode != null and bindBarcode != ''">and bbi.bind_barcode = #{bindBarcode}</if> <if test="bindBarcode != null and bindBarcode != ''">and bbi.bind_barcode = #{bindBarcode}</if>
@ -136,8 +137,10 @@
<if test="productionDate != null ">and bbi.production_date = #{productionDate}</if> <if test="productionDate != null ">and bbi.production_date = #{productionDate}</if>
<if test="acceptedDate != null ">and bbi.accepted_date = #{acceptedDate}</if> <if test="acceptedDate != null ">and bbi.accepted_date = #{acceptedDate}</if>
<if test="lastOutstockDate != null ">and bbi.last_outstock_date = #{lastOutstockDate}</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="planCode != null and planCode != ''">and bbi.plan_code like concat('%', #{planCode},
<if test="planDetailCode != null and planDetailCode != ''">and bbi.plan_detail_code = #{planDetailCode}</if> '%')</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="saleOrderId != null ">and bbi.sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''">and bbi.saleorder_code like concat('%', #{saleorderCode}, <if test="saleorderCode != null and saleorderCode != ''">and bbi.saleorder_code like concat('%', #{saleorderCode},
'%')</if> '%')</if>
@ -154,6 +157,11 @@
or exists or exists
(select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode} (select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode}
and bbi.bind_barcode=mbbi.barcode_info)</if> 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> </where>
order by bbi.barcode_id desc order by bbi.barcode_id desc

@ -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>

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

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

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

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

@ -309,6 +309,9 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
// throw new ServiceException("输入数量需为1"); // throw new ServiceException("输入数量需为1");
// } // }
// } // }
if(!wmsRawReturn.getMaterialId().equals(mesBaseBarcodeInfo.getMaterialId())){
throw new ServiceException("退库物料不匹配");
}
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode); WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);

@ -51,3 +51,21 @@ export function getDeviceLedgerList(query) {
params: 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 data: data
}) })
} }
// 查询小包条码信息列表
export function listPrdBarcode(query) {
return request({
url: '/mes/barcode/listPrdBarcode',
method: 'get',
params: query
})
}

@ -8,16 +8,16 @@
<el-input v-model="this.dmsBillsFaultInstanceList[0].billsFaultCode" disabled /> <el-input v-model="this.dmsBillsFaultInstanceList[0].billsFaultCode" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" :offset="2"> <!-- <el-col :span="8" :offset="2">-->
<el-form-item label="报修来源" > <!-- <el-form-item label="报修来源" >-->
<el-input v-model="this.faultSourceTypeCheck" disabled /> <!-- <el-input v-model="this.faultSourceTypeCheck" disabled />-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="8" :offset="2"> <!-- <el-col :span="8" :offset="2">-->
<el-form-item label="报修来源编号" > <!-- <el-form-item label="报修来源编号" >-->
<el-input v-model="this.dmsBillsFaultInstanceList[0].faultSourceId" disabled /> <!-- <el-input v-model="this.dmsBillsFaultInstanceList[0].faultSourceId" disabled />-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="8" :offset="2"> <el-col :span="8" :offset="2">
<el-form-item label="工单状态" > <el-form-item label="工单状态" >
<el-input placeholder="待维修" disabled /> <el-input placeholder="待维修" disabled />
@ -43,10 +43,11 @@
</el-row> </el-row>
</el-form> </el-form>
<!-- 第一步--> <!-- 第一步-->
<el-row>
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" :model="form" label-width="120px">
<h4 class="form-header h4">{{this.wfProcessActivityList[0].processActivityName}}</h4> <h4 class="form-header h4">{{this.wfProcessActivityList[0].processActivityName}}</h4>
<el-row>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="故障类型" prop="faultType"> <el-form-item label="故障类型" prop="faultType">
<!-- <el-input v-model="form.faultType" placeholder="" :disabled="true"/>--> <!-- <el-input v-model="form.faultType" placeholder="" :disabled="true"/>-->
@ -117,7 +118,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<div>
<el-button type="primary" @click="handleViewFile(activityList[0].dmsInstanceFileList)"></el-button>
</div>
<div id="viewFile">
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</div>
</el-row>
<!-- 中间步骤--> <!-- 中间步骤-->
@ -125,9 +132,10 @@
:key="activityList.instanceActivityId" :key="activityList.instanceActivityId"
label-width="0px" label-width="0px"
:model="form" :model="form"
v-if="activity.processStepOrder!=1" v-if="activity.processStepOrder!==1"
> >
<h4 class="form-header h4">{{activity.processActivityName}}</h4> <h4 class="form-header h4">{{activity.processActivityName}}</h4>
<row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="故障类型" prop="faultType"> <el-form-item label="故障类型" prop="faultType">
<el-select v-model="activity.faultType" placeholder="" :disabled="true"> <el-select v-model="activity.faultType" placeholder="" :disabled="true">
@ -201,7 +209,7 @@
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="处理意见" <el-form-item label="处理措施"
> >
<el-input <el-input
v-model="activity.processHandleResolution" v-model="activity.processHandleResolution"
@ -210,14 +218,17 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</row>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 新建提交--> <!-- 新建提交-->
<el-form ref="form1" :model="form1" label-width="100px" <el-form ref="form1" :model="form1" label-width="100px"
v-if="form1.processStepOrder!=wfProcessActivityList.length&&this.isUpdate==true"> v-if="form1.processStepOrder!=wfProcessActivityList.length&&this.isUpdate==true">
<h4 class="form-header h4">{{this.wfProcessActivityList[this.activityList.length].processActivityName}}</h4> <h4 class="form-header h4">{{this.wfProcessActivityList[this.activityList.length].processActivityName}}</h4>
<el-row>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="故障类型" prop="faultType"> <el-form-item label="故障类型" prop="faultType">
<!-- <el-input v-model="form.faultType" placeholder="" :disabled="true"/>--> <!-- <el-input v-model="form.faultType" placeholder="" :disabled="true"/>-->
@ -239,12 +250,12 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="涉及操作" prop="designOperations"> <el-form-item label="涉及操作" prop="designOperations">
<el-input v-model="form1.designOperations" /> <el-input v-model="form1.designOperations" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="设备名称" prop="deviceId"> <el-form-item label="设备名称" prop="deviceId">
<el-select v-model="form1.deviceId" placeholder="设备名称" > <el-select v-model="form1.deviceId" placeholder="设备名称" disabled >
<el-option <el-option
v-for="item in ledgerList" v-for="item in ledgerList"
:key="item.deviceId" :key="item.deviceId"
@ -290,7 +301,7 @@
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="处理意见" <el-form-item label="处理措施"
> >
<el-input <el-input
v-model="form1.processHandleResolution" placeholder=""> v-model="form1.processHandleResolution" placeholder="">
@ -305,8 +316,8 @@
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
</el-form> </el-form>
</el-row>
</div> </div>
@ -316,12 +327,14 @@
import { listActivity, getActivity, delActivity, addActivity, updateActivity,selectUserIdByInspectInstanceId } from "@/api/dms/activity"; import { listActivity, getActivity, delActivity, addActivity, updateActivity,selectUserIdByInspectInstanceId } from "@/api/dms/activity";
import { listDmsBillsFaultInstance } from '@/api/dms/dmsBillsFaultInstance' import { listDmsBillsFaultInstance } from '@/api/dms/dmsBillsFaultInstance'
import { listWfprocessactivity } from '@/api/system/common/wfprocessactivity' import { listWfprocessactivity } from '@/api/system/common/wfprocessactivity'
import { listLedger } from '@/api/dms/ledger' import { listAllLedger } from '@/api/dms/ledger'
import { listDmsInfo } from '@/api/dms/dmsInfo' import { listDmsInfo } from '@/api/dms/dmsInfo'
import ViewFile from "@/components/viewFile/index.vue";
export default { export default {
name: "Activity", name: "Activity",
dicts:['dms_fault_type','dms_repair_type','dms_bills_status','dms_inspect_type','dms_fault_source_type'], dicts:['dms_fault_type','dms_repair_type','dms_bills_status','dms_inspect_type','dms_fault_source_type'],
components: {ViewFile},
data() { data() {
return { return {
// //
@ -397,7 +410,14 @@ export default {
processStepOrder: [ processStepOrder: [
{ required: true, message: "工单流程步骤顺序不能为空", trigger: "blur" } { required: true, message: "工单流程步骤顺序不能为空", trigger: "blur" }
], ],
} },
//
showFileDialog: false,
//
thisTitle: "故障图片",
//
fileListData: [],
}; };
}, },
created() { created() {
@ -408,7 +428,7 @@ export default {
console.log(this.repairInstanceIdCheck) console.log(this.repairInstanceIdCheck)
this.isUpdate = true; this.isUpdate = true;
this.getList(); this.getList();
this.getWfprocessActivity(); // this.getWfprocessActivity();
this.getBillsFaultInstance(); this.getBillsFaultInstance();
this.getDeviveLedger(); this.getDeviveLedger();
this.getoutsrcId(); this.getoutsrcId();
@ -433,8 +453,8 @@ export default {
}, },
/** 查询设备台账信息列表 */ /** 查询设备台账信息列表 */
getDeviveLedger() { getDeviveLedger() {
listLedger().then(response => { listAllLedger().then(response => {
this.ledgerList = response.rows; this.ledgerList = response.data;
}); });
}, },
/**查询流程信息*/ /**查询流程信息*/
@ -448,7 +468,6 @@ export default {
for (let j=0;j<this.stepsNum;j++){ for (let j=0;j<this.stepsNum;j++){
if (this.activityList[i].processStepOrder==this.wfProcessActivityList[j].processActivityOrder){ if (this.activityList[i].processStepOrder==this.wfProcessActivityList[j].processActivityOrder){
this.activityList[i].processActivityName = this.wfProcessActivityList[j].processActivityName; this.activityList[i].processActivityName = this.wfProcessActivityList[j].processActivityName;
} }
} }
} }
@ -486,6 +505,7 @@ export default {
this.loading = true; this.loading = true;
listActivity(this.queryParams).then(response => { listActivity(this.queryParams).then(response => {
this.activityList = response.rows; this.activityList = response.rows;
this.getWfprocessActivity();
this.total = response.total; this.total = response.total;
console.log(this.activityList) console.log(this.activityList)
this.form.repairInstanceId = this.activityList[0].repairInstanceId; this.form.repairInstanceId = this.activityList[0].repairInstanceId;
@ -618,6 +638,18 @@ export default {
this.download('dms/activity/export', { this.download('dms/activity/export', {
...this.queryParams ...this.queryParams
}, `activity_${new Date().getTime()}.xlsx`) }, `activity_${new Date().getTime()}.xlsx`)
},
handleViewFile(fileList){
// let file = {'name':'dd.jpg','url':'http://172.16.12.100:7309/statics/2024/11/05/output_imgage20241105_152542_20241105152632A001.jpg'};
if(fileList==null || fileList.length<=0){
this.$modal.msgWarning("无图片");
return;
}
this.fileListData = fileList;
// this.fileListData = fileList;
this.showFileDialog = true;
} }
} }
}; };

@ -1,23 +1,23 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
<el-form-item label="报修来源" prop="faultSourceId"> <!-- <el-form-item label="报修来源" prop="faultSourceId">-->
<el-select @change="change" v-model="queryParams.faultSourceType" placeholder="报修来源类型" > <!-- <el-select @change="change" v-model="queryParams.faultSourceType" placeholder="报修来源类型" >-->
<el-option <!-- <el-option-->
v-for="item in dict.type.dms_fault_source_type" <!-- v-for="item in dict.type.dms_fault_source_type"-->
:key="item.value" <!-- :key="item.value"-->
:label="item.label" <!-- :label="item.label"-->
:value="item.value" <!-- :value="item.value"-->
> <!-- >-->
</el-option> <!-- </el-option>-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <!-- <el-form-item>-->
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>-->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>-->
</el-form-item> <!-- </el-form-item>-->
</el-form> <!-- </el-form>-->
<!--el-row :gutter="10" class="mb8"> <!--el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
@ -65,15 +65,15 @@
</el-row--> </el-row-->
<el-table v-loading="loading" :data="dmsBillsFaultInstanceList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dmsBillsFaultInstanceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="主键标识;此表不会长期保存" align="center" prop="repairInstanceId" />--> <!-- <el-table-column label="主键标识;此表不会长期保存" align="center" prop="repairInstanceId" />-->
<!-- <el-table-column label="报修来源类型(1检修2点检3巡检9其他)" align="center" prop="faultSourceType" />--> <!-- <el-table-column label="报修来源类型(1检修2点检3巡检9其他)" align="center" prop="faultSourceType" />-->
<el-table-column label="报修来源类型" align="center" prop="faultSourceType"> <!-- <el-table-column label="报修来源类型" align="center" prop="faultSourceType">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<dict-tag :options="dict.type.dms_fault_source_type" :value="scope.row.faultSourceType"/> <!-- <dict-tag :options="dict.type.dms_fault_source_type" :value="scope.row.faultSourceType"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="报修来源ID" align="center" prop="faultSourceId" /> <!-- <el-table-column label="报修来源ID" align="center" prop="faultSourceId" />-->
<!-- <el-table-column label="工单流程ID关联wf_process的wf_process_id" align="center" prop="wfProcessId" />--> <!-- <el-table-column label="工单流程ID关联wf_process的wf_process_id" align="center" prop="wfProcessId" />-->
<el-table-column label="工单编号" align="center" prop="billsFaultCode" /> <el-table-column label="工单编号" align="center" prop="billsFaultCode" />

@ -156,6 +156,19 @@
v-hasPermi="['dms:ledger:remove']" v-hasPermi="['dms:ledger:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-print"
size="mini"
@click="handlePrintDeviceLabels"
v-hasPermi="['wms:ledger:printDeviceLabels']"
>打印设备标签
</el-button>
</el-col>
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->
<!-- <el-button--> <!-- <el-button-->
<!-- type="warning"--> <!-- type="warning"-->
@ -692,7 +705,7 @@
</template> </template>
<script> <script>
import { listLedger, getLedger, delLedger, addLedger, updateLedger } from "@/api/dms/ledger"; import { listLedger, getLedger, delLedger, addLedger, updateLedger,printDeviceLabels } from "@/api/dms/ledger";
import { listDevicetype ,selectDevicetypeByDeviceId}from "@/api/dms/devicetype"; import { listDevicetype ,selectDevicetypeByDeviceId}from "@/api/dms/devicetype";
import { getSuplier, listSuplier,selectDmsBaseDeviceSuplierByDeviceId } from '@/api/dms/suplier' import { getSuplier, listSuplier,selectDmsBaseDeviceSuplierByDeviceId } from '@/api/dms/suplier'
import { listDevicedepreciation } from '@/api/dms/devicedepreciation' import { listDevicedepreciation } from '@/api/dms/devicedepreciation'
@ -741,6 +754,7 @@ export default {
loading: true, loading: true,
// //
ids: [], ids: [],
codes:[],
// //
single: true, single: true,
// //
@ -1373,6 +1387,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.deviceId) this.ids = selection.map(item => item.deviceId)
this.codes = selection.map(item => item.deviceCode)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
@ -1496,6 +1511,21 @@ export default {
} }
}); });
}, },
/** 打印设备编码按钮操作 */
handlePrintDeviceLabels(row) {
const deviceCodes = row.deviceCode || this.codes;
this.$modal.confirm('是否确认打印编码为"' + deviceCodes + '"的设备编码?').then(function () {
return printDeviceLabels(deviceCodes);
}).then(() => {
this.getList();
this.$modal.msgSuccess("打印成功");
}).catch(() => {
});
},
} }
}; };
</script> </script>

@ -33,38 +33,38 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
plain <!-- plain-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
size="mini" <!-- size="mini"-->
@click="handleAdd" <!-- @click="handleAdd"-->
v-hasPermi="['dms:shutType:add']" <!-- v-hasPermi="['dms:shutType:add']"-->
>新增</el-button> <!-- >新增</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="success" <!-- type="success"-->
plain <!-- plain-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
size="mini" <!-- size="mini"-->
:disabled="single" <!-- :disabled="single"-->
@click="handleUpdate" <!-- @click="handleUpdate"-->
v-hasPermi="['dms:shutType:edit']" <!-- v-hasPermi="['dms:shutType:edit']"-->
>修改</el-button> <!-- >修改</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="danger" <!-- type="danger"-->
plain <!-- plain-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
size="mini" <!-- size="mini"-->
:disabled="multiple" <!-- :disabled="multiple"-->
@click="handleDelete" <!-- @click="handleDelete"-->
v-hasPermi="['dms:shutType:remove']" <!-- v-hasPermi="['dms:shutType:remove']"-->
>删除</el-button> <!-- >删除</el-button>-->
</el-col> <!-- </el-col>-->
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->
<!-- <el-button--> <!-- <el-button-->
<!-- type="warning"--> <!-- type="warning"-->
@ -78,30 +78,30 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="shutTypeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="shutTypeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="主键标识" align="center" prop="shutTypeId" />--> <!-- <el-table-column label="主键标识" align="center" prop="shutTypeId" />-->
<el-table-column label="类型编号" align="center" prop="typeCode" /> <el-table-column label="类型编号" align="center" prop="typeCode" />
<el-table-column label="停机类型名称" align="center" prop="shutTypeName" /> <el-table-column label="停机类型名称" align="center" prop="shutTypeName" />
<!-- <el-table-column label="是否标识1-是0-否" align="center" prop="isFlag" />--> <!-- <el-table-column label="是否标识1-是0-否" align="center" prop="isFlag" />-->
<el-table-column label="备注" align="center" prop="remark" /> <!-- <el-table-column label="备注" align="center" prop="remark" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
@click="handleUpdate(scope.row)" <!-- @click="handleUpdate(scope.row)"-->
v-hasPermi="['dms:shutType:edit']" <!-- v-hasPermi="['dms:shutType:edit']"-->
>修改</el-button> <!-- >修改</el-button>-->
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
@click="handleDelete(scope.row)" <!-- @click="handleDelete(scope.row)"-->
v-hasPermi="['dms:shutType:remove']" <!-- v-hasPermi="['dms:shutType:remove']"-->
>删除</el-button> <!-- >删除</el-button>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> </el-table>
<pagination <pagination

@ -1,11 +1,88 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!--el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="100px" size="small"> <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="100px" size="small">
<el-form-item label="销售订单编号" prop="saleorderCode">
<el-form-item label="生产计划编号" prop="planCode">
<el-input
v-model="queryParams.planCode"
placeholder="请输入生产计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划明细编号" prop="planDetailCode">
<el-input
v-model="queryParams.planDetailCode"
placeholder="请输入计划明细编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单号" prop="saleorderCode">
<el-input <el-input
v-model="queryParams.saleorderCode" v-model="queryParams.saleorderCode"
placeholder="请输入销售订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料条码" prop="barcodeInfo">
<el-input
v-model="queryParams.barcodeInfo"
placeholder="请输入物料条码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入成品编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入成品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入成品规格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="打印标识" prop="printFlag">
<el-select v-model="queryParams.printFlag" placeholder="请选择打印标识" clearable>
<el-option
v-for="dict in dict.type.mes_print_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="小包条码" prop="prdBarcodeInfo">
<el-input
v-model="queryParams.prdBarcodeInfo"
placeholder="请输入小包条码"
clearable clearable
placeholder="请输入销售订单编号"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@ -15,79 +92,81 @@
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"></el-button> <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form--> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
v-hasPermi="['mes:barcode:add']" <!-- v-hasPermi="['mes:barcode:add']"-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
plain <!-- plain-->
size="mini" <!-- size="mini"-->
type="primary" <!-- type="primary"-->
@click="handleAddProductBarcode" <!-- @click="handleAddProductBarcode"-->
v-if="addProductBarcodeBtnVisible" <!-- v-if="addProductBarcodeBtnVisible"-->
>新增 <!-- >新增-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
v-hasPermi="['mes:barcode:add']" <!-- v-hasPermi="['mes:barcode:add']"-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
plain <!-- plain-->
size="mini" <!-- size="mini"-->
type="primary" <!-- type="primary"-->
@click="handleAdd" <!-- @click="handleAdd"-->
v-if="addBarcodeBtnVisible" <!-- v-if="addBarcodeBtnVisible"-->
>{{ addBtnTitle }} <!-- >{{ addBtnTitle }}-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
v-hasPermi="['mes:barcode:add']" <!-- v-hasPermi="['mes:barcode:add']"-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
plain <!-- plain-->
size="mini" <!-- size="mini"-->
type="primary" <!-- type="primary"-->
@click="handleDoorPlaneAdd" <!-- @click="handleDoorPlaneAdd"-->
v-if="addDoorBarcodeBtnVisible" <!-- v-if="addDoorBarcodeBtnVisible"-->
>新增门板条码 <!-- >新增门板条码-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="warning" <!-- type="warning"-->
plain <!-- plain-->
icon="el-icon-printer" <!-- icon="el-icon-printer"-->
size="mini" <!-- size="mini"-->
@click="handlePrintBarcodes" <!-- @click="handlePrintBarcodes"-->
:disabled="batchPrintBtnDisabled" <!-- :disabled="batchPrintBtnDisabled"-->
v-hasPermi="['mes:barcode:printProductBarcodes']" <!-- v-hasPermi="['mes:barcode:printProductBarcodes']"-->
>打印 <!-- >打印-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<!--right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar--> <!--right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar-->
</el-row> </el-row>
<el-table v-loading="loading" :data="barcodeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="barcodeList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/> <!-- <el-table-column align="center" type="selection" width="55"/>-->
<el-table-column v-if="columns[0].visible" align="center" label="主键标识" prop="barcodeId"/> <el-table-column v-if="columns[0].visible" align="center" label="主键标识" prop="barcodeId"/>
<el-table-column v-if="columns[4].visible" align="center" label="条码类型" prop="barcodeType"> <el-table-column v-if="columns[4].visible" align="center" label="条码类型" prop="barcodeType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/> <dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="columns[17].visible" align="center" label="派工单号" prop="planCode" width="110"/> <el-table-column v-if="columns[17].visible" align="center" label="生产计划编号" prop="planCode" width="110"/>
<el-table-column v-if="columns[17].visible" align="center" label="明细编号" prop="planDetailCode" width="110"/> <el-table-column v-if="columns[17].visible" align="center" label="计划明细编号" prop="planDetailCode"
<el-table-column v-if="columns[20].visible" align="center" label="销售订单编号" prop="saleorderCode" width="110"/> width="110"/>
<el-table-column v-if="columns[13].visible" align="center" label="采购订单号" prop="poNo" width="100"/> <el-table-column v-if="columns[20].visible" align="center" label="销售订单号" prop="saleorderCode" width="110"/>
<el-table-column v-if="columns[5].visible" align="center" label="条码内容" prop="barcodeInfo" width="100"/> <el-table-column v-if="columns[5].visible" align="center" label="成品条码" prop="barcodeInfo" width="100"/>
<el-table-column v-if="columns[8].visible" align="center" label="物料名称" prop="materialName" width="100"/> <el-table-column align="center" label="成品编码" prop="materialCode" width="100"/>
<el-table-column align="center" label="成品名称" prop="materialName" width="100"/>
<el-table-column align="center" label="成品规格" prop="materialSpec" width="100"/>
<el-table-column label="打印标识" align="center" prop="printFlag"> <el-table-column label="打印标识" align="center" prop="printFlag">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_print_flag" :value="scope.row.printFlag"/> <dict-tag :options="dict.type.mes_print_flag" :value="scope.row.printFlag"/>
@ -120,15 +199,25 @@
v-hasPermi="['mes:barcode:regenerateProductBarcode']" v-hasPermi="['mes:barcode:regenerateProductBarcode']"
>重新生成 >重新生成
</el-button--> </el-button-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-printer"-->
<!-- @click="handlePrintBarcodes(scope.row)"-->
<!-- v-if="scope.row.printFlag ==='0'"-->
<!-- v-hasPermi="['mes:barcode:printBarcode']"-->
<!-- >打印-->
<!-- </el-button>-->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-printer" icon="el-icon-info"
@click="handlePrintBarcodes(scope.row)" @click="handlePrdBarcodes(scope.row)"
v-if="scope.row.printFlag ==='0'" v-hasPermi="['mes:barcode:prdBarcode']"
v-hasPermi="['mes:barcode:printBarcode']" >小包条码
>打印
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -141,6 +230,31 @@
@pagination="getList" @pagination="getList"
/> />
<!--小包条码信息查看dialog-->
<el-dialog :title="prdTitle" :visible.sync="prdOpen" append-to-body width="600px">
<el-table v-loading="prdLoading" :data="prdBarcodeList" @selection-change="handleSelectionChange">
<el-table-column label="小包条码" align="center" prop="prdBarcodeInfo"/>
<el-table-column label="喷码标识" align="center" prop="printFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_prdbarcode_spurt_flag" :value="scope.row.printFlag"/>
</template>
</el-table-column>
<el-table-column label="绑定托盘号" align="center" prop="palletInfoCode"/>
<el-table-column label="创建时间" align="center" prop="creatTime">
</el-table-column>
<el-table-column label="喷印时间" align="center" prop="printTime">
</el-table-column>
<el-table-column label="绑定时间" align="center" prop="bindTime">
</el-table-column>
</el-table>
</el-dialog>
<!-- 添加或修改条码信息对话框 --> <!-- 添加或修改条码信息对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px"> <el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
@ -261,7 +375,8 @@
<el-form ref="addProductBarcodeForm" :model="addProductBarcodeForm" :rules="addProductBarcodeRules" <el-form ref="addProductBarcodeForm" :model="addProductBarcodeForm" :rules="addProductBarcodeRules"
label-width="120px"> label-width="120px">
<el-form-item label="原材料条码" prop="productBarcode"> <el-form-item label="原材料条码" prop="productBarcode">
<el-input v-model="addProductBarcodeForm.productBarcode" placeholder="请扫描或输入原材料条码" suffix-icon="el-icon-full-screen"> <el-input v-model="addProductBarcodeForm.productBarcode" placeholder="请扫描或输入原材料条码"
suffix-icon="el-icon-full-screen">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -315,13 +430,14 @@ import {
delBarcode, delBarcode,
addProductBarcode, addProductBarcode,
printProductBarcodes, printProductBarcodes,
regenerateProductBarcode regenerateProductBarcode,
listPrdBarcode
} from "@/api/mes/barcode"; } from "@/api/mes/barcode";
import addProductPlan from '@//views/mes/productplan/addProductPlan.vue'; import addProductPlan from '@//views/mes/productplan/addProductPlan.vue';
export default { export default {
name: "Barcode", name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_print_flag'], dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_print_flag','mes_prdbarcode_spurt_flag'],
components: { components: {
'add-ProductPlan': addProductPlan, 'add-ProductPlan': addProductPlan,
}, },
@ -352,7 +468,7 @@ export default {
addProductBarcodeTitle: '新增成品条码', addProductBarcodeTitle: '新增成品条码',
addProductBarcodeForm: {}, addProductBarcodeForm: {},
addProductBarcodeRules: { addProductBarcodeRules: {
productBarcode: [ productBarcode: [
{required: true, message: "原材料条码不能为空", trigger: "blur"} {required: true, message: "原材料条码不能为空", trigger: "blur"}
], ],
@ -390,6 +506,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
singleFlag: null, singleFlag: null,
prdBarcodeInfo:null,
}, },
// //
form: {}, form: {},
@ -456,12 +573,18 @@ export default {
}, },
SINGLE_FLAG: { SINGLE_FLAG: {
YES: '1',// YES: '1',//
} },
//
prdLoading: true,
prdTitle: '小包条码',
prdBarcodeList: [],
prdOpen: false
}; };
}, },
mounted() { mounted() {
this.addBarcodeBtnVisible = false; // this.addBarcodeBtnVisible = false;
this.getData(); // this.getData();
this.getList(); this.getList();
}, },
@ -482,64 +605,64 @@ export default {
// }, // },
// }, // },
methods: { methods: {
getData() { // getData() {
if (this.defineData.barcodeType) { // if (this.defineData.barcodeType) {
let barcodeType = this.defineData.barcodeType ? this.defineData.barcodeType : this.BARCODE_TYPE.PRODUCT; // let barcodeType = this.defineData.barcodeType ? this.defineData.barcodeType : this.BARCODE_TYPE.PRODUCT;
let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : ''; // let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : '';
if (barcodeType === this.BARCODE_TYPE.BACK_PLANE) { // if (barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
this.addBtnTitle = "新增背板条码"; // this.addBtnTitle = "";
} // }
this.form = { // this.form = {
planId: this.defineData.planId, // planId: this.defineData.planId,
planCode: this.defineData.planCode, // planCode: this.defineData.planCode,
planDetailCode: this.defineData.planDetailCode, // planDetailCode: this.defineData.planDetailCode,
batchFlag: '0', // batchFlag: '0',
bindBarcode: bindBarcode, // bindBarcode: bindBarcode,
barcodeType: barcodeType, // barcodeType: barcodeType,
amount: 1, // amount: 1,
} // }
this.queryParams.planDetailCode = this.defineData.planDetailCode; // this.queryParams.planDetailCode = this.defineData.planDetailCode;
if (barcodeType !== this.BARCODE_TYPE.PRODUCT) { // if (barcodeType !== this.BARCODE_TYPE.PRODUCT) {
this.queryParams.barcodeType = null; // this.queryParams.barcodeType = null;
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.DOOR + "," + this.BARCODE_TYPE.BACK_PLANE; // this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.DOOR + "," + this.BARCODE_TYPE.BACK_PLANE;
} // }
} else { // } else {
this.queryParams.barcodeType = this.BARCODE_TYPE.PRODUCT; // this.queryParams.barcodeType = this.BARCODE_TYPE.PRODUCT;
this.queryParams.singleFlag = this.SINGLE_FLAG.YES; // this.queryParams.singleFlag = this.SINGLE_FLAG.YES;
this.addProductBarcodeBtnVisible = true; // this.addProductBarcodeBtnVisible = true;
} // }
//
//
}, // },
/** 查询条码信息列表 */ /** 查询条码信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listProductBarcode(this.queryParams).then(response => { listProductBarcode(this.queryParams).then(response => {
this.barcodeList = response.rows; this.barcodeList = response.rows;
this.total = response.total; this.total = response.total;
if (this.queryParams.singleFlag && this.queryParams.singleFlag === this.SINGLE_FLAG.YES) { // if (this.queryParams.singleFlag && this.queryParams.singleFlag === this.SINGLE_FLAG.YES) {
//
} else { // } else {
if (this.total && this.total > 0) { // if (this.total && this.total > 0) {
if (this.queryParams.barcodeTypeStr) { // if (this.queryParams.barcodeTypeStr) {
this.addBarcodeBtnVisible = true; // this.addBarcodeBtnVisible = true;
this.addDoorBarcodeBtnVisible = true; // this.addDoorBarcodeBtnVisible = true;
this.barcodeList.forEach(e => { // this.barcodeList.forEach(e => {
if (e.barcodeType === this.BARCODE_TYPE.BACK_PLANE) { // if (e.barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
this.addBarcodeBtnVisible = false; // this.addBarcodeBtnVisible = false;
} else if (e.barcodeType === this.BARCODE_TYPE.DOOR) { // } else if (e.barcodeType === this.BARCODE_TYPE.DOOR) {
this.addDoorBarcodeBtnVisible = false; // this.addDoorBarcodeBtnVisible = false;
} // }
}) // })
} else { // } else {
this.addBarcodeBtnVisible = false; // this.addBarcodeBtnVisible = false;
} // }
} else { // } else {
this.addBarcodeBtnVisible = true; // this.addBarcodeBtnVisible = true;
this.addDoorBarcodeBtnVisible = true; // this.addDoorBarcodeBtnVisible = true;
this.handleAdd(); // this.handleAdd();
} // }
} // }
this.loading = false; this.loading = false;
}); });
@ -791,6 +914,16 @@ export default {
} }
}); });
}, },
handlePrdBarcodes(row) {
this.prdLoading = true;
this.prdOpen = true;
listPrdBarcode({'mesBarcodeInfo': row.barcodeInfo}).then(response => {
this.prdBarcodeList = response.data;
this.prdLoading = false;
});
}
} }
}; };
</script> </script>

@ -18,6 +18,15 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料条码" prop="barcodeInfo">
<el-input
v-model="queryParams.barcodeInfo"
placeholder="请输入物料条码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编号" prop="materialCode"> <el-form-item label="物料编号" prop="materialCode">
<el-input <el-input
v-model="queryParams.materialCode" v-model="queryParams.materialCode"

@ -28,28 +28,28 @@
<!-- >新增</el-button>--> <!-- >新增</el-button>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="success" <!-- type="success"-->
plain <!-- plain-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
size="mini" <!-- size="mini"-->
:disabled="single" <!-- :disabled="single"-->
@click="handleUpdate" <!-- @click="handleUpdate"-->
v-hasPermi="['system:wfprocess:edit']" <!-- v-hasPermi="['system:wfprocess:edit']"-->
>修改</el-button> <!-- >修改</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="danger" <!-- type="danger"-->
plain <!-- plain-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
size="mini" <!-- size="mini"-->
:disabled="multiple" <!-- :disabled="multiple"-->
@click="handleDelete" <!-- @click="handleDelete"-->
v-hasPermi="['system:wfprocess:remove']" <!-- v-hasPermi="['system:wfprocess:remove']"-->
>删除</el-button> <!-- >删除</el-button>-->
</el-col> <!-- </el-col>-->
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->
<!-- <el-button--> <!-- <el-button-->
<!-- type="warning"--> <!-- type="warning"-->
@ -60,7 +60,7 @@
<!-- v-hasPermi="['system:wfprocess:export']"--> <!-- v-hasPermi="['system:wfprocess:export']"-->
<!-- >导出</el-button>--> <!-- >导出</el-button>-->
<!-- </el-col>--> <!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row> </el-row>
<el-table v-loading="loading" :data="wfprocessList" <el-table v-loading="loading" :data="wfprocessList"

@ -140,19 +140,13 @@
</el-table-column> </el-table-column>
<el-table-column label="申请人" align="center" prop="applyBy"/> <el-table-column label="申请人" align="center" prop="applyBy"/>
<el-table-column label="申请时间" align="center" prop="applyDate"> <el-table-column label="申请时间" align="center" prop="applyDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="开始时间" align="center" prop="beginTime"> <el-table-column label="开始时间" align="center" prop="beginTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.beginTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime"> <el-table-column label="结束时间" align="center" prop="endTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">

Loading…
Cancel
Save