| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.entity.param.PakOutDTO; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | if (Cools.isEmpty(docnum) || docnum.equals("null")) { |
| | | docnum = null; |
| | | } |
| | | Date stime = null; |
| | | Date etime = null; |
| | | if(param.get("create_time") != null){ |
| | | String[] dates = param.get("create_time").toString().split(RANGE_TIME_LINK); |
| | | stime = DateUtils.convert(dates[0]); |
| | | etime = DateUtils.convert(dates[1]); |
| | | } |
| | | |
| | | List<PakOutDTO> pakOutDTOS = manPakOutService.selectPakOut(docnum, curr, limit); |
| | | List<PakOutDTO> pakOutDTOS = manPakOutService.selectPakOut(docnum, stime, etime, curr, limit); |
| | | for (PakOutDTO pakOutDTO:pakOutDTOS){ |
| | | List<ManPakOut> manPakOuts = manPakOutService.selectList(new EntityWrapper<ManPakOut>().eq("doc_num", pakOutDTO.getDoc_num())); |
| | | for (ManPakOut manPakOut:manPakOuts){ |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | int count = manPakOutService.selectPakOutCount(docnum, curr, limit); |
| | | int count = manPakOutService.selectPakOutCount(docnum, stime, etime,curr, limit); |
| | | Page<PakOutDTO> page = new Page<>(); |
| | | // 最后按状态未出库->已出库排序 |
| | | // page.setRecords(pakOutDTOS.stream().sorted(Comparator.comparingInt(PakOutDTO::getStatus)).collect(Collectors.toList())); |
| | | page.setRecords(pakOutDTOS); |
| | | page.setTotal(count); |
| | | return R.ok(page); |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | |
| | | |
| | | |
| | | |
| | | List<PakOutDTO> selectPakOut(@Param("docnum") String docnum,@Param("curr") Integer curr,@Param("limit") Integer limit); |
| | | List<PakOutDTO> selectPakOut(@Param("docnum") String docnum,@Param("stime") Date stime, @Param("etime") Date etime, @Param("curr") Integer curr, @Param("limit") Integer limit); |
| | | |
| | | int selectPakOutCount(@Param("docnum") String docnum,@Param("curr") Integer curr,@Param("limit") Integer limit); |
| | | int selectPakOutCount(@Param("docnum") String docnum,@Param("stime") Date stime, @Param("etime") Date etime,@Param("curr") Integer curr,@Param("limit") Integer limit); |
| | | } |
| | |
| | | import com.zy.asrs.entity.ManPakOut; |
| | | import com.zy.asrs.entity.param.PakOutDTO; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface ManPakOutService extends IService<ManPakOut> { |
| | | List<PakOutDTO> selectPakOut(String docnum,Integer curr,Integer limit); |
| | | List<PakOutDTO> selectPakOut(String docnum, Date stime, Date etime, Integer curr, Integer limit); |
| | | |
| | | int selectPakOutCount(String docnum, Integer curr, Integer limit); |
| | | int selectPakOutCount(String docnum, Date stime, Date etime,Integer curr, Integer limit); |
| | | } |
| | |
| | | import com.zy.asrs.service.ManPakOutService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service("manPakOutService") |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<PakOutDTO> selectPakOut(String docnum, Integer curr, Integer limit) { |
| | | return this.baseMapper.selectPakOut(docnum,curr,limit); |
| | | public List<PakOutDTO> selectPakOut(String docnum, Date stime, Date etime, Integer curr, Integer limit) { |
| | | return this.baseMapper.selectPakOut(docnum,stime,etime,curr,limit); |
| | | } |
| | | |
| | | @Override |
| | | public int selectPakOutCount(String docnum, Integer curr, Integer limit) { |
| | | return this.baseMapper.selectPakOutCount(docnum,curr,limit); |
| | | public int selectPakOutCount(String docnum, Date stime, Date etime,Integer curr, Integer limit) { |
| | | return this.baseMapper.selectPakOutCount(docnum,stime, etime,curr,limit); |
| | | } |
| | | } |
| | |
| | | <if test="docnum != null and docnum != '' "> |
| | | and doc_num like '%' + #{docnum} + '%' |
| | | </if> |
| | | <if test="stime != null"> |
| | | and create_time >= #{stime} |
| | | </if> |
| | | <if test="etime != null"> |
| | | and create_time <= #{etime} |
| | | </if> |
| | | |
| | | |
| | | </sql> |
| | | |
| | | <select id="selectPakOut" resultType="com.zy.asrs.entity.param.PakOutDTO"> |
| | | select * from ( |
| | | SELECT ROW_NUMBER() over (order by doc_num) as row, doc_num,MAX(create_time) as create_time, cust_name as custName FROM man_pakout |
| | | SELECT status, doc_num,MAX(create_time) as create_time, cust_name as custName FROM man_pakout |
| | | where 1=1 |
| | | <include refid="selectPakOutSql"></include> |
| | | GROUP BY doc_num,cust_name |
| | | ) t where t.row BETWEEN ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit}) |
| | | ORDER BY create_time DESC |
| | | GROUP BY doc_num,cust_name,status |
| | | ) t ORDER BY status |
| | | OFFSET ((#{curr}-1)*#{limit}) ROWS |
| | | FETCH NEXT #{limit} ROWS ONLY; |
| | | |
| | | </select> |
| | | <select id="selectPakOutCount" resultType="java.lang.Integer"> |
| | | select count(1) from ( |
| | | SELECT ROW_NUMBER() over (order by doc_num) as row, doc_num,MAX(create_time) as create_time FROM man_pakout |
| | | SELECT status, doc_num,MAX(create_time) as create_time FROM man_pakout |
| | | where 1=1 |
| | | <include refid="selectPakOutSql"></include> |
| | | GROUP BY doc_num |
| | | GROUP BY doc_num,cust_name,status |
| | | ) t |
| | | </select> |
| | | </mapper> |