生产:
销售订单和采购订单增加项目名称的显示和搜索
生产任务增加超时查询
采购订单增加超时查询
销售订单增加超时查询
生产任务查看物料库存使用bug修复
销售订单绑定采购订单时可以绑定非bom内物料标识的物料
采购订单绑定销售订单时非bom内物料标识可以绑定任意销售订单
仓储:
库位关联条码显示采购订单号和增加其搜索条件
车间生产:
质检工序打印IP地址指向分拣位打印
板材入库和出库显示固定条码时增加采购订单的显示
master
xs 7 months ago
parent 66a3fcf09c
commit 0a8fade792

@ -299,6 +299,11 @@ public class MesPurchaseOrder extends BaseEntity {
private String orderStatusStr;
private String overtimeFlag;
private String bomFlag;
private String projectName;//项目名称
public Long getSerialNumber() {
return serialNumber;
@ -780,6 +785,30 @@ public class MesPurchaseOrder extends BaseEntity {
this.orderStatusStr = orderStatusStr;
}
public String getOvertimeFlag() {
return overtimeFlag;
}
public void setOvertimeFlag(String overtimeFlag) {
this.overtimeFlag = overtimeFlag;
}
public String getBomFlag() {
return bomFlag;
}
public void setBomFlag(String bomFlag) {
this.bomFlag = bomFlag;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -13,7 +13,6 @@
<module>hw-api-tdengine</module>
<module>hw-api-mes</module>
<module>hw-api-ems</module>
<module>hw-api-printer</module>
<module>hw-api-dms</module>
<module>hw-api-job</module>
<module>hw-api-jindie</module>

@ -93,6 +93,8 @@ public class TokenController
{
// 用户登录
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
userInfo.setNickname(userInfo.getSysUser().getNickName());
// 获取登录token
return R.ok(tokenService.createToken(userInfo));
}

@ -387,7 +387,7 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
if (dmsBillsStatus.equals(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_TO_REPAIR)) {//待维修
dmsBillsFaultInstance.setBillsStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_REPAIRING);
@ -476,7 +476,7 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
dmsBillsFaultInstance.setBillsStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_FINISH);
dmsBillsFaultInstance.setRealEndTime(currentDate);

@ -102,7 +102,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
dmsBillsInspectInstance.setCreateTime(DateUtils.getNowDate());
dmsBillsInspectInstance.setIsFlag("1");
dmsBillsInspectInstance.setInspectStatus(DmsConstants.DMS_BILLS_INSPECT_INSTANCE_INSPECT_STATUS_TO_INSPECT);
dmsBillsInspectInstance.setCreateBy(SecurityUtils.getUsername());
dmsBillsInspectInstance.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
int i = dmsBillsInspectInstanceMapper.insertDmsBillsInspectInstance(dmsBillsInspectInstance);
// List<DmsBillsInspectInstance> dmsBillsInspectInstances = dmsBillsInspectInstanceMapper.selectDmsBillsInspectInstanceList(dmsBillsInspectInstance);
//新建第一步工单实例节点
@ -296,7 +296,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
dmsBillsInspectInstance.setInspectInstanceId(dmsInspectInstanceDetail.getInspectInstanceId());
dmsBillsInspectInstance.setRealEndTime(new Date());
int i = dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance);
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
dmsInspectInstanceDetail.setUpdateTime(currentDate);
dmsInspectInstanceDetail.setUpdateBy(userName);

@ -248,7 +248,7 @@ public class DmsBillsLubeInstanceServiceImpl implements IDmsBillsLubeInstanceSer
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
if (lubeStatus.equals(DmsConstants.DMS_BILLS_LUBE_INSTANCE_STATUS_TO_LUBE)) {//待润滑
dmsBillsLubeInstance.setLubeStatus(DmsConstants.DMS_BILLS_LUBE_INSTANCE_STATUS_LUBING);
@ -297,7 +297,7 @@ public class DmsBillsLubeInstanceServiceImpl implements IDmsBillsLubeInstanceSer
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
DmsBillsLubeDetail queryLubeDetail = new DmsBillsLubeDetail();
queryLubeDetail.setLubeInstanceId(lubeInstanceId);

@ -134,7 +134,7 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
dmsPlanInspect.setTimeLimit((timeLimitDays * 24 * 60 * 60)
+ (timeLimitHours * 60 * 60));
dmsPlanInspect.setIsFlag("1");
dmsPlanInspect.setCreateBy(SecurityUtils.getUsername());
dmsPlanInspect.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanInspect.setCreateTime(DateUtils.getNowDate());
//获取设备总数
Long aLong = dmsBaseInspectRouteMapper.selectAmountByInspectRouteId(dmsPlanInspect.getInspectRouteId());

@ -54,7 +54,7 @@ public class DmsPlanLubeDetailServiceImpl implements IDmsPlanLubeDetailService
@Override
public int insertDmsPlanLubeDetail(DmsPlanLubeDetail dmsPlanLubeDetail)
{
dmsPlanLubeDetail.setCreateBy(SecurityUtils.getUsername());
dmsPlanLubeDetail.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanLubeDetail.setCreateTime(DateUtils.getNowDate());
dmsPlanLubeDetail.setIsFlag(1l);
return dmsPlanLubeDetailMapper.insertDmsPlanLubeDetail(dmsPlanLubeDetail);
@ -69,7 +69,7 @@ public class DmsPlanLubeDetailServiceImpl implements IDmsPlanLubeDetailService
@Override
public int updateDmsPlanLubeDetail(DmsPlanLubeDetail dmsPlanLubeDetail)
{
dmsPlanLubeDetail.setUpdateBy(SecurityUtils.getUsername());
dmsPlanLubeDetail.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanLubeDetail.setUpdateTime(DateUtils.getNowDate());
return dmsPlanLubeDetailMapper.updateDmsPlanLubeDetail(dmsPlanLubeDetail);
}

@ -111,7 +111,7 @@ public class DmsPlanLubeServiceImpl implements IDmsPlanLubeService {
dmsPlanLube.setTimeLimit((timeLimitDays * 24 * 60 * 60)
+ (timeLimitHours * 60 * 60));
dmsPlanLube.setIsFlag("1");
dmsPlanLube.setCreateBy(SecurityUtils.getUsername());
dmsPlanLube.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanLube.setCreateTime(DateUtils.getNowDate());
int rows = dmsPlanLubeMapper.insertDmsPlanLube(dmsPlanLube);
@ -159,7 +159,7 @@ public class DmsPlanLubeServiceImpl implements IDmsPlanLubeService {
Long timeLimitHours = dmsPlanLube.getTimeLimitHours() == null ? 0L : dmsPlanLube.getTimeLimitHours();
dmsPlanLube.setTimeLimit((timeLimitDays * 24 * 60 * 60)
+ (timeLimitHours * 60 * 60));
dmsPlanLube.setUpdateBy(SecurityUtils.getUsername());
dmsPlanLube.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanLube.setUpdateTime(DateUtils.getNowDate());
return dmsPlanLubeMapper.updateDmsPlanLube(dmsPlanLube);
}

@ -57,7 +57,7 @@ public class DmsPlanMaintDetailServiceImpl implements IDmsPlanMaintDetailService
public int insertDmsPlanMaintDetail(DmsPlanMaintDetail dmsPlanMaintDetail)
{
if (dmsPlanMaintDetail.getDeviceId()==null){throw new ServiceException("设备名称不能为空");}
dmsPlanMaintDetail.setCreateBy(SecurityUtils.getUsername());
dmsPlanMaintDetail.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanMaintDetail.setCreateTime(DateUtils.getNowDate());
dmsPlanMaintDetail.setIsFlag(1l);
Long stationId = dmsPlanMaintDetailMapper.selectStationIdByCode(dmsPlanMaintDetail.getMaintStationCode());
@ -76,7 +76,7 @@ public class DmsPlanMaintDetailServiceImpl implements IDmsPlanMaintDetailService
@Override
public int updateDmsPlanMaintDetail(DmsPlanMaintDetail dmsPlanMaintDetail)
{
dmsPlanMaintDetail.setUpdateBy(SecurityUtils.getUsername());
dmsPlanMaintDetail.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanMaintDetail.setUpdateTime(DateUtils.getNowDate());
Long stationId = dmsPlanMaintDetailMapper.selectStationIdByCode(dmsPlanMaintDetail.getMaintStationCode());
dmsPlanMaintDetail.setMaintStationId(stationId);

@ -114,7 +114,7 @@ public class DmsPlanMaintServiceImpl implements IDmsPlanMaintService {
dmsPlanMaint.setTimeLimit((timeLimitDays * 24 * 60 * 60)
+ (timeLimitHours * 60 * 60));
dmsPlanMaint.setIsFlag(1l);
dmsPlanMaint.setCreateBy(SecurityUtils.getUsername());
dmsPlanMaint.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanMaint.setCreateTime(DateUtils.getNowDate());
int rows = dmsPlanMaintMapper.insertDmsPlanMaint(dmsPlanMaint);
@ -162,7 +162,7 @@ public class DmsPlanMaintServiceImpl implements IDmsPlanMaintService {
Long timeLimitHours = dmsPlanMaint.getTimeLimitHours() == null?0L:dmsPlanMaint.getTimeLimitHours();
dmsPlanMaint.setTimeLimit((timeLimitDays * 24 * 60 * 60)
+ (timeLimitHours * 60 * 60));
dmsPlanMaint.setUpdateBy(SecurityUtils.getUsername());
dmsPlanMaint.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsPlanMaint.setUpdateTime(DateUtils.getNowDate());
return dmsPlanMaintMapper.updateDmsPlanMaint(dmsPlanMaint);
}

@ -111,9 +111,9 @@ public class DmsRecordAlarmInfoServiceImpl implements IDmsRecordAlarmInfoService
@Override
public int handleDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo) {
dmsRecordAlarmInfo.setAlarmStatus(DmsConstants.DMS_ALARM_STATUS_ARTIFICIAL_HANDLE);
dmsRecordAlarmInfo.setHandleUser(SecurityUtils.getUsername());
dmsRecordAlarmInfo.setHandleUser(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsRecordAlarmInfo.setHandleTime(DateUtils.getNowDate());
dmsRecordAlarmInfo.setUpdateBy(SecurityUtils.getUsername());
dmsRecordAlarmInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsRecordAlarmInfo.setUpdateTime(DateUtils.getNowDate());
return dmsRecordAlarmInfoMapper.updateDmsRecordAlarmInfo(dmsRecordAlarmInfo);
}

@ -55,7 +55,7 @@ public class DmsRecordShutDownServiceImpl implements IDmsRecordShutDownService
@Override
public int insertDmsRecordShutDown(DmsRecordShutDown dmsRecordShutDown)
{
dmsRecordShutDown.setCreateBy(SecurityUtils.getUsername());
dmsRecordShutDown.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsRecordShutDown.setCreateTime(DateUtils.getNowDate());
return dmsRecordShutDownMapper.insertDmsRecordShutDown(dmsRecordShutDown);
}
@ -69,7 +69,7 @@ public class DmsRecordShutDownServiceImpl implements IDmsRecordShutDownService
@Override
public int updateDmsRecordShutDown(DmsRecordShutDown dmsRecordShutDown)
{
dmsRecordShutDown.setUpdateBy(SecurityUtils.getUsername());
dmsRecordShutDown.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
dmsRecordShutDown.setUpdateTime(DateUtils.getNowDate());
return dmsRecordShutDownMapper.updateDmsRecordShutDown(dmsRecordShutDown);
}

@ -37,7 +37,7 @@ public class FifthMesBorderController {
}
/**
*
*
*/
@GetMapping("/orderTime")
public AjaxResult orderTime(){

@ -74,7 +74,7 @@ public class MesImportController extends BaseController {
@PostMapping(("/raiseCapitalImportData"))
public AjaxResult raiseCapitalImportData(MultipartFile file, boolean updateSupport)
{
String operName = SecurityUtils.getUsername();
String operName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String message = mesImportService.raiseCapitalImportData(file, updateSupport, operName);
return success(message);
}
@ -92,7 +92,7 @@ public class MesImportController extends BaseController {
@PostMapping(("/raiseCapitalImportDataTest"))
public AjaxResult raiseCapitalImportDataTest(MultipartFile file, boolean updateSupport)
{
String operName = SecurityUtils.getUsername();
String operName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String message = mesImportService.raiseCapitalImportDataTest(file, updateSupport, operName);
return success(message);
}

@ -212,6 +212,8 @@ public class MesProductPlan extends BaseEntity
private String orderStatus;//生产工单状态
private BigDecimal instockAmount;//入库数量
public Long getSaleOrderId() {
return saleOrderId;
}
@ -657,6 +659,14 @@ public class MesProductPlan extends BaseEntity
this.orderStatus = orderStatus;
}
public BigDecimal getInstockAmount() {
return instockAmount;
}
public void setInstockAmount(BigDecimal instockAmount) {
this.instockAmount = instockAmount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -203,6 +203,10 @@ public class MesSaleOrder extends BaseEntity {
private String isReleaseStr;
private String overtimeFlag;
private String projectName;//项目名称
public String getMaterialModel() {
return materialModel;
@ -484,6 +488,22 @@ public class MesSaleOrder extends BaseEntity {
this.isReleaseStr = isReleaseStr;
}
public String getOvertimeFlag() {
return overtimeFlag;
}
public void setOvertimeFlag(String overtimeFlag) {
this.overtimeFlag = overtimeFlag;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -170,5 +170,13 @@ public interface MesProductPlanMapper
*/
public List<MesProductPlan> selectMesProductPlanJoinUserListByProductOrderId(Long productOrderId);
/**
* ,plancode
*
* @param planCode ()
* @return
*/
public MesProductPlan selectOnlyProductPlanWithInstockByPlanCode(String planCode);
}

@ -83,7 +83,7 @@ public class MesBaseAttachInfoServiceImpl implements IMesBaseAttachInfoService
public int updateMesBaseAttachInfo(MesBaseAttachInfo mesBaseAttachInfo)
{
mesBaseAttachInfo.setUpdateTime(DateUtils.getNowDate());
mesBaseAttachInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseAttachInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
return mesBaseAttachInfoMapper.updateMesBaseAttachInfo(mesBaseAttachInfo);
}

@ -276,7 +276,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Override
public int generateNoPurchaseRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
BigDecimal barcodeAmount = mesBaseBarcodeInfo.getBarcodeAmount();
List<MesBaseBarcodeInfo> toInsertedBarcodeInfos = new ArrayList<>();
@ -304,7 +304,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Override
public int generateRegularRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setPurchaseOrderId(mesBaseBarcodeInfo.getPurchaseOrderId());
queryBaseBarcodeInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
@ -336,7 +336,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String planCode = mesBaseBarcodeInfo.getPlanCode();
String planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
@ -445,9 +445,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
mesBaseBarcodeInfo.setPalletInfoCode(rawBarcode.getPalletInfoCode());//重新绑定托盘号
mesBaseBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING);
@ -525,7 +522,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
int barcodeAmount = mesBaseBarcodeInfo.getBarcodeAmount().intValue();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
for (int i = 0; i < barcodeAmount; i++) {
@ -604,7 +601,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
if (StringUtils.isNotEmpty(dbBaseBarcodeInfo.getPrintFlag()) && dbBaseBarcodeInfo.getPrintFlag().equals(MesConstants.MES_BARCODE_PRINT_FLAG_YES)) {
throw new ServiceException("此条码已经打印,不能修改");
}
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
@ -621,7 +618,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
MesBaseBarcodeInfo dbBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBarcodeInfo());
if (StringUtils.isEmpty(dbBaseBarcodeInfo.getPlanCode())) {
mesBaseBarcodeInfo.setBarcodeId(dbBaseBarcodeInfo.getBarcodeId());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
} else {
@ -701,6 +698,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
try {
String hostIp = IpUtils.getIpAddr();
if(hostIp.equals("192.168.2.26")){
hostIp = "192.168.2.10";
}
String printKey = "print_" + hostIp;
redisTemplate.opsForList().rightPush(printKey, printContentJson.toString());
// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString());
@ -725,9 +725,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Date currentDate = new Date();
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setPrintTime(DateUtils.getNowDate());
mesBaseBarcodeInfo.setPrintPerson(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setPrintPerson(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_YES);
mesBaseBarcodeInfo.setPrintNumber(mesBaseBarcodeInfo.getPrintNumber() == null ? 1L : mesBaseBarcodeInfo.getPrintNumber() + 1);
mesBaseBarcodeInfo.setAcceptedDate(currentDate);
@ -831,7 +831,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
productBarcodeInfo.setBindBarcode(materialBarcode);
productBarcodeInfo.setBindBy(SecurityUtils.getUsername());
productBarcodeInfo.setBindBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
productBarcodeInfo.setBindTime(new Date());
productBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING);
productBarcodeInfo.setPlanDetailCode(planDetailCode);
@ -928,7 +928,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
boolean palletInfoCodeRepeat = false;
String palletInfoCode = "";
String barcodeInfo = "";
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = DateUtils.getNowDate();
if (productBarcodesArr != null) {
StringBuilder materialNameBuilder = new StringBuilder();
@ -1254,7 +1254,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException(errorMsg);
}
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
MesBaseAbandonBarcode mesBaseAbandonBarcode = new MesBaseAbandonBarcode();
mesBaseAbandonBarcode.setBarcodeId(mesBaseBarcodeInfo.getBarcodeId());
@ -1327,8 +1327,49 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
// /**
// * 1楼和4楼入库时校验成品条码
// *
// * @param materialBarcode
// * @return
// */
// @Override
// public int check4thFloorProduceInstock(String materialBarcode) {
// MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
// if (mesBaseBarcodeInfo == null) {
// throw new ServiceException("物料条码有误");
// }
// String planCode = mesBaseBarcodeInfo.getPlanCode();
// MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyProductPlanWithInstockByPlanCode(planCode);
// if (mesProductPlan == null) {
// throw new ServiceException("未找到生产计划");
// }
//
// BigDecimal instockAmount = mesProductPlan.getInstockAmount() == null ? BigDecimal.ZERO : mesProductPlan.getInstockAmount();
// if (mesProductPlan.getPlanAmount().compareTo(instockAmount) <= 0) {
// throw new ServiceException("此生产计划计划生产数量:" + mesProductPlan.getPlanAmount() + ",已入库数量:" + instockAmount + ",不能再入库");
// }
//
// String planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
// if (StringUtils.isNotEmpty(planDetailCode)) {
// MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailCode(planDetailCode);
// if (mesProductPlanDetail == null) {
// throw new ServiceException("未找到生产计划明细");
// }
// }
//
//
//// if (!mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_INTERNAL)) {
//// throw new ServiceException("此生产任务为外部销售,不能直接出库");
//// }
//
//
// return 1;
// }
/**
*
*
*
* @param materialBarcode
* @return
@ -1339,12 +1380,24 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
String planCode = mesBaseBarcodeInfo.getPlanCode();
MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByPlanCode(planCode);
if (mesProductOrder == null) {
throw new ServiceException("未找到生产任务");
// String planCode = mesBaseBarcodeInfo.getPlanCode();
// MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(planCode);
// if (mesProductPlan == null) {
// throw new ServiceException("未找到生产计划");
// }
String planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
if (StringUtils.isNotEmpty(planDetailCode)) {
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailCode(planDetailCode);
if (mesProductPlanDetail == null) {
throw new ServiceException("未找到生产计划明细");
}
if (!mesProductPlanDetail.getPlanDetailStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) {
throw new ServiceException("此生产计划明细还未结束");
}
}
// if (!mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_INTERNAL)) {
// throw new ServiceException("此生产任务为外部销售,不能直接出库");
// }
@ -1370,7 +1423,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
return false;
}
mesBaseBarcodeInfo.setBarcodeId(dbMesBaseBarcodeInfo.getBarcodeId());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
updateSize += mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
@ -1388,7 +1441,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Transactional(rollbackFor = Exception.class)
public int generateMergeRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
List<MesSaleOrderRelate> mesSaleOrderRelateList = mesBaseBarcodeInfo.getMesSaleOrderRelateList();
List<MesMaterialBom> toUpdatedMaterialBoms = new ArrayList<>();
@ -1703,7 +1756,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Transactional(rollbackFor = Exception.class)
public int updateMergeRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String barcodeInfo = mesBaseBarcodeInfo.getBarcodeInfo();
//修改后的合并信息

@ -219,14 +219,12 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
List<MesStockAlarmDetail> allStockAlarmDetailList = new ArrayList<>();
stockAlarm(allStockAlarmDetailList, alarmInfoId, 1, nickName, currentDate);
if (allStockAlarmDetailList==null || allStockAlarmDetailList.isEmpty()) {
return 1;
throw new ServiceException("无库存预警信息");
} else {
List<SysPointRouter> sysPointRouterList = new ArrayList<>();
SysPointRouter sysPointRouter = getSysPointRouter(alarmInfoId, nickName, currentDate);
sysPointRouterList.add(sysPointRouter);
remoteSysCommonService.insertSysPointRouterPort(sysPointRouterList, SecurityConstants.INNER);
}
return 1;
}
@ -250,7 +248,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
List<MesStockAlarmDetail> allStockAlarmDetailList = new ArrayList<>();
MesBaseMaterialInfo queryMaterialInfo = new MesBaseMaterialInfo();
Integer pageSize = 100;
Integer pageNum = startRow / pageSize + 1;
Integer pageNum = startRow / pageSize+1;
PageHelper.startPage(pageNum, 100, "");
List<MesBaseMaterialInfo> mesBaseMaterialInfoList = mesBaseMaterialInfoMapper.selectMaterialInfoStockInfos(queryMaterialInfo);
for (MesBaseMaterialInfo mesBaseMaterialInfo : mesBaseMaterialInfoList) {
@ -258,7 +256,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
if (safeStockAmount != null) {
BigDecimal stockAmount = mesBaseMaterialInfo.getStockAmount() == null ? BigDecimal.ZERO : mesBaseMaterialInfo.getStockAmount();
//如果库存数量小于安全库存
if (stockAmount.compareTo(safeStockAmount) < 1) {
if (stockAmount.compareTo(safeStockAmount) < 0) {
MesStockAlarmDetail mesStockAlarmDetail = new MesStockAlarmDetail();
mesStockAlarmDetail.setAlarmInfoId(alarmInfoId);
mesStockAlarmDetail.setMaterialId(mesBaseMaterialInfo.getMaterialId());

@ -72,7 +72,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
@Override
public int updateMesBaseStationInfo(MesBaseStationInfo mesBaseStationInfo) {
mesBaseStationInfo.setUpdateTime(DateUtils.getNowDate());
mesBaseStationInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseStationInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
return mesBaseStationInfoMapper.updateMesBaseStationInfo(mesBaseStationInfo);
}

@ -561,20 +561,22 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
public List<MesMaterialBom> getMaterialUsages(MesProductOrder mesProductOrder) {
String saleType = mesProductOrder.getSaleType();
MesProductOrder queryProductOrder = new MesProductOrder();
if (saleType.equals(MesConstants.MES_PRODUCT_ORDER_SALE)) {//外部销售
Long materialId = mesProductOrder.getMaterialId();
queryProductOrder.setMaterialId(materialId);
} else {//对内生产
Long produceMaterialId = mesProductOrder.getProduceMaterialId();
queryProductOrder.setProduceMaterialId(produceMaterialId);
}
// if (saleType.equals(MesConstants.MES_PRODUCT_ORDER_SALE)) {//外部销售
// Long materialId = mesProductOrder.getMaterialId();
// queryProductOrder.setMaterialId(materialId);
// } else {//对内生产
// Long produceMaterialId = mesProductOrder.getProduceMaterialId();
// queryProductOrder.setProduceMaterialId(produceMaterialId);
// }
queryProductOrder.setMaterialBomId(mesProductOrder.getMaterialBomId());
queryProductOrder.setSaleOrderId(mesProductOrder.getSaleOrderId());
List<MesProductOrder> mesProductOrders = mesProductOrderMapper.selectMesProductOrderList(queryProductOrder);
//工单状态0-待发布1-已发布2-已完成3-已开始4-暂停8-已撤回9-已删除
//找到派工数量大于0并且状态是已发布或者已开始的或者暂停的
List<MesProductOrder> filterProductOrders = mesProductOrders.stream().filter(p ->
(p.getDispatchAmount() != null && p.getDispatchAmount().compareTo(BigDecimal.ONE) >= 0) &&
(p.getOrderStatus().equals(MesConstants.PUBLISHED) || p.getOrderStatus().equals(MesConstants.BEGIN) || p.getOrderStatus().equals(MesConstants.PAUSE))
(p.getOrderStatus().equals(MesConstants.PUBLISHED) || p.getOrderStatus().equals(MesConstants.BEGIN)
|| p.getOrderStatus().equals(MesConstants.PAUSE) ||p.getProductOrderId().equals(mesProductOrder.getProductOrderId()))
).collect(Collectors.toList());
//先根据saleorderid和安全库存查询总库存和已出库的数量

@ -430,7 +430,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
// }
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
BigDecimal planAmount = null;
// BigDecimal dispatchAmount = null;
//获取计划数量
@ -563,7 +563,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Long userId = SecurityUtils.getUserId();
String planDetailCode = Seq.getId(Seq.mesProductPlanDetailSeqType, Seq.mesProductPlanDetailCode);
@ -850,7 +850,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED);
mesProductPlanDetail.setUpdateTime(new Date());
mesProductPlanDetail.setUpdateBy(SecurityUtils.getUsername());
mesProductPlanDetail.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}

@ -337,7 +337,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
}
} else {
mesProductPlan.setPlanAmount(mesProductPlan.getDispatchAmount());
mesProductPlan.setCreateBy(SecurityUtils.getUsername());
mesProductPlan.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesProductPlan.setCreateTime(DateUtils.getNowDate());
mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode));
if (mesProductPlan.getSaleOrderId() == null) {
@ -595,7 +595,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
throw new ServiceException("此条码为非原材料条码");
}
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
MesMaterialCheckResult mesMaterialCheckResult = mesMaterialCheckResultMapper.
selectMesMaterialCheckResultByUI(planId, planDetailId, materialId);
@ -679,7 +679,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
MesMaterialAssignInfo mesMaterialAssignInfo = new MesMaterialAssignInfo();
mesMaterialAssignInfo.setMaterialBarcode(materialBarcode);
mesMaterialAssignInfo.setStationId(stationId);
mesMaterialAssignInfo.setCreateBy(SecurityUtils.getUsername());
mesMaterialAssignInfo.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesMaterialAssignInfo.setCreateTime(currentDate);
mesMaterialAssignInfoMapper.insertMesMaterialAssignInfo(mesMaterialAssignInfo);
@ -757,7 +757,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
MesProductOrder mesProductOrder = mesProductOrderService.selectMesProductOrderByProductOrderId(mesProductPlanDeleteVo.getProductOrderId());
BigDecimal dispatchedAmount = mesProductOrder.getDispatchAmount();
mesProductOrder.setDispatchAmount(dispatchedAmount.subtract(dispatchAmount));
mesProductOrder.setUpdateBy(SecurityUtils.getUsername());
mesProductOrder.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesProductOrder.setUpdateTime(new Date());
return mesProductOrderMapper.updateMesProductOrder(mesProductOrder);

@ -278,7 +278,7 @@ public class MesPurchaseApplyServiceImpl implements IMesPurchaseApplyService {
mesPurchaseApply.setUpdateTime(currentDate);
mesPurchaseApply.setSyncTime(currentDate);
mesPurchaseApply.setSyncStatus(MesConstants.MES_PURCHASE_APPALY_SYNC_YES);
mesPurchaseApply.setUpdateBy(SecurityUtils.getUsername());
mesPurchaseApply.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesPurchaseApplyMapper.updateMesPurchaseApply(mesPurchaseApply);
JSONArray jsonArray = new JSONArray();

@ -317,6 +317,9 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
*/
@Override
public List<MesPurchaseOrder> unbindPurchaseOrderList(MesPurchaseOrder mesPurchaseOrder) {
if(StringUtils.isNotEmpty(mesPurchaseOrder.getBomFlag()) &&mesPurchaseOrder.getBomFlag().equals("0")){
mesPurchaseOrder.setMaterialBomId(null);
}
return mesPurchaseOrderMapper.unbindPurchaseOrderList(mesPurchaseOrder);
}

@ -142,30 +142,35 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
mesSaleOrder.setMaterialSpec(StringUtils.isNotEmpty(mesSaleOrder.getMaterialSpec())
? mesSaleOrder.getMaterialSpec().replaceAll("\\s+", "") : "");
if (mesSaleOrder.getMaterialId() != null) {
MesMaterialBom queryMaterialBom = new MesMaterialBom();
queryMaterialBom.setMaterialId(mesSaleOrder.getMaterialId());
List<MesMaterialBom> mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom);
if (mesMaterialBoms != null && !mesMaterialBoms.isEmpty()) {
StringBuilder parentIdsBuilder = new StringBuilder();
for (MesMaterialBom mesMaterialBom : mesMaterialBoms) {
String ancestors = mesMaterialBom.getAncestors();
int commaIndex = ancestors.indexOf(",");
if (commaIndex >= 0) {
String ancestorPostfix = ancestors.substring(commaIndex + 1);
commaIndex = ancestorPostfix.indexOf(",");
MesBaseMaterialInfo mesBaseMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(mesSaleOrder.getMaterialId());
if (StringUtils.isEmpty(mesBaseMaterialInfo.getAccessoriesFlag()) || !mesBaseMaterialInfo.getAccessoriesFlag().equals("0")) {
MesMaterialBom queryMaterialBom = new MesMaterialBom();
queryMaterialBom.setMaterialId(mesSaleOrder.getMaterialId());
List<MesMaterialBom> mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom);
if (mesMaterialBoms != null && !mesMaterialBoms.isEmpty()) {
StringBuilder parentIdsBuilder = new StringBuilder();
for (MesMaterialBom mesMaterialBom : mesMaterialBoms) {
String ancestors = mesMaterialBom.getAncestors();
int commaIndex = ancestors.indexOf(",");
if (commaIndex >= 0) {
ancestorPostfix = ancestorPostfix.substring(commaIndex + 1);
String ancestorPostfix = ancestors.substring(commaIndex + 1);
commaIndex = ancestorPostfix.indexOf(",");
if (commaIndex >= 0) {
ancestorPostfix = ancestorPostfix.substring(commaIndex + 1);
}
parentIdsBuilder.append(",").append(ancestorPostfix);
}
parentIdsBuilder.append(",").append(ancestorPostfix);
}
String parentIds = parentIdsBuilder.toString().replaceFirst(",", "");
mesSaleOrder.setParentIds(parentIds);
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
} else {
return new ArrayList<>();
}
String parentIds = parentIdsBuilder.toString().replaceFirst(",", "");
mesSaleOrder.setParentIds(parentIds);
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
} else {
return new ArrayList<>();
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
}
} else {
@ -216,7 +221,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
mesBaseBarcodeInfo.setSaleOrderId(mesBaseBarcodeInfoTransferVo.getSaleOrderId());
mesBaseBarcodeInfo.setSaleorderCode(mesBaseBarcodeInfoTransferVo.getSaleOrderCode());
mesBaseBarcodeInfo.setSafeFlag(mesBaseBarcodeInfoTransferVo.getSafeFlag());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
updateSize += mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}

@ -433,6 +433,7 @@
bbi.barcode_type,
bbi.barcode_info,
bbi.material_id,
bbi.po_no,
bmi.material_code,
bmi.material_name,
bmi.material_spec
@ -449,6 +450,7 @@
<if test="materialSpec != null and materialSpec != ''">and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info like concat('%', #{barcodeInfo},'%')</if>
<if test="poNo != null and poNo != ''">and bbi.po_no like concat('%', #{poNo},'%')</if>
</where>
</select>
@ -459,9 +461,11 @@
bmi.material_id,
bmi.material_code,
bmi.material_name,
bmi.material_spec
bmi.material_spec,
mbbi.po_no
from wms_location_barcode wlb
left join mes_base_material_info bmi on bmi.material_id = wlb.material_id
left join mes_base_barcode_info mbbi on wlb.barcode_info=mbbi.barcode_info
<where>
<if test="locationCode != null and locationCode != ''"> and wlb.location_code = #{locationCode}</if>
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>
@ -469,6 +473,7 @@
<if test="materialSpec != null and materialSpec != ''">and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and wlb.barcode_info like concat('%', #{barcodeInfo},'%')</if>
<if test="poNo != null and poNo != ''">and mbbi.po_no like concat('%', #{poNo},'%')</if>
</where>
</select>

@ -389,6 +389,7 @@
(select ifnull(sum(total_amount),0) from wms_stock_total wst where wst.material_id=mbmi.material_id) as stock_amount
from mes_base_material_info mbmi
<where>
mbmi.safe_stock_amount is not null and mbmi.safe_stock_amount > 0
<if test="erpId != null ">and erp_id = #{erpId}</if>
</where>
</select>

@ -382,8 +382,8 @@
<if test="params.planBeginTime != null and params.planEndTime != null">
AND (plan_begin_time &lt;= #{params.planEndTime} AND plan_end_time &gt;= #{params.planBeginTime})
</if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mpo.order_status in ('0','1','3','4') and mpo.plan_end_time is not null and mpo.plan_end_time &lt; now() </if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mpo.plan_end_time is not null and mpo.plan_end_time >= now() </if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mpo.order_status in ('0','1','3','4') and mpo.plan_delivery_date is not null and mpo.plan_delivery_date &lt; now() </if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mpo.plan_delivery_date is not null and mpo.plan_delivery_date >= now() </if>
</where>
order by mpo.product_order_id desc
@ -545,7 +545,9 @@
(
select
max(real_begin_time) real_begin_time
from mes_produce_statistics_detail where product_order_status='2')) group by a.real_begin_time ,a.real_end_time,a.process_id ,a.product_order_id
from mes_produce_statistics_detail mpsd where
exists (select 1 from mes_product_order mpo where mpsd.product_order_id=mpo.product_order_id and mpo.order_status='2' and mpo.dispatch_id=4)))
group by a.real_begin_time ,a.real_end_time,a.process_id ,a.product_order_id order by process_id
</select>
<select id="orderEfficiency" resultType="com.hw.mes.domain.MesProduceStatisticsDetail">
select

@ -717,4 +717,36 @@
order by mpp.process_order
</select>
<select id="selectOnlyProductPlanWithInstockByPlanCode" parameterType="String" resultMap="MesProductPlanResult">
select a.plan_id,
a.product_order_id,
a.plan_code,
a.dispatch_code,
a.material_id,
a.material_bom_id,
a.process_id,
a.process_order,
a.last_process_id,
a.final_process_flag,
a.station_id,
a.user_id,
a.sale_order_id,
a.saleorder_code,
a.production_time,
a.dispatch_amount,
a.plan_amount,
a.complete_amount,
a.plan_status,
a.is_flag,
(select sum(wpi.instock_amount) from wms_product_instock wpi where wpi.plan_code=a.plan_code)
instock_amount
from mes_product_plan a
where a.plan_code = #{planCode}
</select>
</mapper>

@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="saleOrderAmount" column="sale_order_amount" />
<result property="supplierCode" column="supplier_code" />
<result property="projectNo" column="project_no" />
<result property="projectName" column="project_name"/>
</resultMap>
@ -301,6 +302,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
<if test="alwaysFlag != null and alwaysFlag != ''"> and mbmi.always_flag = #{alwaysFlag}</if>
<if test="materialBomId != null"> and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mpo.material_id and mmb.ancestors like concat('0,', #{materialBomId}, '%') )</if>
<if test='materialBomId==null'>and mbmi.accessories_flag='0'</if>
</where>
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name
</select>
@ -413,9 +415,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpo.order_amount, mpo.complete_amount, mpo.approve_date,
mpo.erp_modify_date, mpo.plan_delivery_date, mpo.begin_date, mpo.end_date, mpo.order_status,
mpo.complete_date, mpo.specification_parameter, mpo.src_bill_no, mpo.purchase_org_id, mpo.tond_base,
mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.always_flag
mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.always_flag,mpi.project_name
from mes_purchase_order mpo left join mes_base_material_info mbmi on mpo.material_id =mbmi.erp_id
left join mes_project_info mpi on mpo.tond_base=mpi.erp_id
<where>
<if test="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
@ -424,6 +426,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'%')</if>
<if test="specificationParameter != null and specificationParameter != '' ">and replace(mpo.specification_parameter,' ','') like concat('%', #{specificationParameter},
'%')</if>
<if test="projectName != null and projectName != ''">and mpi.project_name like concat('%', #{projectName},
'%')
</if>
<if test="orderStatus != null and orderStatus != ''"> and mpo.order_status = #{orderStatus}</if>
<if test="alwaysFlag != null and alwaysFlag != ''"> and mbmi.always_flag = #{alwaysFlag}</if>
@ -441,6 +446,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="srcBillNo != null and srcBillNo != ''"> and mpo.src_bill_no like concat('%', #{srcBillNo}, '%')</if>
<if test="tondBase != null and tondBase != ''"> and mpo.tond_base like concat('%', #{tondBase}, '%')</if>
<if test="bindFlag != null and bindFlag != ''"> and exists (select 1 from mes_order_bind mob where mob.purchase_order_id=mpo.purchase_order_id and mob.sale_order_id=#{saleOrderId})</if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mpo.order_status in ('1','2') and mpo.plan_delivery_date is not null and mpo.plan_delivery_date &lt; now() </if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mpo.plan_delivery_date is not null and mpo.plan_delivery_date >= now() </if>
</where>
order by mpo.erp_modify_date desc
</select>

@ -39,6 +39,7 @@
<result property="materialModel" column="material_model"/>
<result property="materialSpec" column="material_spec"/>
<result property="erpMaterialId" column="erp_material_id"/>
<result property="projectName" column="project_name"/>
</resultMap>
<sql id="selectMesSaleOrderVo">
@ -252,9 +253,11 @@
mso.begin_date,
mso.end_date,
mso.complete_date,
mso.sale_order_classfication
mso.sale_order_classfication,
mpi.project_name
from mes_sale_order mso left join mes_base_material_info mbmi on
(mso.material_id = mbmi.erp_id and mso.sale_order_classfication='1') or (mso.material_id = mbmi.material_id and mso.sale_order_classfication='2')
((mso.material_id = mbmi.erp_id and mso.sale_order_classfication='1') or (mso.material_id = mbmi.material_id and mso.sale_order_classfication='2'))
left join mes_project_info mpi on mso.tond_base=mpi.erp_id
<where>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code like concat('%', #{saleorderCode},
'%')</if>
@ -265,13 +268,19 @@
</if>
<if test="materialSpec != null and materialSpec != '' ">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="projectName != null and projectName != ''">and mpi.project_name like concat('%', #{projectName},
'%')
</if>
<if test="isRelease != null and isRelease != ''">and mso.is_release = #{isRelease}</if>
<if test="saleOrderId != null">and mso.sale_order_id = #{saleOrderId}</if>
<if test="saleOrderClassfication != null and saleOrderClassfication != ''">and mso.sale_order_classfication = #{saleOrderClassfication}</if>
<if test="relateFlag != null and relateFlag != ''">and exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id and msor.sale_order_id=#{virtualSaleOrderId})</if>
<if test="selectFlag != null and selectFlag != ''">and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id)</if>
<if test="parentIds != null and parentIds != ''">and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds}))</if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mso.is_release in ('0','1','2') and mso.plan_delivery_date is not null and mso.plan_delivery_date &lt; now() </if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mso.plan_delivery_date is not null and mso.plan_delivery_date >= now() </if>
</where>
order by mso.erp_modify_date desc
</select>

@ -77,7 +77,7 @@ public class QmsCheckProjectServiceImpl implements IQmsCheckProjectService
qmsCheckProject.setDownDiff(null);
}
qmsCheckProject.setUpdateBy(SecurityUtils.getUsername());
qmsCheckProject.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
qmsCheckProject.setUpdateTime(DateUtils.getNowDate());
return qmsCheckProjectMapper.updateQmsCheckProject(qmsCheckProject);
}

@ -92,11 +92,11 @@ public class QmsQualityInstanceActivityServiceImpl implements IQmsQualityInstanc
QmsQualityInstanceActivity activity = qmsQualityInstanceActivities.get(0);
//赋值
activity.setCreateTime(DateUtils.getNowDate());
activity.setCreateBy(SecurityUtils.getUsername());
activity.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
activity.setStartTime(DateUtils.getNowDate());
activity.setProcessHandleStatus("1");
activity.setHandleUserId(SecurityUtils.getUserId());
activity.setHandleBy(SecurityUtils.getUsername());
activity.setHandleBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
activity.setProcessHandleResolution(qmsQualityInstanceActivity.getProcessHandleResolution());
activity.setProcessHandleDesc(qmsQualityInstanceActivity.getProcessHandleDesc());
activity.setQmsCheckInstanceFileList(qmsQualityInstanceActivity.getQmsCheckInstanceFileList());

@ -166,7 +166,7 @@ public class QmsQualityInstanceServiceImpl implements IQmsQualityInstanceService
qmsQualityInstanceActivity.setProcessHandleResolution(" ");
qmsQualityInstanceActivity.setStartTime(DateUtils.getNowDate());
qmsQualityInstanceActivity.setHandleUserId(SecurityUtils.getUserId());
qmsQualityInstanceActivity.setHandleBy(SecurityUtils.getUsername());
qmsQualityInstanceActivity.setHandleBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
insertQmsCheckInstanceFile(qmsQualityInstanceActivity, qmsQualityInstance.getFileUrls());
qmsQualityInstanceActivities.add(qmsQualityInstanceActivity);
@ -270,7 +270,7 @@ public class QmsQualityInstanceServiceImpl implements IQmsQualityInstanceService
Long checkResultId = qmsQualityInstanceActivityVo.getCheckResultId();
QmsQualityInstance qmsQualityInstance = qmsQualityInstanceMapper.selectQmsQualityInstanceByCheckResultId(checkResultId);
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
//todo:权限校验
if (qmsQualityInstance == null) {
qmsQualityInstance = new QmsQualityInstance();

@ -44,6 +44,8 @@ public class WmsLocationBarcode extends BaseEntity {
private String materialSpec;
private String poNo;
public void setLocationBarcodeId(Long locationBarcodeId) {
this.locationBarcodeId = locationBarcodeId;
@ -101,6 +103,14 @@ public class WmsLocationBarcode extends BaseEntity {
this.materialSpec = materialSpec;
}
public String getPoNo() {
return poNo;
}
public void setPoNo(String poNo) {
this.poNo = poNo;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -98,7 +98,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
// }
// }
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(warehouseId);
@ -408,7 +408,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
existedInventoryCheckDetail.setRealAmount(realAmount);
existedInventoryCheckDetail.setUpdateDate(new Date());
existedInventoryCheckDetail.setUpdateBy(SecurityUtils.getUsername());
existedInventoryCheckDetail.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
return wmsInventoryCheckDetailMapper.updateWmsInventoryCheckDetail(existedInventoryCheckDetail);
}
@ -440,7 +440,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
// List<Long> inventoryCheckDetailIds = wmsInventoryCheckDetailList.stream().map(WmsInventoryCheckDetail::getInventoryCheckDetailId).collect(Collectors.toList());
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
wmsInventoryCheckDetailList.forEach(wmsInventoryCheckDetail -> {
wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_FINISH);

@ -185,7 +185,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
if (baseBarcodeInfo.getMaterialId().equals(0L)) {//代表4楼到5楼合并的条码
String rawMaterialBarcode = baseBarcodeInfo.getProductBarcode();
@ -465,7 +465,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
}
// }
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
WmsProductInstock wmsProductInstock = new WmsProductInstock();
wmsProductInstock.setTaskCode(Seq.getId(Seq.productInstockSeqType, Seq.productInstockCode));

@ -154,7 +154,7 @@ public class WmsProductOutstockDetailServiceImpl implements IWmsProductOutstockD
throw new ServiceException(String.format("出库申请数量为%1$s不能再出库", applyQty));
}
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
//更新出库记录
if (applyQty.compareTo(currentOutstockQty) == 0) {

@ -145,7 +145,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
auditStatus = WmsConstants.WMS_AUDIT_STATUS_TOAUDIT;
}
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
wmsProductOutstock.setProductType(WmsConstants.WMS_PRODUCT_OUTSTOCK_PRODUCT_TYPE_PRODUCT);
wmsProductOutstock.setOperationType(operationType);
@ -298,7 +298,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
productOutstockDetail.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_CONFIRM);
productOutstockDetail.setConfirmAmount(BigDecimal.ONE);
productOutstockDetail.setUpdateDate(new Date());
productOutstockDetail.setUpdateBy(SecurityUtils.getUsername());
productOutstockDetail.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
return wmsProductOutstockDetailMapper.updateWmsProductOutstockDetail(productOutstockDetail);
}
@ -365,7 +365,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(warehouseId);
String outRequirement = warehouse.getOutRequirement();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
Long productOutstockId = null;
//如果是直接出库
@ -377,6 +377,8 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
wmsProductOutstock.setOutstockType(WmsConstants.WMS_PRODUCT_OUTSTOCK_TYPE_SALE);
wmsProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsProductOutstock.setOutstockQty(BigDecimal.ONE);
wmsProductOutstock.setApplyQty(BigDecimal.ONE);
wmsProductOutstock.setProductId(materialId);
wmsProductOutstock.setPlanCode(planCode);
wmsProductOutstock.setPlanDetailCode(planDetailCode);
@ -518,7 +520,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
String auditReason = wmsProductOutstockAuditVo.getAuditReason();
Long productOutstockId = wmsProductOutstockAuditVo.getProductOutstockId();
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
// WmsProductOutstock queryProductOutstock = new WmsProductOutstock();
// queryProductOutstock.setTaskCode(taskCode);

@ -344,7 +344,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
wmsRawStock.setSaleOrderId(saleOrderId);
wmsRawStock.setSaleorderCode(saleorderCode);
wmsRawStock.setUpdateDate(new Date());
wmsRawStock.setUpdateBy(SecurityUtils.getUsername());
wmsRawStock.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
return mesBaseBarcodeInfo;
@ -492,7 +492,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
wmsProductStock.setSaleOrderId(saleOrderId);
wmsProductStock.setSaleorderCode(saleorderCode == null ? "" : saleorderCode);
wmsProductStock.setUpdateDate(new Date());
wmsProductStock.setUpdateBy(SecurityUtils.getUsername());
wmsProductStock.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
wmsProductStockMapper.updateWmsProductStock(wmsProductStock);
}

@ -164,7 +164,7 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
*/
@Override
public int applyTransfers(List<WmsTransfer> wmsTransfers) {
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
//todo:生成任务编号
//需要在循环内执行事务不能用this调用需要新建一个Service
@ -196,7 +196,7 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
@Transactional(rollbackFor = Exception.class)
@Override
public int transferOutstock(WmsTransferDetail wmsTransferDetail) {
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
String oriLocationCode = wmsTransferDetail.getLocationCode();
@ -294,7 +294,7 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
@Transactional(rollbackFor = Exception.class)
@Override
public int transferInstock(WmsTransferDetail wmsTransferDetail) {
String userName = SecurityUtils.getUsername();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
String targetLocationCode = wmsTransferDetail.getLocationCode();
String materialBarcode = wmsTransferDetail.getMaterialBarcode();//成品条码(之前半成品出库的是原材料条码)

@ -15,6 +15,7 @@
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="poNo" column="po_no"/>
</resultMap>
<sql id="selectWmsLocationBarcodeVo">
@ -101,8 +102,9 @@
<select id="selectWmsLocationBarcodeJoinList" parameterType="WmsLocationBarcode" resultMap="WmsLocationBarcodeResult">
select wlb.location_barcode_id, wlb.location_code, wlb.material_id, wlb.barcode_info,
mbmi.material_code,mbmi.material_name,mbmi.material_spec
mbmi.material_code,mbmi.material_name,mbmi.material_spec,ifnull(mbbi.po_no,'无采购订单') as po_no
from wms_location_barcode wlb left join mes_base_material_info mbmi on wlb.material_id=mbmi.material_id
left join mes_base_barcode_info mbbi on wlb.barcode_info=mbbi.barcode_info
<where>
<if test="locationCode != null and locationCode != ''">and wlb.location_code = #{locationCode}</if>
<if test="materialId != null ">and wlb.material_id = #{materialId}</if>

@ -206,9 +206,7 @@
<select id="selectWmsStockTotalJoinRealListBySaleOrder" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,wst.safe_flag,wst.sale_order_id,
mbmi.material_code,mbmi.material_name,mbmi.material_spec,
(select sum(wro.real_outstock_amount) from wms_raw_outstock wro where wro.stock_total_id=wst.stock_total_id
and (wro.execute_status='0' or wro.execute_status='1')) outstock_amount
mbmi.material_code,mbmi.material_name,mbmi.material_spec
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where>

@ -324,7 +324,7 @@
<el-select v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" placeholder="请扫描或输入物料条码"
style="width:360px">
<el-option v-for="item in locationBarcodeList" :key="item.barcodeInfo"
:label="`${item.materialName}(${item.materialSpec})`"
:label="`${item.materialName}(${item.materialSpec},${item.poNo})`"
:value="item.barcodeInfo"></el-option>
</el-select>
</el-form-item>

@ -125,6 +125,8 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[10].visible"/>
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime"/>
<el-table-column label="状态" align="center" width="100">
<template slot-scope="scope">
<el-switch

@ -618,7 +618,7 @@
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="需要数量" align="center" prop="standardAmount" width="100"/>
<el-table-column label="已使用数量" align="center" prop="outstockAmount" width="100"/>
<!-- 不显示已使用数量如果库存没有了则获取不到需要单独获取 <el-table-column label="已使用数量" align="center" prop="outstockAmount" width="100"/>-->
<el-table-column label="库存总数量" align="center" prop="totalAmount" width="100"/>
<el-table-column label="占用数量" align="center" prop="occupyAmount" width="100"/>
<el-table-column label="库存可用数量" align="center" prop="availableAmount" width="100"/>

@ -67,6 +67,27 @@
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="超时标识" prop="overtimeFlag">
<el-select v-model="queryParams.overtimeFlag" placeholder="请选择超时标识" clearable>
<el-option
v-for="dict in dict.type.mes_overtime_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -142,7 +163,7 @@
<dict-tag :options="dict.type.mes_purchase_order_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" prop="projectName"/>
<el-table-column label="开始日期" align="center" prop="beginDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.beginDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
@ -181,7 +202,6 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:purchaseOrder:bind']"
v-if="scope.row.orderStatus === ORDER_STATUS.TO_PURCHASE || scope.row.orderStatus === ORDER_STATUS.PURCHASEING"
>绑定
</el-button>
<el-button
@ -257,7 +277,7 @@ import {runJob} from "@/api/monitor/job";
export default {
name: "PurchaseOrder",
dicts: ['active_flag', 'mes_purchase_order_status', 'document_status', 'mes_safe_flag','mes_material_bind_flag'],
dicts: ['active_flag', 'mes_purchase_order_status', 'document_status', 'mes_safe_flag','mes_material_bind_flag','mes_overtime_flag'],
components: {
'order-binds': orderBinds,
},
@ -302,6 +322,7 @@ export default {
materialCode: null,
materialName: null,
materialSpec: null,
projectName:null,
specificationParameter: null,
alwaysFlag: null,
orderAmount: null,

@ -167,6 +167,7 @@
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handlePurchaseOrderQuery"></el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleBomFlagNoPurchaseOrderQuery">bom</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetMaterialQuery"></el-button>
<el-button
type="primary"
@ -395,9 +396,17 @@ export default {
},
/** 可选采购订单搜索按钮操作 */
handlePurchaseOrderQuery() {
this.purchaseOrderQueryParams.bomFlag = null;
this.purchaseOrderQueryParams.pageNum = 1;
this.getUnbindPurchaseOrderList();
},
/** 可选采购订单搜索按钮操作 */
handleBomFlagNoPurchaseOrderQuery() {
this.purchaseOrderQueryParams.bomFlag = "0";
this.purchaseOrderQueryParams.pageNum = 1;
this.getUnbindPurchaseOrderList();
},
/** 可选采购订单重置按钮操作 */
resetMaterialQuery() {
this.resetForm("materialQueryForm");

@ -59,6 +59,27 @@
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="超时标识" prop="overtimeFlag">
<el-select v-model="queryParams.overtimeFlag" placeholder="请选择超时标识" clearable>
<el-option
v-for="dict in dict.type.mes_overtime_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="完成日期" prop="completeDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.completeDate"-->
@ -172,6 +193,7 @@
<dict-tag :options="dict.type.mes_sale_order_is_release" :value="scope.row.isRelease"/>
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" prop="projectName"/>
<el-table-column label="开始日期" align="center" prop="beginDate">
<template slot-scope="scope">
@ -411,7 +433,7 @@ export default {
closeDialog: this.closeDialog,
}
},
dicts: ['document_status', 'is_release','mes_sale_order_is_release','mes_sale_order_classfication'],
dicts: ['document_status', 'is_release','mes_sale_order_is_release','mes_sale_order_classfication','mes_overtime_flag'],
data() {
return {
//
@ -446,6 +468,7 @@ export default {
materialId: null,
materialCode: null,
materialName: null,
projectName:null,
matkl: null,
orderAmount: null,
completeAmount: null,

@ -23,6 +23,15 @@
<el-form :model="allocateBarCodeQueryParams" ref="allocateMaterialQueryForm" size="small" :inline="true"
v-show="showSearch"
label-width="68px">
<el-form-item label="采购订单" prop="poNo">
<el-input
v-model="allocateBarCodeQueryParams.poNo"
placeholder="请输入采购订单"
style="width:140px;"
clearable
@keyup.enter.native="handleAllocateMaterialQuery"
/>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="allocateBarCodeQueryParams.materialCode"
@ -85,6 +94,7 @@
<el-table v-loading="allocateMaterialLoading" :data="allocateMaterialList"
@selection-change="handleAllocateMaterialSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="采购订单" align="center" prop="poNo"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
@ -105,6 +115,15 @@
<h4 class="form-header h4">可选条码</h4>
<el-form :model="barCodeQueryParams" ref="materialQueryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="采购订单" prop="poNo">
<el-input
v-model="barCodeQueryParams.poNo"
placeholder="请输入采购订单"
style="width:140px;"
clearable
@keyup.enter.native="handleMaterialQuery"
/>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="barCodeQueryParams.materialCode"
@ -161,6 +180,7 @@
<el-table v-loading="materialLoading" :data="materialinfoList"
@selection-change="handleMaterialSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="采购订单" align="center" prop="poNo"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>

Loading…
Cancel
Save