Browse Source

fix: 分拣叫料校验、看板更新

master
李永德 1 year ago
parent
commit
ffb6dac06d
  1. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java
  2. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml
  3. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  4. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java
  5. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java
  6. 10
      lms/nladmin-system/nlsso-server/src/test/java/org/nl/ext/TestDemo.java

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java

@ -15,6 +15,11 @@ import java.util.List;
public interface CockPitMapper {
List<PressProductHeaderVo> getPressProductHeaderList(String dayShift);
/**
* 当班生产数据
* @param dayShift
* @return
*/
List<ShiftProductionVo> getShiftProductionList(String dayShift);
List<PersonnelMonthlyProductionVo> getPersonnelMonthlyProductionList(String dayShift);

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml

@ -15,15 +15,16 @@
<select id="getShiftProductionList" resultType="org.nl.wms.cockpit.service.dao.ShiftProductionVo">
SELECT
w.point_name AS column_name,
SUM(w.qualified_qty) AS qualified_qty,
SUM(w.unqualified_qty) AS unqualified_qty,
SUM(w.plan_qty - w.qualified_qty - w.unqualified_qty) AS total_difference
SUM(IFNULL(w.qualified_qty, 0)) AS qualified_qty,
SUM(IFNULL(w.unqualified_qty, 0)) AS unqualified_qty,
SUM(IFNULL(w.plan_qty, 0) - IFNULL(w.qualified_qty, 0) - IFNULL(w.unqualified_qty, 0)) AS total_difference
FROM
`pdm_bd_workorder` w
WHERE
DATE( w.produce_date ) = CURDATE()
DATE(w.produce_date) = CURDATE()
AND w.team = #{dayShift}
GROUP BY w.point_name
GROUP BY
w.point_name;
</select>
<select id="getPersonnelMonthlyProductionList"
resultType="org.nl.wms.cockpit.service.dao.PersonnelMonthlyProductionVo">

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

@ -438,7 +438,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
*/
@Override
public ApplyTaskResponse applyLabelling(JSONObject param) {
// 木托盘号(4)##物料编码(12)##数量(2-3)##吨量(单重X数量)##生产日期(11)##客户名称##订单号(12)
// 木托盘号(4)##物料编码(12)##数量(2-3)##吨量(单重X数量)##生产日期(11)##客户名称##订单号(12)##产品名称##型号
String requestNo = param.getString("requestNo");
ApplyTaskRequest baseRequest = param.toJavaObject(ApplyTaskRequest.class);
if (baseRequest.getVehicle_code() == null) {
@ -466,7 +466,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.append(multiply).append("##")
.append(DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyy年MM月dd日")).append("##")
.append(custer.getCUSTER_NAME()).append("##")
.append(workorder.getProduction_order());
.append(workorder.getProduction_order()).append("##")
.append(baseMaterial.getMaterial_name()).append("##")
.append(baseMaterial.getMaterial_model());
return ApplyTaskResponse.responseOk(requestNo, sb.toString());
}

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

@ -120,6 +120,11 @@ public class FJQLTask extends AbstractTask {
// 找起点
String requestParam = task.getRequest_param();
JSONObject extGroupData = JSONObject.parseObject(requestParam);
// 如果工单上的真实数量达到,就不能呼叫满料过来
PdmBdWorkorder workOrder = workorderService.getByCode(extGroupData.getString("workorder_code"));
if (workOrder.getPlan_qty().equals(workOrder.getReal_qty())) {
throw new BadRequestException("工单【" + workOrder.getWorkorder_code() + "】已达数量");
}
extGroupData.put("vehicle_type", task.getVehicle_type());
SchBasePoint point = findStartPoint(startRegionStr, extGroupData);
if (ObjectUtil.isEmpty(point)) {

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java

@ -77,17 +77,17 @@ public class CommonUtils {
LocalTime currentTime = LocalTime.now();
// 设置白班和晚班的时间范围
LocalTime dayShiftStart = LocalTime.of(8, 0); // 白班开始时间:8:00 AM
LocalTime dayShiftEnd = LocalTime.of(17, 0); // 白班结束时间:5:00 PM
LocalTime nightShiftStart = LocalTime.of(17, 0); // 班开始时间:5:00 PM
LocalTime nightShiftEnd = LocalTime.of(23, 59); // 班结束时间:11:59 PM
LocalTime dayShiftEnd = LocalTime.of(15, 59); // 白班结束时间:5:00 PM
LocalTime nightShiftStart = LocalTime.of(16, 0); // 小夜班开始时间:5:00 PM
LocalTime nightShiftEnd = LocalTime.of(23, 59); // 小夜班结束时间:11:59 PM
// 检查当前时间属于哪个班次
if (currentTime.isAfter(dayShiftStart) && currentTime.isBefore(dayShiftEnd)) {
return "白班";
} else if (currentTime.isAfter(nightShiftStart) || currentTime.isBefore(dayShiftStart)) {
return "班";
} else if (currentTime.isAfter(nightShiftStart) && currentTime.isBefore(nightShiftEnd)) {
return "小夜班";
} else {
return "班";
return "大夜班";
}
}

10
lms/nladmin-system/nlsso-server/src/test/java/org/nl/ext/TestDemo.java

@ -1,6 +1,7 @@
package org.nl.ext;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.junit.jupiter.api.Test;
@ -11,6 +12,7 @@ import org.nl.wms.ext.mes.service.dao.mapper.MesRequestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -137,7 +139,13 @@ public class TestDemo {
}
@Test
void test04() {
void testData() {
System.out.println(DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyy年MM月dd日"));
}
@Test
void testAdd() {
BigDecimal realQty = new BigDecimal(15);
Integer materialQty = 12;
System.out.println(NumberUtil.add(realQty, materialQty));
}
}

Loading…
Cancel
Save