zhouzh 3 anos atrás
pai
commit
21ee5a5198

+ 10 - 0
src/main/java/com/steerinfo/dil/controller/WmsInboundResultController.java

@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
@@ -707,6 +708,7 @@ public class WmsInboundResultController extends BaseRESTfulController {
         return wmsInboundResultServiceImpl.changeReserved(mapList);
     }
 
+<<<<<<< HEAD
 
   //勾选撤销入库
   @PostMapping("/undoInbound")
@@ -715,5 +717,13 @@ public class WmsInboundResultController extends BaseRESTfulController {
         int result = wmsInboundResultServiceImpl.undoInbound(inboundId);
         return success(result);
   }
+=======
+    @ApiOperation(value="获取已经下发的每个炉号的数量")
+    @PostMapping("/getFurnaceNoAmount")
+    public RESTfulResult getFurnaceNoAmount(@RequestBody(required = false) Map<String,Object>map) throws ParseException {
+        List<Map<String,Object>> mapList = wmsInboundResultServiceImpl.getFurnaceNoAmount(map);
+        return success(mapList);
+    }
+>>>>>>> 6aeaabd84833916e29cbd1fa3c6cd6ca0e9b8c51
 }
 

+ 5 - 0
src/main/java/com/steerinfo/dil/mapper/WmspInboundResultMapper.java

@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -70,6 +71,7 @@ public interface WmspInboundResultMapper extends IBaseMapper<WmspInboundResult,
 
     List<Map<String, Object>> getWmsInboundResultStatistics(Map<String, Object> mapValue);
 
+<<<<<<< HEAD
     int  deleteInboundScanByInboudId(BigDecimal inboundId);
 
     int deleteInboundByInboudId(BigDecimal inboundId);
@@ -77,4 +79,7 @@ public interface WmspInboundResultMapper extends IBaseMapper<WmspInboundResult,
     int deleteGridMaterialByInboudId(BigDecimal inboundId);
 
     int deleteMaterialSteelByInboundId(BigDecimal inboundId);
+=======
+    List<Map<String, Object>> getFurnaceNoAmount(String startDate, String endDate);
+>>>>>>> 6aeaabd84833916e29cbd1fa3c6cd6ca0e9b8c51
 }

+ 6 - 0
src/main/java/com/steerinfo/dil/service/IWmsInboundResultService.java

@@ -4,6 +4,7 @@ import com.steerinfo.dil.model.WmspInboundResult;
 import com.steerinfo.framework.controller.RESTfulResult;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.util.List;
 import java.util.Map;
 
@@ -80,6 +81,11 @@ public interface IWmsInboundResultService {
     int changeReserved(List<Map<String, Object>> mapList);
 //    根据仓库id获取对应的统计信息
     List<Map<String, Object>> getWmsInboundResultStatistics(Map<String, Object> mapValue,Integer warehouseId);
+<<<<<<< HEAD
 
     int undoInbound(BigDecimal inboundId);
+=======
+//    获取根据仓库id获取当前下的每个炉号的数量
+    List<Map<String, Object>> getFurnaceNoAmount(Map<String, Object> map) throws ParseException;
+>>>>>>> 6aeaabd84833916e29cbd1fa3c6cd6ca0e9b8c51
 }

+ 53 - 0
src/main/java/com/steerinfo/dil/service/impl/WmsInboundResultServiceImpl.java

@@ -11,6 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -267,6 +270,7 @@ public class WmsInboundResultServiceImpl implements IWmsInboundResultService {
     }
 
     @Override
+<<<<<<< HEAD
     public int undoInbound(BigDecimal inboundId) {
         //根据前端传过来的inboundId
         //对实时库存表进行删除
@@ -279,5 +283,54 @@ public class WmsInboundResultServiceImpl implements IWmsInboundResultService {
         wmspInboundResultMapper.deleteInboundByInboudId(inboundId);
 
         return 0;
+=======
+    public List<Map<String, Object>> getFurnaceNoAmount(Map<String, Object> map) throws ParseException {
+        SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        获取当前时间
+        Date date = new Date();
+//        根据当前时间区分当前班次
+//        获取当前时间的所属日期
+        String nowDay = format1.format(date);
+//        获取前一天的时间所属日期
+        Calendar calendar = Calendar.getInstance();
+        Calendar calendar2 = Calendar.getInstance();
+        calendar.add(Calendar.DAY_OF_MONTH,-1);
+        String forwardDay = format1.format(calendar.getTime());
+        calendar2.add(Calendar.DAY_OF_MONTH,1);
+        String afterDay = format1.format(calendar2.getTime());
+//        创建晚班时间(前一天的晚上23:45到当天的早上7:45)
+        String nightTime = forwardDay+" 23:45:00";
+        String nightTime2 = nowDay+" 23:45:00";
+//        创建早班时间(当天的早上7:45到当前下午的15:45)
+        String morningTime = nowDay+" 07:45:00";
+//        创建后一天的早班时间
+        String morningTime2 = afterDay+" 07:45:00";
+//        创建中班时间(当天下午的15:45到晚上的23:45)
+        String nonTime = nowDay+" 15:45:00";
+//        创建开始时间和结束时间
+        String startDate = null;
+        String endDate = null;
+//        对时间进行比较
+        if (date.compareTo(format2.parse(nightTime))>0&&date.compareTo(format2.parse(morningTime))<0){
+//            当前时间是属于当天的晚班时间
+            startDate = nightTime;
+            endDate = morningTime;
+        }else if (date.compareTo(format2.parse(morningTime))>0&&date.compareTo(format2.parse(nonTime))<0){
+//            当前时间是属于当天的早班时间
+            startDate = morningTime;
+            endDate = nonTime;
+        }else if (date.compareTo(format2.parse(nonTime))>0&&date.compareTo(format2.parse(nightTime2))<0){
+//            当前时间是属于当天的中班时间
+            startDate = nonTime;
+            endDate = nightTime2;
+        }else{
+//            当前时间是属于明天的晚班时间
+            startDate = nightTime2;
+            endDate = morningTime2;
+        }
+
+        return wmspInboundResultMapper.getFurnaceNoAmount(startDate,endDate);
+>>>>>>> 6aeaabd84833916e29cbd1fa3c6cd6ca0e9b8c51
     }
 }

+ 14 - 0
src/main/resources/com/steerinfo/dil/mapper/WmspInboundResultMapper.xml

@@ -1650,6 +1650,20 @@
 <!--        </where>-->
         <include refid="orderBy"></include>
     </select>
+    <select id="getFurnaceNoAmount" resultType="java.util.Map">
+        SELECT
+            count(RMS.MATERIAL_FURNACE_NUMBER) "count",
+            RMS.MATERIAL_FURNACE_NUMBER "furnaceNumber"
+        FROM WMSP_INBOUND_RESULT WIR
+                 LEFT JOIN RMS_MATERIAL_STEEL RMS
+                           On RMS.MATERIAL_STEEL_ID = WIR.MATERIAL_ID
+        WHERE WIR.PERSONNEL_WORKSHOPID =2
+        <if test="startDate != null">
+            AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= WIR.INBOUND_TIME
+            AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR.INBOUND_TIME
+        </if>
+        GROUP BY RMS.MATERIAL_FURNACE_NUMBER
+    </select>
 
     <delete id="deleteInboundScanByInboudId" parameterType="java.math.BigDecimal">
        delete from WMSP_INBOUND_SCAN_RESULT wisr