| | |
| | | import com.zy.asrs.entity.param.Review; |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.MobileServiceImpl; |
| | | import com.zy.asrs.task.handler.WorkLogHandler; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.model.LocDto; |
| | |
| | | map.put("rows",list); |
| | | return R.ok(map); |
| | | } |
| | | /** |
| | | * 晚20-第二天早8 |
| | | */ |
| | | @RequestMapping("/pack/evening/v2") |
| | | // @ManagerAuth(memo = "测试库合格数") |
| | | public R chartAxisEveningV2(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | List<AxisBean> list = new ArrayList<AxisBean>(); |
| | | |
| | | List<WorkChartAxis> listChart = mobileService.chartAxisEvening(); |
| | | |
| | | if(listChart!=null) { |
| | | ArrayList<Integer> data1 = new ArrayList<Integer>(); |
| | | ArrayList<Integer> data2 = new ArrayList<Integer>(); |
| | | |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.add(Calendar.DATE, -12); |
| | | for(int i=0;i<12;i++) { |
| | | boolean flag = true; |
| | | calendar.add(Calendar.DATE, 1); |
| | | String str = sf.format(calendar.getTime()); |
| | | for(WorkChartAxis workChart : listChart) { |
| | | if(str.equals(workChart.getYmd())) { |
| | | data1.add(workChart.getInqty()); |
| | | data2.add(workChart.getOutqty()); |
| | | flag = false; |
| | | break; |
| | | } |
| | | } |
| | | if(flag) { |
| | | data1.add(0); |
| | | data2.add(0); |
| | | } |
| | | } |
| | | AxisBean inqty = new AxisBean(); |
| | | inqty.setName("入库数量"); |
| | | Integer[] array1 = new Integer[data1.size()]; |
| | | inqty.setData(data1.toArray(array1)); |
| | | list.add(inqty); |
| | | AxisBean outqty = new AxisBean(); |
| | | outqty.setName("出库数量"); |
| | | Integer[] array2 = new Integer[data2.size()]; |
| | | outqty.setData(data2.toArray(array2)); |
| | | list.add(outqty); |
| | | } |
| | | map.put("rows",list); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | |
| | |
| | | private String total; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private int status; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String circumference; |
| | | |
| | | @ApiModelProperty(value= "") |
| | |
| | | |
| | | public PackQualified() {} |
| | | |
| | | public PackQualified(Integer qualified,Integer unqualified,String total,String circumference,Date createTime) { |
| | | public PackQualified(Integer qualified,Integer unqualified,String total,String circumference,Date createTime,int status) { |
| | | this.qualified = qualified; |
| | | this.unqualified = unqualified; |
| | | this.total = total; |
| | | this.circumference = circumference; |
| | | this.createTime = createTime; |
| | | this.status=status; |
| | | } |
| | | |
| | | // PackQualified packQualified = new PackQualified( |
| | |
| | | Integer selectCurrentQuantity(@Param("data1") Date data1,@Param("data2") Date data2); |
| | | Integer selectCurrentQuantity2(@Param("data1") Date data1,@Param("data2") Date data2); |
| | | |
| | | Integer selectTotal1(@Param("data1") Date data1,@Param("data2") Date data2); |
| | | Integer selectCurrentQuantity1(@Param("data1") Date data1,@Param("data2") Date data2); |
| | | Integer selectCurrentQuantity21(@Param("data1") Date data1,@Param("data2") Date data2); |
| | | |
| | | void insertPackQualified(@Param("now")Date now); |
| | | void insertUnPackQualified(@Param("now")Date now); |
| | | |
| | | } |
| | |
| | | @Select("select ymd,SUM(sto_qty) inqty,SUM(ret_qty) outqty from asr_sta_inout_morning_view " |
| | | + "where 1=1 group by ymd order by ymd") |
| | | public List<WorkChartAxis> getChartAxisMorning(); |
| | | |
| | | List<ViewWorkCountInView> selectWorkCountIn(@Param("curr") Integer curr, @Param("limit") Integer limit, @Param("matnr")String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | | |
| | | Integer selectWorkCountInTotal(String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | |
| | | List<LocMast> packTestBasicInformation(); |
| | | List<MobileServiceImpl.PackUsageRate> packUsageRate(); |
| | | List<MobileServiceImpl.PackUsageRate2> packQualified(); |
| | | List<WorkChartAxis> chartAxisEvening(); |
| | | List<MobileServiceImpl.PackUsageRate2> chartAxisEvening(); |
| | | List<WorkChartAxis> chartAxisMorning(); |
| | | |
| | | } |
| | |
| | | public interface PackQualifiedService extends IService<PackQualified> { |
| | | Integer selectTotal(Date data1,Date data2); |
| | | Integer selectCurrentQuantity(Boolean sign,Date data1,Date data2); |
| | | |
| | | Integer selectTotal1(Date data1,Date data2); |
| | | Integer selectCurrentQuantity1(Boolean sign,Date data1,Date data2); |
| | | |
| | | public void insertPackQualified(boolean qualified, Date now); |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Transactional |
| | | public List<PackUsageRate2> packQualified() { |
| | | Date now = new Date(); |
| | | Date date7 = Utils.timeYesterday(now); |
| | | Date date14 = Utils.timeYesterday(date7); |
| | | ArrayList<PackUsageRate2> packUsageRates = new ArrayList<>(); |
| | | |
| | | PackUsageRate2 packUsageRate = new PackUsageRate2(); |
| | | packUsageRate.setTotal(packQualifiedService.selectTotal(date7,now)); |
| | | packUsageRate.setQualified(packQualifiedService.selectCurrentQuantity(true,date7,now)); |
| | | packUsageRate.setUnqualified(packQualifiedService.selectCurrentQuantity(false,date7,now)); |
| | | packUsageRate.setWeek("本周"); |
| | | packUsageRates.add(packUsageRate); |
| | | |
| | | PackUsageRate2 packUsageRate2 = new PackUsageRate2(); |
| | | packUsageRate2.setTotal(packQualifiedService.selectTotal(date14,date7)); |
| | | packUsageRate2.setQualified(packQualifiedService.selectCurrentQuantity(true,date14,date7)); |
| | | packUsageRate2.setUnqualified(packQualifiedService.selectCurrentQuantity(false,date14,date7)); |
| | | packUsageRate2.setWeek("上周"); |
| | | packUsageRates.add(packUsageRate2); |
| | | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| | | for(int i=1;i<8;i++){ |
| | | Date date7 = Utils.timeYesterday(now,i); |
| | | PackUsageRate2 packUsageRate7 = new PackUsageRate2(); |
| | | packUsageRate7.setTotal(packQualifiedService.selectTotal(date7,now)); |
| | | packUsageRate7.setQualified(packQualifiedService.selectCurrentQuantity(true,date7,now)); |
| | | packUsageRate7.setUnqualified(packQualifiedService.selectCurrentQuantity(false,date7,now)); |
| | | String formattedDate = sdf.format(date7); |
| | | int month = Integer.parseInt(formattedDate.substring(5, 7)); |
| | | int day = Integer.parseInt(formattedDate.substring(8, 10)); |
| | | packUsageRate7.setWeek(month+"-"+day); |
| | | packUsageRates.add(packUsageRate7); |
| | | now=date7; |
| | | } |
| | | |
| | | return packUsageRates; |
| | | } |
| | |
| | | * */ |
| | | @Override |
| | | @Transactional |
| | | public List<WorkChartAxis> chartAxisEvening() { |
| | | return reportQueryMapper.getChartAxisEvening(); |
| | | public List<PackUsageRate2> chartAxisEvening() { |
| | | Date now = new Date(); |
| | | ArrayList<PackUsageRate2> packUsageRates = new ArrayList<>(); |
| | | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| | | for(int i=1;i<13;i++){ |
| | | Date date7 = Utils.timeYesterday1(now,i); |
| | | PackUsageRate2 packUsageRate7 = new PackUsageRate2(); |
| | | packUsageRate7.setTotal(packQualifiedService.selectTotal1(date7,now)); |
| | | packUsageRate7.setQualified(packQualifiedService.selectCurrentQuantity1(true,date7,now)); |
| | | packUsageRate7.setUnqualified(packQualifiedService.selectCurrentQuantity1(false,date7,now)); |
| | | String formattedDate = sdf.format(date7); |
| | | int hour= date7.getHours(); |
| | | packUsageRate7.setWeek(hour+""); |
| | | packUsageRates.add(packUsageRate7); |
| | | now=date7; |
| | | } |
| | | return packUsageRates; |
| | | } |
| | | |
| | | /* |
| | |
| | | return this.baseMapper.selectCurrentQuantity2(data1,data2); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectTotal1(Date data1, Date data2){ |
| | | return this.baseMapper.selectTotal1(data1,data2); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCurrentQuantity1(Boolean sign,Date data1,Date data2){ |
| | | if (sign){ |
| | | return this.baseMapper.selectCurrentQuantity1(data1,data2); |
| | | } |
| | | return this.baseMapper.selectCurrentQuantity21(data1,data2); |
| | | } |
| | | |
| | | @Override |
| | | public void insertPackQualified(boolean qualified, Date now){ |
| | | if (qualified){ |
| | | this.baseMapper.insertPackQualified(now); |
| | | } |
| | | this.baseMapper.insertUnPackQualified(now); |
| | | |
| | | }; |
| | | |
| | | } |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | |
| | | |
| | | @Value("${mes.inPath}") |
| | | private String inpath; |
| | | |
| | | @Autowired |
| | | private PackQualifiedService packQualifiedService; |
| | | @Autowired |
| | | private ReportQueryMapper reportQueryMapper; |
| | | |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | // 4.入库完成 |
| | |
| | | throw new CoolException("更改测试状态失败"); |
| | | } |
| | | } |
| | | //入库标记 |
| | | packQualifiedService.insertPackQualified(true,new Date()); |
| | | //2.入库完成上报 |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(wrkDetls.get(0).getMatnr()); |
| | |
| | | //测试库位转静置库位和NG库位 |
| | | if (locMast.getLocType1().equals((short)4)){ |
| | | locMast.setPackStatus(4); //4:NG |
| | | //入库标记 |
| | | packQualifiedService.insertPackQualified(true,new Date()); |
| | | //出库标记 |
| | | packQualifiedService.insertPackQualified(false,new Date()); |
| | | }else { |
| | | locMast.setPackStatus(5); //5:静置中 |
| | | //入库标记 |
| | | packQualifiedService.insertPackQualified(true,new Date()); |
| | | //出库标记 |
| | | packQualifiedService.insertPackQualified(false,new Date()); |
| | | } |
| | | sign=true; |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全板出库 ===>> 修改源库位状态失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); |
| | | }else{ |
| | | //出库标记 |
| | | packQualifiedService.insertPackQualified(false,new Date()); |
| | | //2.出库完成上报 |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(wrkDetls101.get(0).getMatnr()); |
| | |
| | | } |
| | | |
| | | //获取前一周的日期(日期天数减7) |
| | | public static Date timeYesterday(Date date){ |
| | | public static Date timeYesterday(Date date,int i){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.add(Calendar.DAY_OF_MONTH, -7); |
| | | calendar.add(Calendar.DAY_OF_MONTH, -1); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | //获取12小时内的入出库统计 |
| | | public static Date timeYesterday1(Date date,int i){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.add(Calendar.HOUR_OF_DAY, -1); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // SlaveProperties slaveProperties = new SlaveProperties(); |
| | |
| | | // Integer deepRow = getDeepRow(slaveProperties, 6); |
| | | // System.out.println(deepRow); |
| | | |
| | | Date date = new Date(); |
| | | System.out.println(date); |
| | | Date date1 = timeYesterday(date); |
| | | System.out.println(date1); |
| | | |
| | | } |
| | | } |
| | |
| | | <result column="total" property="total" /> |
| | | <result column="circumference" property="circumference" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="status" property="status" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | select count (1) from man_pack_qualified where 1=1 |
| | | and create_time >= #{data1} |
| | | and create_time <= #{data2} |
| | | and status=1 |
| | | </select> |
| | | |
| | | <select id="selectCurrentQuantity" resultType="java.lang.Integer"> |
| | |
| | | and create_time >= #{data1} |
| | | and create_time <= #{data2} |
| | | and qualified = 1 |
| | | and status=1 |
| | | </select> |
| | | |
| | | <select id="selectCurrentQuantity2" resultType="java.lang.Integer"> |
| | |
| | | and create_time >= #{data1} |
| | | and create_time <= #{data2} |
| | | and unqualified = 1 |
| | | and status=1 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectTotal1" resultType="java.lang.Integer"> |
| | | select count (1) from man_pack_qualified where 1=1 |
| | | and create_time >= #{data1} |
| | | and create_time <= #{data2} |
| | | and status=2 |
| | | </select> |
| | | |
| | | <select id="selectCurrentQuantity1" resultType="java.lang.Integer"> |
| | | select count (1) from man_pack_qualified where 1=1 |
| | | and create_time >= #{data1} |
| | | and create_time <= #{data2} |
| | | and qualified = 1 |
| | | and status=2 |
| | | </select> |
| | | |
| | | <select id="selectCurrentQuantity21" resultType="java.lang.Integer"> |
| | | select count (1) from man_pack_qualified where 1=1 |
| | | and create_time >= #{data1} |
| | | and create_time <= #{data2} |
| | | and unqualified = 1 |
| | | and status=2 |
| | | </select> |
| | | |
| | | <insert id="insertPackQualified"> |
| | | insert into man_pack_qualified(qualified,unqualified,create_time,status) |
| | | values(1,0,#{now},2) |
| | | </insert> |
| | | |
| | | <insert id="insertUnPackQualified"> |
| | | insert into man_pack_qualified(qualified,unqualified,create_time,status) |
| | | values(0,1,#{now},2) |
| | | </insert> |
| | | </mapper> |