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 prdBarcodeInfo;
public String getLocationCode() {
return locationCode;
@ -651,6 +653,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
this.rawFlag = rawFlag;
}
public String getPrdBarcodeInfo() {
return prdBarcodeInfo;
}
public void setPrdBarcodeInfo(String prdBarcodeInfo) {
this.prdBarcodeInfo = prdBarcodeInfo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -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.setTimeLimitHours(hours/(60*60l));
}
}
return wfProcessActivities;
}

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

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

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

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

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

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

@ -8,16 +8,16 @@
<el-input v-model="this.dmsBillsFaultInstanceList[0].billsFaultCode" disabled />
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="报修来源" >
<el-input v-model="this.faultSourceTypeCheck" disabled />
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="报修来源编号" >
<el-input v-model="this.dmsBillsFaultInstanceList[0].faultSourceId" disabled />
</el-form-item>
</el-col>
<!-- <el-col :span="8" :offset="2">-->
<!-- <el-form-item label="报修来源" >-->
<!-- <el-input v-model="this.faultSourceTypeCheck" disabled />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" :offset="2">-->
<!-- <el-form-item label="报修来源编号" >-->
<!-- <el-input v-model="this.dmsBillsFaultInstanceList[0].faultSourceId" disabled />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="8" :offset="2">
<el-form-item label="工单状态" >
<el-input placeholder="待维修" disabled />
@ -43,10 +43,11 @@
</el-row>
</el-form>
<!-- 第一步-->
<el-row>
<el-form ref="form" :model="form" label-width="120px">
<h4 class="form-header h4">{{this.wfProcessActivityList[0].processActivityName}}</h4>
<el-row>
<el-col :span="8" >
<el-form-item label="故障类型" prop="faultType">
<!-- <el-input v-model="form.faultType" placeholder="" :disabled="true"/>-->
@ -117,7 +118,13 @@
</el-select>
</el-form-item>
</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"
label-width="0px"
:model="form"
v-if="activity.processStepOrder!=1"
v-if="activity.processStepOrder!==1"
>
<h4 class="form-header h4">{{activity.processActivityName}}</h4>
<row>
<el-col :span="8">
<el-form-item label="故障类型" prop="faultType">
<el-select v-model="activity.faultType" placeholder="" :disabled="true">
@ -201,7 +209,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="处理意见"
<el-form-item label="处理措施"
>
<el-input
v-model="activity.processHandleResolution"
@ -210,14 +218,17 @@
</el-input>
</el-form-item>
</el-col>
</row>
</el-form-item>
</el-form>
<!-- 新建提交-->
<el-form ref="form1" :model="form1" label-width="100px"
v-if="form1.processStepOrder!=wfProcessActivityList.length&&this.isUpdate==true">
<h4 class="form-header h4">{{this.wfProcessActivityList[this.activityList.length].processActivityName}}</h4>
<el-row>
<el-col :span="8" >
<el-form-item label="故障类型" prop="faultType">
<!-- <el-input v-model="form.faultType" placeholder="" :disabled="true"/>-->
@ -239,12 +250,12 @@
</el-col>
<el-col :span="8">
<el-form-item label="涉及操作" prop="designOperations">
<el-input v-model="form1.designOperations" />
<el-input v-model="form1.designOperations" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备名称" prop="deviceId">
<el-select v-model="form1.deviceId" placeholder="设备名称" >
<el-select v-model="form1.deviceId" placeholder="设备名称" disabled >
<el-option
v-for="item in ledgerList"
:key="item.deviceId"
@ -290,7 +301,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="处理意见"
<el-form-item label="处理措施"
>
<el-input
v-model="form1.processHandleResolution" placeholder="">
@ -305,8 +316,8 @@
<el-button type="primary" @click="submitForm"> </el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-row>
</div>
@ -316,12 +327,14 @@
import { listActivity, getActivity, delActivity, addActivity, updateActivity,selectUserIdByInspectInstanceId } from "@/api/dms/activity";
import { listDmsBillsFaultInstance } from '@/api/dms/dmsBillsFaultInstance'
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 ViewFile from "@/components/viewFile/index.vue";
export default {
name: "Activity",
dicts:['dms_fault_type','dms_repair_type','dms_bills_status','dms_inspect_type','dms_fault_source_type'],
components: {ViewFile},
data() {
return {
//
@ -397,7 +410,14 @@ export default {
processStepOrder: [
{ required: true, message: "工单流程步骤顺序不能为空", trigger: "blur" }
],
}
},
//
showFileDialog: false,
//
thisTitle: "故障图片",
//
fileListData: [],
};
},
created() {
@ -408,7 +428,7 @@ export default {
console.log(this.repairInstanceIdCheck)
this.isUpdate = true;
this.getList();
this.getWfprocessActivity();
// this.getWfprocessActivity();
this.getBillsFaultInstance();
this.getDeviveLedger();
this.getoutsrcId();
@ -433,8 +453,8 @@ export default {
},
/** 查询设备台账信息列表 */
getDeviveLedger() {
listLedger().then(response => {
this.ledgerList = response.rows;
listAllLedger().then(response => {
this.ledgerList = response.data;
});
},
/**查询流程信息*/
@ -448,7 +468,6 @@ export default {
for (let j=0;j<this.stepsNum;j++){
if (this.activityList[i].processStepOrder==this.wfProcessActivityList[j].processActivityOrder){
this.activityList[i].processActivityName = this.wfProcessActivityList[j].processActivityName;
}
}
}
@ -486,6 +505,7 @@ export default {
this.loading = true;
listActivity(this.queryParams).then(response => {
this.activityList = response.rows;
this.getWfprocessActivity();
this.total = response.total;
console.log(this.activityList)
this.form.repairInstanceId = this.activityList[0].repairInstanceId;
@ -618,6 +638,18 @@ export default {
this.download('dms/activity/export', {
...this.queryParams
}, `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>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="报修来源" prop="faultSourceId">
<el-select @change="change" v-model="queryParams.faultSourceType" placeholder="报修来源类型" >
<el-option
v-for="item in dict.type.dms_fault_source_type"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
<!-- <el-form-item label="报修来源" prop="faultSourceId">-->
<!-- <el-select @change="change" v-model="queryParams.faultSourceType" placeholder="报修来源类型" >-->
<!-- <el-option-->
<!-- v-for="item in dict.type.dms_fault_source_type"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- >-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<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-form-item>
</el-form>
<!-- <el-form-item>-->
<!-- <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-form-item>-->
<!-- </el-form>-->
<!--el-row :gutter="10" class="mb8">
<el-col :span="1.5">
@ -65,15 +65,15 @@
</el-row-->
<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="报修来源类型(1检修2点检3巡检9其他)" align="center" prop="faultSourceType" />-->
<el-table-column label="报修来源类型" align="center" prop="faultSourceType">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_fault_source_type" :value="scope.row.faultSourceType"/>
</template>
</el-table-column>
<el-table-column label="报修来源ID" align="center" prop="faultSourceId" />
<!-- <el-table-column label="报修来源类型" align="center" prop="faultSourceType">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.dms_fault_source_type" :value="scope.row.faultSourceType"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <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="工单编号" align="center" prop="billsFaultCode" />

@ -156,6 +156,19 @@
v-hasPermi="['dms:ledger:remove']"
>删除</el-button>
</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-button-->
<!-- type="warning"-->
@ -692,7 +705,7 @@
</template>
<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 { getSuplier, listSuplier,selectDmsBaseDeviceSuplierByDeviceId } from '@/api/dms/suplier'
import { listDevicedepreciation } from '@/api/dms/devicedepreciation'
@ -741,6 +754,7 @@ export default {
loading: true,
//
ids: [],
codes:[],
//
single: true,
//
@ -1373,6 +1387,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.deviceId)
this.codes = selection.map(item => item.deviceCode)
this.single = selection.length!==1
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>

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

@ -1,11 +1,88 @@
<template>
<div class="app-container">
<!--el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="100px" size="small">
<el-form-item label="销售订单编号" prop="saleorderCode">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="100px" size="small">
<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
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
placeholder="请输入销售订单编号"
@keyup.enter.native="handleQuery"
/>
</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-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form-->
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['mes:barcode:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAddProductBarcode"
v-if="addProductBarcodeBtnVisible"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['mes:barcode:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
v-if="addBarcodeBtnVisible"
>{{ addBtnTitle }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['mes:barcode:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleDoorPlaneAdd"
v-if="addDoorBarcodeBtnVisible"
>新增门板条码
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-printer"
size="mini"
@click="handlePrintBarcodes"
:disabled="batchPrintBtnDisabled"
v-hasPermi="['mes:barcode:printProductBarcodes']"
>打印
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['mes:barcode:add']"-->
<!-- icon="el-icon-plus"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="handleAddProductBarcode"-->
<!-- v-if="addProductBarcodeBtnVisible"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['mes:barcode:add']"-->
<!-- icon="el-icon-plus"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="handleAdd"-->
<!-- v-if="addBarcodeBtnVisible"-->
<!-- >{{ addBtnTitle }}-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['mes:barcode:add']"-->
<!-- icon="el-icon-plus"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="handleDoorPlaneAdd"-->
<!-- v-if="addDoorBarcodeBtnVisible"-->
<!-- >新增门板条码-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-printer"-->
<!-- size="mini"-->
<!-- @click="handlePrintBarcodes"-->
<!-- :disabled="batchPrintBtnDisabled"-->
<!-- v-hasPermi="['mes:barcode:printProductBarcodes']"-->
<!-- >打印-->
<!-- </el-button>-->
<!-- </el-col>-->
<!--right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar-->
</el-row>
<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[4].visible" align="center" label="条码类型" prop="barcodeType">
<template slot-scope="scope">
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</template>
</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="planDetailCode" width="110"/>
<el-table-column v-if="columns[20].visible" align="center" label="销售订单编号" prop="saleorderCode" width="110"/>
<el-table-column v-if="columns[13].visible" align="center" label="采购订单号" prop="poNo" 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 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[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 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">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_print_flag" :value="scope.row.printFlag"/>
@ -120,15 +199,25 @@
v-hasPermi="['mes:barcode:regenerateProductBarcode']"
>重新生成
</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
size="mini"
type="text"
icon="el-icon-printer"
@click="handlePrintBarcodes(scope.row)"
v-if="scope.row.printFlag ==='0'"
v-hasPermi="['mes:barcode:printBarcode']"
>打印
icon="el-icon-info"
@click="handlePrdBarcodes(scope.row)"
v-hasPermi="['mes:barcode:prdBarcode']"
>小包条码
</el-button>
</template>
</el-table-column>
</el-table>
@ -141,6 +230,31 @@
@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-form ref="form" :model="form" :rules="rules" label-width="120px">
@ -261,7 +375,8 @@
<el-form ref="addProductBarcodeForm" :model="addProductBarcodeForm" :rules="addProductBarcodeRules"
label-width="120px">
<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-form-item>
@ -315,13 +430,14 @@ import {
delBarcode,
addProductBarcode,
printProductBarcodes,
regenerateProductBarcode
regenerateProductBarcode,
listPrdBarcode
} from "@/api/mes/barcode";
import addProductPlan from '@//views/mes/productplan/addProductPlan.vue';
export default {
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: {
'add-ProductPlan': addProductPlan,
},
@ -352,7 +468,7 @@ export default {
addProductBarcodeTitle: '新增成品条码',
addProductBarcodeForm: {},
addProductBarcodeRules: {
addProductBarcodeRules: {
productBarcode: [
{required: true, message: "原材料条码不能为空", trigger: "blur"}
],
@ -390,6 +506,7 @@ export default {
updateBy: null,
updateTime: null,
singleFlag: null,
prdBarcodeInfo:null,
},
//
form: {},
@ -456,12 +573,18 @@ export default {
},
SINGLE_FLAG: {
YES: '1',//
}
},
//
prdLoading: true,
prdTitle: '小包条码',
prdBarcodeList: [],
prdOpen: false
};
},
mounted() {
this.addBarcodeBtnVisible = false;
this.getData();
// this.addBarcodeBtnVisible = false;
// this.getData();
this.getList();
},
@ -482,64 +605,64 @@ export default {
// },
// },
methods: {
getData() {
if (this.defineData.barcodeType) {
let barcodeType = this.defineData.barcodeType ? this.defineData.barcodeType : this.BARCODE_TYPE.PRODUCT;
let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : '';
if (barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
this.addBtnTitle = "新增背板条码";
}
this.form = {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
planDetailCode: this.defineData.planDetailCode,
batchFlag: '0',
bindBarcode: bindBarcode,
barcodeType: barcodeType,
amount: 1,
}
this.queryParams.planDetailCode = this.defineData.planDetailCode;
if (barcodeType !== this.BARCODE_TYPE.PRODUCT) {
this.queryParams.barcodeType = null;
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.DOOR + "," + this.BARCODE_TYPE.BACK_PLANE;
}
} else {
this.queryParams.barcodeType = this.BARCODE_TYPE.PRODUCT;
this.queryParams.singleFlag = this.SINGLE_FLAG.YES;
this.addProductBarcodeBtnVisible = true;
}
},
// getData() {
// if (this.defineData.barcodeType) {
// let barcodeType = this.defineData.barcodeType ? this.defineData.barcodeType : this.BARCODE_TYPE.PRODUCT;
// let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : '';
// if (barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
// this.addBtnTitle = "";
// }
// this.form = {
// planId: this.defineData.planId,
// planCode: this.defineData.planCode,
// planDetailCode: this.defineData.planDetailCode,
// batchFlag: '0',
// bindBarcode: bindBarcode,
// barcodeType: barcodeType,
// amount: 1,
// }
// this.queryParams.planDetailCode = this.defineData.planDetailCode;
// if (barcodeType !== this.BARCODE_TYPE.PRODUCT) {
// this.queryParams.barcodeType = null;
// this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.DOOR + "," + this.BARCODE_TYPE.BACK_PLANE;
// }
// } else {
// this.queryParams.barcodeType = this.BARCODE_TYPE.PRODUCT;
// this.queryParams.singleFlag = this.SINGLE_FLAG.YES;
// this.addProductBarcodeBtnVisible = true;
// }
//
//
// },
/** 查询条码信息列表 */
getList() {
this.loading = true;
listProductBarcode(this.queryParams).then(response => {
this.barcodeList = response.rows;
this.total = response.total;
if (this.queryParams.singleFlag && this.queryParams.singleFlag === this.SINGLE_FLAG.YES) {
} else {
if (this.total && this.total > 0) {
if (this.queryParams.barcodeTypeStr) {
this.addBarcodeBtnVisible = true;
this.addDoorBarcodeBtnVisible = true;
this.barcodeList.forEach(e => {
if (e.barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
this.addBarcodeBtnVisible = false;
} else if (e.barcodeType === this.BARCODE_TYPE.DOOR) {
this.addDoorBarcodeBtnVisible = false;
}
})
} else {
this.addBarcodeBtnVisible = false;
}
} else {
this.addBarcodeBtnVisible = true;
this.addDoorBarcodeBtnVisible = true;
this.handleAdd();
}
}
// if (this.queryParams.singleFlag && this.queryParams.singleFlag === this.SINGLE_FLAG.YES) {
//
// } else {
// if (this.total && this.total > 0) {
// if (this.queryParams.barcodeTypeStr) {
// this.addBarcodeBtnVisible = true;
// this.addDoorBarcodeBtnVisible = true;
// this.barcodeList.forEach(e => {
// if (e.barcodeType === this.BARCODE_TYPE.BACK_PLANE) {
// this.addBarcodeBtnVisible = false;
// } else if (e.barcodeType === this.BARCODE_TYPE.DOOR) {
// this.addDoorBarcodeBtnVisible = false;
// }
// })
// } else {
// this.addBarcodeBtnVisible = false;
// }
// } else {
// this.addBarcodeBtnVisible = true;
// this.addDoorBarcodeBtnVisible = true;
// this.handleAdd();
// }
// }
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>

@ -18,6 +18,15 @@
/>
</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"

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

@ -140,19 +140,13 @@
</el-table-column>
<el-table-column label="申请人" align="center" prop="applyBy"/>
<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 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 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 label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">

Loading…
Cancel
Save