Browse Source

rev: 分拣工单、分拣木托盘搬运校验根据计算好的数量

master
李永德 1 year ago
parent
commit
22deece58f
  1. 37
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  2. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java
  3. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java
  4. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml
  5. 14
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/CusterVo.java
  6. 27
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/MesOrderInfo.java
  7. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java
  8. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/controller/PdmBdWorkorderController.java
  9. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java
  10. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/PdmBdWorkorder.java
  11. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dto/PdmBdWorkorderQuery.java
  12. 67
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java
  13. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java
  14. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.java
  15. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.xml
  16. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java
  17. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java
  18. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java
  19. 2
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml
  20. 143
      lms/nladmin-ui/src/views/wms/pdm/workerorder/ProductionOrder.vue
  21. 155
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue
  22. 8
      lms/nladmin-ui/src/views/wms/pdm/workerorder/pdmBdWorkorder.js
  23. 2
      lms/nladmin-ui/src/views/wms/sch/group/MaterialDialog.vue

37
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -302,31 +302,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// todo: 特殊处理
protected int specialHandling(String regionCode, JSONObject param) {
int torus = 0; // 无业务:0, 分拣剩余1托:1,分拣剩余0托:2
int torus = 0; // 无业务:0,分拣剩余0托:1
if (regionCode.equals("FJ")) { // 判断是否够码满
// 分拣需要在这设置特殊值
// 校验是否够码满一托
JSONArray array = param.getJSONArray("list");
List<ApplyDeviceDto> list = JSONArray.parseArray(array.toJSONString(), ApplyDeviceDto.class);
PdmBdWorkorder workorder = workorderService.getDeviceDockingProductionTask(param.getString("device_code"));
// 1 获取点位相应数量
int sum = 0;
for (ApplyDeviceDto applyDeviceDto : list) {
sum += Integer.parseInt(applyDeviceDto.getQty());
}
// 2 获取库存量 surplusNumber
int surplusNumber = fjMapper.getInventoryQuantity(workorder.getMaterial_id());
// 3 现有总数 total
int total = sum + surplusNumber;
// 4 获取木托盘需要多少块 needFullNumber
String needFullNumberStr = fjMapper.getNeedFullNumber(workorder.getMaterial_id());
int needFullNumber = TaskUtils.convertMultiply(needFullNumberStr);
int surplus = total / needFullNumber;
if (surplus == 1) {
torus = 1;
} else if (surplus == 0) {
torus = 2;
}
boolean enoughCallEmpty = workorderService.isEnoughCallEmpty(param.getString("device_code"));
// PdmBdWorkorder workorder = workorderService.getDeviceDockingProductionTask(param.getString("device_code"));
// BigDecimal realQty = workorder.getReal_qty();
// BigDecimal planQty = workorder.getPlan_qty();
// if (realQty.compareTo(planQty) < 0) { // 还可以叫空盘
// torus = 0;
// } else {
// torus = 1;
// }
return enoughCallEmpty ? 0 : 1;
}
return torus;
}
@ -596,7 +585,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(),
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue());
if (ObjectUtil.isEmpty(one)) {
throw new BadRequestException("载具编码为"+baseRequest.getVehicle_code()+"组盘不存在!");
throw new BadRequestException("载具编码为" + baseRequest.getVehicle_code() + "组盘不存在!");
}
String yjDeviceCode = basePoint.getParent_point_code(); // 压机设备编码
SchBasePoint devicePoint = pointService.getById(yjDeviceCode);
@ -627,7 +616,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
vehiclematerialgroupService.updateById(one);
// 记录泥料
MesMudConsumptionDto mesMudConsumptionDto = new MesMudConsumptionDto();
mesMudConsumptionDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
mesMudConsumptionDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
mesMudConsumptionDto.setPWORKSCHE_ID(productionTask.getWorkorder_code());
mesMudConsumptionDto.setOUT_FINNUM(one.getMaterial_weight());
mesMudConsumptionDto.setPRESSUNIT(devicePoint.getExt_point_code());

16
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java

@ -1,8 +1,7 @@
package org.nl.wms.ext.mes.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo;
import org.nl.wms.ext.acs.service.dto.BrickInfoDto;
import org.nl.wms.ext.mes.autotask.AutoSaveWaitGdyInfo;
import org.nl.wms.ext.mes.service.dto.*;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
@ -92,4 +91,17 @@ public interface WmsToMesService {
* @param shelfInfo
*/
void saveShelfInfoBatchToMes(MesShelfInfo shelfInfo);
/**
* 根据成品物料编码获取订单号
* @param materialId
* @return
*/
IPage<MesOrderInfo> selectPageMesOrder(IPage<MesOrderInfo> pages, String materialId);
/**
* 获取所有客户信息
* @return
*/
List<CusterVo> getCusterInfo();
}

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java

@ -2,6 +2,7 @@ package org.nl.wms.ext.mes.service.dao.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.ext.mes.autotask.AutoSaveWaitGdyInfo;
@ -59,4 +60,8 @@ public interface MesRequestMapper {
List<MesShelfInfo> getAllShelfInfos();
@DS("oracle")
void saveShelfInfoBatchToMes(MesShelfInfo shelfInfo);
@DS("oracle")
IPage<MesOrderInfo> findOrderInfoByMaterialId(IPage<MesOrderInfo> pages, String materialId);
@DS("oracle")
List<CusterVo> getCusterInfo();
}

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml

@ -281,4 +281,14 @@
LEFT JOIN sch_base_point p2 ON p2.point_code = vg.source_vehicle_code
WHERE p1.region_code = 'GTPHC'
</select>
<select id="findOrderInfoByMaterialId" resultType="org.nl.wms.ext.mes.service.dto.MesOrderInfo">
SELECT * FROM "RTMG"."VIEW_POP_ORDER_RESULT_LMS" vp
WHERE 1 = 1
<if test="materialId != null and materialId != ''">
AND vp.FMATERIAL_ID = #{materialId}
</if>
</select>
<select id="getCusterInfo" resultType="org.nl.wms.ext.mes.service.dto.CusterVo">
SELECT * FROM "RTMG"."VIEW_CUSTER_LMS"
</select>
</mapper>

14
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/CusterVo.java

@ -0,0 +1,14 @@
package org.nl.wms.ext.mes.service.dto;
import lombok.Data;
/**
* @Author: lyd
* @Description: 客户信息
* @Date: 2023/10/23
*/
@Data
public class CusterVo {
private String CUSTER_NO;
private String CUSTER_NAME;
}

27
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/MesOrderInfo.java

@ -0,0 +1,27 @@
package org.nl.wms.ext.mes.service.dto;
import lombok.Data;
/**
* @Author: lyd
* @Description: mes的订单信息DTO
* @Date: 2023/10/23
*/
@Data
public class MesOrderInfo {
/**
* 订单号
*/
private String FORDER_NO;
private String FPLANSTART_DATE;
private String FPLANFINISH_DATE;
private String FMATERIAL_ID;
private String FMATERIAL_NAME;
private String FMATSPEC;
private String FMATMODEL;
private String FSALE_NO;
private int FORDER_SUBNUM;
private String BC;
private String BZ;
private int GUADANSUM;
}

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java

@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo;
@ -407,6 +408,16 @@ public class WmsToMesServiceImpl implements WmsToMesService {
mesRequestMapper.saveShelfInfoBatchToMes(shelfInfo);
}
@Override
public IPage<MesOrderInfo> selectPageMesOrder(IPage<MesOrderInfo> pages, String materialId) {
return mesRequestMapper.findOrderInfoByMaterialId(pages, materialId);
}
@Override
public List<CusterVo> getCusterInfo() {
return mesRequestMapper.getCusterInfo();
}
/**
* 转换
*

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/controller/PdmBdWorkorderController.java

@ -44,6 +44,18 @@ public class PdmBdWorkorderController {
public ResponseEntity<Object> query(PdmBdWorkorderQuery query, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAll(query,page)),HttpStatus.OK);
}
@GetMapping("/mesOrder")
@Log("查询订单管理")
@ApiOperation("查询订单管理")
public ResponseEntity<Object> queryMesOrder(PdmBdWorkorderQuery query, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryMesOrder(query,page)),HttpStatus.OK);
}
@PostMapping("/getCuster")
@Log("获取客户信息")
@ApiOperation("获取客户信息")
public ResponseEntity<Object> getCuster(){
return new ResponseEntity<>(wmsToMesService.getCusterInfo(), HttpStatus.OK);
}
@GetMapping("/materials")
@Log("查询物料基础信息")

16
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java

@ -3,6 +3,7 @@ package org.nl.wms.pdm.workorder.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.ext.mes.service.dto.MesOrderInfo;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.workorder.service.dto.PdmBdWorkorderQuery;
@ -63,4 +64,19 @@ public interface IPdmBdWorkorderService extends IService<PdmBdWorkorder> {
* @return
*/
PdmBdWorkorder getDeviceDockingProductionTask(String deviceCode);
/**
* 获取mes订单信息
* @param query
* @param page
* @return
*/
IPage<MesOrderInfo> queryMesOrder(PdmBdWorkorderQuery query, PageQuery page);
/**
* 根据对接位获取是否可以叫空盘
* @param deviceCode
* @return
*/
boolean isEnoughCallEmpty(String deviceCode);
}

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/PdmBdWorkorder.java

@ -146,4 +146,15 @@ public class PdmBdWorkorder implements Serializable {
@TableField(exist = false)
private String half_material_code;
@TableField(exist = false)
private String order_no;
@TableField(exist = false)
private String custer_no;
@TableField(exist = false)
private int order_subnum;
@TableField(exist = false)
private int guadansum;
@TableField(exist = false)
private String pack_method;
}

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dto/PdmBdWorkorderQuery.java

@ -16,5 +16,6 @@ public class PdmBdWorkorderQuery implements Serializable {
private String begin_time;
private String end_time;
private List<String> more_order_status;
private String materialId;
}

67
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java

@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -16,13 +17,15 @@ import org.nl.common.utils.CodeUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.ext.acs.service.dto.ResultForAcs;
import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse;
import org.nl.wms.ext.mes.service.WmsToMesService;
import org.nl.wms.ext.mes.service.dto.MesOrderInfo;
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.workorder.service.dao.mapper.PdmBdWorkorderMapper;
import org.nl.wms.pdm.workorder.service.dao.vo.AcsWorkOrderVo;
import org.nl.wms.pdm.workorder.service.dto.PdmBdWorkorderQuery;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task_manage.GeneralDefinition;
@ -32,16 +35,16 @@ import org.nl.wms.util.TaskUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* @description 服务实现
* @author lyd
* @date 2023-05-05
**/
* @author lyd
* @description 服务实现
* @date 2023-05-05
**/
@Slf4j
@Service
public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper, PdmBdWorkorder> implements IPdmBdWorkorderService {
@ -55,9 +58,13 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
private ISysNoticeService noticeService;
@Autowired
private ISchBasePointService pointService;
@Autowired
private WmsToMesService wmsToMesService;
@Autowired
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
@Override
public IPage<PdmBdWorkorder> queryAll(PdmBdWorkorderQuery query, PageQuery page){
public IPage<PdmBdWorkorder> queryAll(PdmBdWorkorderQuery query, PageQuery page) {
IPage<PdmBdWorkorder> pages = new Page<>(page.getPage() + 1, page.getSize());
pages = pdmBdWorkorderMapper.selectPageLeftJoin(pages, query);
return pages;
@ -78,9 +85,37 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
entity.setUpdate_id(currentUserId);
entity.setUpdate_name(nickName);
entity.setUpdate_time(now);
// 如果是分拣,就特殊处理
if (entity.getRegion_code().equals("FJ")) {
toCalculatePlannedQuantity(entity);
}
pdmBdWorkorderMapper.insert(entity);
}
/**
* 分拣工单需要计算计划数量并封装数据
*
* @param entity
*/
private void toCalculatePlannedQuantity(PdmBdWorkorder entity) {
int orderSubnum = entity.getOrder_subnum(); // 计划量
int guadansum = entity.getGuadansum(); // 已经包装数
int residueNum = orderSubnum - guadansum; // 剩余数
int multiply = TaskUtils.convertMultiply(entity.getPack_method());
// 计算需要多少木托
int ceil = (int) Math.ceil(residueNum / multiply);
// 获取此物料在库存中有多少
int inventoryQty = vehiclematerialgroupService.getInventoryQtyByMaterialId(entity.getMaterial_id());
// 查看库存能有多少托
int inventoryCeil = (int) Math.ceil(inventoryQty / multiply);
// 工单号和客户编码存放json
JSONObject res = new JSONObject();
res.put("order_no", entity.getOrder_no());
res.put("custer_no", entity.getCuster_no());
entity.setPlan_qty(ceil > inventoryCeil ? BigDecimal.valueOf(inventoryCeil) : BigDecimal.valueOf(ceil));
entity.setExt_data(res.toJSONString());
}
@Override
public void update(PdmBdWorkorder entity) {
PdmBdWorkorder dto = pdmBdWorkorderMapper.selectById(entity.getWorkorder_id());
@ -154,7 +189,7 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
log.error("工单下发异常:" + e.getMessage());
// 通知
noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: "
+ pdmBdWorkorder.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode());
+ pdmBdWorkorder.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode());
throw new BadRequestException("工单下发失败");
}
if (resultForAcs.getCode() != HttpStatus.HTTP_OK) {
@ -182,4 +217,20 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
.eq(PdmBdWorkorder::getWorkorder_status, WorkOrderStatusEnum.PRODUCING.getCode());
return pdmBdWorkorderMapper.selectOne(lam);
}
@Override
public IPage<MesOrderInfo> queryMesOrder(PdmBdWorkorderQuery query, PageQuery page) {
IPage<MesOrderInfo> pages = new Page<>(page.getPage() + 1, page.getSize());
pages = wmsToMesService.selectPageMesOrder(pages, query.getMaterialId());
return pages;
}
@Override
public boolean isEnoughCallEmpty(String deviceCode) {
PdmBdWorkorder workorder = this.getDeviceDockingProductionTask(deviceCode);
BigDecimal realQty = workorder.getReal_qty();
BigDecimal planQty = workorder.getPlan_qty();
// 还可以叫空盘
return realQty.compareTo(planQty) < 0;
}
}

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java

@ -79,4 +79,11 @@ public interface ISchBaseVehiclematerialgroupService extends IService<SchBaseVeh
* @return
*/
SchBaseVehiclematerialgroup getGroupInfo(String vehicleCode, String value);
/**
* 返回当前物料的剩余库存数
* @param materialId
* @return
*/
int getInventoryQtyByMaterialId(String materialId);
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.java

@ -15,4 +15,6 @@ public interface SchBaseVehiclematerialgroupMapper extends BaseMapper<SchBaseVeh
IPage<SchBaseVehiclematerialgroup> selectPageLeftJoin(IPage<SchBaseVehiclematerialgroup> pages, SchBaseVehiclematerialgroupQuery query);
SchBaseVehiclematerialgroup getGroup(JSONObject entity);
int getInventoryQtyByMaterialId(String materialId);
}

16
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.xml

@ -49,4 +49,20 @@
</if>
AND vg.group_bind_material_status = '2'
</select>
<select id="getInventoryQtyByMaterialId" resultType="java.lang.Integer">
SELECT
IF(SUM(vg.material_qty)>0,SUM(vg.material_qty),0) AS qty
FROM
`sch_base_point` p
LEFT JOIN sch_base_vehiclematerialgroup vg ON vg.vehicle_code = p.vehicle_code
AND vg.vehicle_type = p.vehicle_type
AND vg.group_bind_material_status = '2'
WHERE
p.region_code = 'GTPHC'
AND p.point_status = '3'
AND p.vehicle_code IS NOT NULL
AND p.vehicle_code != ''
AND vg.group_id IS NOT NULL
AND vg.material_id = #{materialId}
</select>
</mapper>

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

@ -129,4 +129,9 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
return selectOne;
}
@Override
public int getInventoryQtyByMaterialId(String materialId) {
return vehiclematerialgroupMapper.getInventoryQtyByMaterialId(materialId);
}
}

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java

@ -37,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -362,6 +363,10 @@ public class FJMKTask extends AbstractTask {
}
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
String requestParam = taskObj.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
String workorderCode = jsonObject.getString("workorder_code");
PdmBdWorkorder workorder = workorderService.getByCode(workorderCode);
// 获取参数
String bzxPoint = taskObj.getPoint_code2(); // 获取终点1
String fmPoint = taskObj.getPoint_code3(); // 获取起点2
@ -373,9 +378,15 @@ public class FJMKTask extends AbstractTask {
// 包装位: 解锁
PointUtils.setUpdateByType(bzxPointObj, taskFinishedType);
PointUtils.clearPoint(bzxPointObj);
// 覆膜位: 解锁 . 清空
PointUtils.setUpdateByType(fmPointObj, taskFinishedType);
PointUtils.clearPoint(fmPointObj);
if (ObjectUtil.isNotEmpty(fmPoint)) {
// 覆膜位: 解锁 . 清空
PointUtils.setUpdateByType(fmPointObj, taskFinishedType);
PointUtils.clearPoint(fmPointObj);
// 工单的真实数+1
workorder.setReal_qty(workorder.getReal_qty().add(BigDecimal.ONE));
TaskUtils.setWorkOrderUpdateByType(workorder, taskFinishedType);
workorderService.updateById(workorder);
}
// 分拣机械手: 清空
PointUtils.setUpdateByType(fjcPointObj, taskFinishedType);
PointUtils.clearPoint(fjcPointObj);

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java

@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -128,6 +129,11 @@ public class FJQKTask extends AbstractTask {
// 找起点
String requestParam = task.getRequest_param();
JSONObject extGroupData = JSONObject.parseObject(requestParam);
// 判断工单是否够
boolean enoughCallEmpty = workorderService.isEnoughCallEmpty(task.getPoint_code2());
if (!enoughCallEmpty) {
throw new BadRequestException("数量不足,不呼叫空盘");
}
SchBasePoint point = findStartPoint(startRegionStr, extGroupData);
if (ObjectUtil.isEmpty(point)) {
// 消息通知
@ -229,6 +235,10 @@ public class FJQKTask extends AbstractTask {
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
// 载具编码:前面需要根据任务判断,没有载具不能生成任务
String requestParam = taskObj.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
String workorderCode = jsonObject.getString("workorder_code");
PdmBdWorkorder workorder = workorderService.getByCode(workorderCode);
String vehicleCode = taskObj.getVehicle_code();
String vehicleType = taskObj.getVehicle_type();
String startPoint = taskObj.getPoint_code1(); // 获取终点
@ -237,7 +247,6 @@ public class FJQKTask extends AbstractTask {
SchBasePoint endPointObj = pointService.getById(endPoint);
if (ObjectUtil.isNotEmpty(startPointObj)) {
PointUtils.clearPoint(startPointObj);
// 终点设置值
// 记录库存并解锁
endPointObj.setIng_task_code("");
@ -247,6 +256,10 @@ public class FJQKTask extends AbstractTask {
endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode());
PointUtils.setUpdateByType(endPointObj, taskFinishedType);
pointService.updateById(endPointObj);
// 工单的真实数+1
workorder.setReal_qty(workorder.getReal_qty().add(BigDecimal.ONE));
TaskUtils.setWorkOrderUpdateByType(workorder, taskFinishedType);
workorderService.updateById(workorder);
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());

2
lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

@ -152,4 +152,4 @@ sa-token:
lucene:
index:
path: C:\lucene\index
path: D:\lucene\index

143
lms/nladmin-ui/src/views/wms/pdm/workerorder/ProductionOrder.vue

@ -0,0 +1,143 @@
<template>
<el-dialog
title="选择包装订单"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="FORDER_NO" label="订单号" width="160" />
<el-table-column prop="FORDER_SUBNUM" label="总数量" width="160" />
<el-table-column prop="GUADANSUM" label="包装数量" width="160" />
<el-table-column prop="FMATERIAL_NAME" label="物料名称" width="180" show-overflow-tooltip />
<el-table-column prop="FMATSPEC" label="物料规格" width="140" />
<el-table-column prop="FMATMODEL" label="物料型号" width="130px" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'ProductionOrder',
components: { rrOperation, pagination },
dicts: ['is_used'],
cruds() {
return CRUD({
title: '包装订单',
url: 'api/pdmBdWorkorder/mesOrder',
optShow: {},
query: {
material_code: null
}
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materialCode: {
type: String,
default: null
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
this.crud.query.materialId = this.materialCode
this.crud.toQuery()
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
//
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('recordMesOrder', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选订单')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('recordMesOrder', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

155
lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

@ -37,8 +37,8 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="crud.toQuery">
</el-date-picker>
@change="crud.toQuery"
/>
</el-form-item>
<el-form-item label="工单状态">
<el-select
@ -60,7 +60,7 @@
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" >
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
@ -123,8 +123,9 @@
<el-form-item label="物料规格">
<el-input v-model="form.material_spec" style="width: 240px;" disabled />
</el-form-item>
<el-form-item label="计划数量" prop="plan_qty">
<el-form-item label="计划数量" prop="plan_qty" >
<el-input-number
:disabled="form.region_code === 'FJ'"
v-model.number="form.plan_qty"
:min="0"
style="width: 240px;"
@ -154,7 +155,7 @@
placeholder="选择日期时间"
/>
</el-form-item>
<el-form-item label="实际开始时间" v-if="crud.status.edit">
<el-form-item v-if="crud.status.edit" label="实际开始时间">
<el-date-picker
v-model="form.realproducestart_date"
value-format="yyyy-MM-dd HH:mm:ss"
@ -163,7 +164,7 @@
placeholder="选择日期时间"
/>
</el-form-item>
<el-form-item label="实际结束时间" v-if="crud.status.edit">
<el-form-item v-if="crud.status.edit" label="实际结束时间">
<el-date-picker
v-model="form.realproduceend_date"
value-format="yyyy-MM-dd HH:mm:ss"
@ -216,6 +217,27 @@
<el-form-item label="设备名称">
<el-input v-model="form.point_name" style="width: 240px;" disabled />
</el-form-item>
<el-form-item v-if="form.region_code === 'FJ'" label="订单号">
<el-input
v-model="form.order_no"
:disabled="form.material_code===null"
style="width: 240px;"
@focus="getProductionOrder(form.material_id)"
/>
</el-form-item>
<el-form-item v-if="form.region_code === 'FJ'" label="客户编码">
<el-select v-model="form.custer_no" placeholder="请选择" style="width: 240px;">
<el-option
v-for="item in custerList"
:key="item.CUSTER_NO"
:label="item.CUSTER_NAME"
:value="item.CUSTER_NO"
>
<span style="float: left">{{ item.CUSTER_NO }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.CUSTER_NAME }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="静置时间(分钟)" prop="standing_time">
<el-input-number
v-model.number="form.standing_time"
@ -224,7 +246,7 @@
style="width: 240px;"
/>
</el-form-item>
<el-form-item label="实际数量" prop="real_qty" v-if="crud.status.edit">
<el-form-item v-if="crud.status.edit" label="实际数量" prop="real_qty">
<el-input-number
v-model.number="form.real_qty"
:min="0"
@ -278,7 +300,11 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="workorder_code" label="工单编号" :min-width="flexWidth('workorder_code',crud.data,'工单编号')" />
<el-table-column
prop="workorder_code"
label="工单编号"
:min-width="flexWidth('workorder_code',crud.data,'工单编号')"
/>
<el-table-column
prop="workorder_status"
label="工单状态"
@ -290,21 +316,53 @@
</el-table-column>
<el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')" />
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')" />
<!-- <el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />-->
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" />
<!-- <el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />-->
<el-table-column
prop="region_name"
label="区域名称"
:min-width="flexWidth('region_name',crud.data,'区域名称')"
/>
<el-table-column prop="point_code" label="设备编码" :min-width="flexWidth('point_code',crud.data,'设备编码')" />
<el-table-column prop="point_name" label="设备名称" :min-width="flexWidth('point_name',crud.data,'设备名称')" />
<el-table-column prop="material_code" label="成品编码" :min-width="flexWidth('material_name',crud.data,'物料标识')" />
<el-table-column prop="half_material_code" label="半成品编码" :min-width="flexWidth('half_material_code',crud.data,'半成品编码')" />
<el-table-column prop="raw_material_code" label="泥料编码" :min-width="flexWidth('raw_material_code',crud.data,'物料标识')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料标识')" />
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料标识')" />
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)">
<el-table-column
prop="material_code"
label="成品编码"
:min-width="flexWidth('material_name',crud.data,'物料标识')"
/>
<el-table-column
prop="half_material_code"
label="半成品编码"
:min-width="flexWidth('half_material_code',crud.data,'半成品编码')"
/>
<el-table-column
prop="raw_material_code"
label="泥料编码"
:min-width="flexWidth('raw_material_code',crud.data,'物料标识')"
/>
<el-table-column
prop="material_name"
label="物料名称"
:min-width="flexWidth('material_name',crud.data,'物料标识')"
/>
<el-table-column
prop="material_spec"
label="物料规格"
:min-width="flexWidth('material_spec',crud.data,'物料标识')"
/>
<el-table-column
prop="vehicle_type"
label="载具类型"
:min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)"
>
<template slot-scope="scope">
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template>
</el-table-column>
<el-table-column prop="produce_date" label="生产日期" :min-width="flexWidth('produce_date',crud.data,'生产日期')"/>
<el-table-column
prop="produce_date"
label="生产日期"
:min-width="flexWidth('produce_date',crud.data,'生产日期')"
/>
<el-table-column
prop="planproducestart_date"
label="计划开始时间"
@ -330,7 +388,11 @@
label="静置时间(分钟)"
:min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')"
/>
<el-table-column prop="is_needmove" label="是否自动搬运" :min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')">
<el-table-column
prop="is_needmove"
label="是否自动搬运"
:min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')"
>
<template slot-scope="scope">
{{ scope.row.is_needmove ? '是' : '否' }}
</template>
@ -340,17 +402,25 @@
{{ scope.row.is_urgent ? '是' : '否' }}
</template>
</el-table-column>
<!-- <el-table-column prop="workorder_type" label="工单类型" :min-width="flexWidth('workorder_type',crud.data,'工单类型')" />-->
<!-- <el-table-column prop="workorder_type" label="工单类型" :min-width="flexWidth('workorder_type',crud.data,'工单类型')" />-->
<!--<el-table-column
prop="passback_status"
label="回传MES状态"
:min-width="flexWidth('passback_status',crud.data,'回传MES状态')"
/>-->
<!-- <el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />-->
<!-- <el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />-->
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
<el-table-column
prop="create_time"
label="创建时间"
:min-width="flexWidth('create_time',crud.data,'创建时间')"
/>
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
<el-table-column
prop="update_time"
label="修改时间"
:min-width="flexWidth('update_time',crud.data,'修改时间')"
/>
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
@ -363,12 +433,13 @@
<!--分页组件-->
<pagination />
</div>
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" :flag="flag"/>
<MaterialDialog :dialog-show.sync="materialDialog" :flag="flag" @tableChanged="tableChanged" />
<ProductionOrder :dialog-show.sync="orderDialog" :material-code="materialCode" @recordMesOrder="recordMesOrder" />
</div>
</template>
<script>
import crudPdmBdWorkorder, { orderSynchronize } from './pdmBdWorkorder'
import crudPdmBdWorkorder from './pdmBdWorkorder'
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
@ -379,7 +450,7 @@ import pagination from '@crud/Pagination'
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue'
import item from '@/layout/components/Sidebar/Item.vue'
import crudMdBaseMaterial from '@/views/wms/basedata/material/mdBaseMaterial'
import ProductionOrder from '@/views/wms/pdm/workerorder/ProductionOrder.vue'
const defaultForm = {
workorder_id: null,
@ -409,12 +480,17 @@ const defaultForm = {
workshop_code: null,
ext_id: null,
is_delete: false,
is_urgent: false
is_urgent: false,
order_no: null,
custer_no: null,
pack_method: null,
order_subnum: 0,
guadansum: 0
}
export default {
name: 'PdmBdWorkorder',
dicts: ['vehicle_type', 'pdm_workorder_status'],
components: { MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
components: { ProductionOrder, MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@ -458,14 +534,18 @@ export default {
workShopList: [],
regionList: [],
pointList: [],
custerList: [],
regionCodeParam: null,
materialDialog: false,
orderDialog: false,
materialCode: null,
flag: 1
}
},
created() {
this.getWorkShopList()
this.getRegionList()
this.getCuster()
},
methods: {
item() {
@ -488,6 +568,11 @@ export default {
this.regionList = res
})
},
getCuster() { //
crudPdmBdWorkorder.getCuster().then(res => {
this.custerList = res
})
},
getPointList() { //
if (this.regionCodeParam) {
const param = {
@ -503,6 +588,10 @@ export default {
this.materialDialog = true
this.flag = flag
},
getProductionOrder(code) {
this.orderDialog = true
this.materialCode = code
},
tableChanged(row, flag) {
if (flag === 1) {
this.form.material_name = row.material_name
@ -511,12 +600,24 @@ export default {
this.form.material_code = row.material_code
this.form.half_material_code = row.half_material_code
this.form.raw_material_code = row.raw_material_code
this.form.pack_method = row.pack_method
} else {
this.form.raw_material_name = row.material_name
this.form.raw_material_id = row.material_id
this.form.raw_material_code = row.material_code
}
},
clearRecordMesOrder() {
this.form.order_no = null
this.form.order_subnum = 0
this.form.guadansum = 0
},
recordMesOrder(row) { // mes
this.clearRecordMesOrder()
this.form.order_no = row.FORDER_NO
this.form.order_subnum = row.FORDER_SUBNUM
this.form.guadansum = row.GUADANSUM
},
setRegionName(data) {
//
this.form.point_code = null

8
lms/nladmin-ui/src/views/wms/pdm/workerorder/pdmBdWorkorder.js

@ -48,5 +48,11 @@ export function queryMaterials(data) {
data
})
}
export function getCuster() {
return request({
url: 'api/pdmBdWorkorder/getCuster',
method: 'post'
})
}
export default { add, edit, del, submits, orderSynchronize, queryMaterials }
export default { add, edit, del, submits, orderSynchronize, queryMaterials, getCuster }

2
lms/nladmin-ui/src/views/wms/sch/group/MaterialDialog.vue

@ -54,7 +54,6 @@
<el-table-column prop="raw_material_code" label="泥料编码" width="160" />
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="140" />
<!-- <el-table-column prop="class_name" label="物料分类" width="140" />-->
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
<el-table-column prop="update_name" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="135" />
@ -69,7 +68,6 @@
</template>
<script>
import crudWorkOrder from '@/views/wms/pdm/workerorder/pdmBdWorkorder'
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'

Loading…
Cancel
Save