فهرست منبع

Merge remote-tracking branch 'origin/master'

ezhizao\ezhizao_zx 1 سال پیش
والد
کامیت
2207d83551

+ 10 - 5
src/main/java/cn/ezhizao/project/business/product/controller/BizProcessInspecionController.java

@@ -407,7 +407,7 @@ public class BizProcessInspecionController extends BaseController {
 
     private boolean checkOutsourceDayworkItem(Long outsourceOrderDetailId) {
         // 检测外协序检后是否已经周转到下一工序。
-        BizDayworkItem bizDayworkItem = bizDayworkItemService.query().eq("outsource_detail_id", outsourceOrderDetailId).orderByDesc("process_step_number").one();
+        BizDayworkItem bizDayworkItem = bizDayworkItemService.query().eq("outsource_detail_id", outsourceOrderDetailId).orderByDesc("process_step_number").last("limit 1").one();
         BizDaywork bizDaywork = bizDayworkService.getById(bizDayworkItem.getDayworkId());
         List<BizDayworkItem> items = bizDayworkItemService.query().eq("daywork_id", bizDayworkItem.getDayworkId()).list();
         // 下序已经报工
@@ -436,6 +436,7 @@ public class BizProcessInspecionController extends BaseController {
         processInspecion.setDayworkItemId(dayworkItem.getId());
         processInspecion.setProductionPlanDetailId(daywork.getProductionPlanDetailId());
         processInspecion.setProductionPlanDetailSubDetailId(daywork.getProductionPlanDetailSubDetailId());
+        processInspecion.setProductDescription(processInspecion.getLot().getProductDescription());
         processInspecion.setLotId(processInspecion.getLot().getId());
         processInspecion.setLotCode(processInspecion.getLot().getLotCode());
         processInspecion.setDeptId(daywork.getDeptId());
@@ -608,6 +609,7 @@ public class BizProcessInspecionController extends BaseController {
         }
 
         Map<String, Object> map = new HashMap<>();
+        dayworkCarrier.setIsChanged(0);
         List<BizDayworkCarrier> list = bizDayworkCarrierService.getList(dayworkCarrier);
         List<BizDaywork> dayworks = bizDayworkService.query().in("id", list.isEmpty() ? Collections.singletonList(0L) : list.stream().map(BizDayworkCarrier::getDayworkId).collect(Collectors.toList())).list();
         if (carrier.getIsInspection().equals(1)) {
@@ -656,12 +658,15 @@ public class BizProcessInspecionController extends BaseController {
             throw new RuntimeException("该批次不是外协回收批次");
         }
 
-        detailList = detailList.stream()
-                .filter(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())))
-                .collect(Collectors.toList());
-        if (detailList.size() == 0) {
+        if (detailList.stream().noneMatch(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())))) {
             throw new RuntimeException("该批次不需要外协检查");
         }
+        if (detailList.stream().noneMatch(detail -> detail.getIsAudit().equals(1) && detail.getStatus().equals(1))) {
+            throw new RuntimeException("该批次需要审核通过后才能外协检查");
+        }
+        detailList = detailList.stream()
+                .filter(detail -> processCodes.stream().anyMatch(l -> l.trim().equals(detail.getProcessCode())) && detail.getIsAudit().equals(1) && detail.getStatus().equals(1))
+                .collect(Collectors.toList());
         //如果有多道工序,则根据工序的排序找到最后一条
         if (detailList.size() > 1) {
             //按照工序排序

+ 4 - 0
src/main/java/cn/ezhizao/project/business/product/domain/BizReturnReceiptDetail.java

@@ -140,5 +140,9 @@ public class BizReturnReceiptDetail extends BaseEntity
     private String processAlias;
     private String processStepNumber;
     private String processCode;
+    @ApiModelProperty("是否审核")
+    private Integer status;
+    @ApiModelProperty("是否确认")
+    private Integer isAudit;
 
 }

+ 1 - 1
src/main/resources/mybatis/business/product/BizDayworkItemMapper.xml

@@ -68,7 +68,7 @@
         select GROUP_CONCAT(code SEPARATOR '、') as carrierName
         from biz_carrier
         where id in
-              (select carrier_id from biz_daywork_carrier where deleted = 0 and is_changed = 0 and daywork_id = #{id})
+              (select carrier_id from biz_daywork_carrier where deleted = 0 and is_changed = 0 and daywork_id = #{id} and process_inspection_id = 0)
     </select>
 
     <select id="getProductionQuantity" resultType="java.lang.Integer">

+ 6 - 3
src/main/resources/mybatis/business/product/BizProcessInspecionMapper.xml

@@ -41,9 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="startTimeString != null and startTimeString!=''">AND start_time &gt;= #{startTimeString}</if>
             <if test="endTimeString != null and endTimeString!='' ">AND start_time &lt;= #{endTimeString}</if>
             <if test="status != null ">AND status = #{status}</if>
-            <if test="keyword != null  and keyword != '' ">AND (lot_code LIKE CONCAT('%',#{keyword},'%') OR carrier_code
-                LIKE CONCAT('%',#{keyword},'%') OR
-                product_description LIKE CONCAT('%',#{keyword},'%'))
+            <if test="keyword != null  and keyword != '' ">
+                AND (lot_code LIKE CONCAT('%',#{keyword},'%') OR
+                carrier_code LIKE CONCAT('%',#{keyword},'%') OR
+                product_description LIKE CONCAT('%',#{keyword},'%') or
+                inspection_carrier_code like CONCAT('%',#{keyword},'%')
+                )
             </if>
         </trim>
         order by ( case when status = 0 then 3 else status end) desc, create_time asc

+ 2 - 0
src/main/resources/mybatis/business/product/BizReturnReceiptDetailMapper.xml

@@ -26,6 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="newCarrier != null  and newCarrier != ''"> AND new_carrier = #{newCarrier}</if>
             <if test="newCarrierCount != null "> AND new_carrier_count = #{newCarrierCount}</if>
             <if test="dayworkId != null "> AND daywork_id = #{dayworkId}</if>
+            <if test="status != null "> AND status = #{status}</if>
+            <if test="isAudit != null "> AND is_audit = #{isAudit}</if>
         </trim>
     </select>
     <select id="getFinishedReturnList" parameterType="BizReturnReceiptDetail" resultMap="BizReturnReceiptDetailResult">