| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private ReportQueryMapper reportQueryMapper; |
| | | |
| | | @Resource |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | |
| | | //------------------库位使用统计-------------------------------------- |
| | | @RequestMapping("/viewStockUseList.action") |
| | |
| | | //-----------------库存MAP图-------------------------------------- |
| | | @RequestMapping("/viewLocMapList/rows.action") |
| | | public R queryViewLocMapRows(){ |
| | | return R.ok().add(reportQueryMapper.getViewLocRowTotal()); |
| | | List<Integer> viewLocRowTotal = reportQueryMapper.getViewLocRowTotal(); |
| | | viewLocRowTotal.add(9); |
| | | viewLocRowTotal.add(10); |
| | | return R.ok().add(viewLocRowTotal); |
| | | } |
| | | |
| | | @RequestMapping("/viewLocMapList.action") |
| | | public R queryViewLocMapListByPages(@RequestParam(defaultValue = "1")Integer row){ |
| | | public R queryViewLocMapListByPages(@RequestParam(defaultValue = "1")Integer row) { |
| | | if (row == 9) { |
| | | // 获取排级数据 |
| | | // 表格标题:列 ===>> 升序 |
| | | // List<String> bays = new ArrayList<>(); |
| | | String[] bays = new String[33]; |
| | | for (int i = 1; i <= 32; i ++) { |
| | | bays[i] = String.valueOf(i); |
| | | } |
| | | |
| | | // !表格第一列放层级数 |
| | | bays[0] = ""; |
| | | // 表格行:层 ====>> 倒序 |
| | | List<String> levs = new ArrayList<>(); |
| | | for (int i = 5; i>= 1; i --) { |
| | | levs.add(String.valueOf(i)); |
| | | } |
| | | List<Map<String, Object>> body = new ArrayList<>(); |
| | | for (String lev : levs){ |
| | | // 获取层级数据 |
| | | // List<ViewLocMapDto> dtos = reportQueryMapper.getViewLocBays(row, Integer.parseInt(lev)); |
| | | List<ViewLocMapDto> dtos = manLocDetlMapper.getViewLocBays(String.valueOf(row), lev); |
| | | // !表格第一列放层级数 |
| | | dtos.add(0, new ViewLocMapDto(null ,null, lev)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("loc", dtos); |
| | | body.add(map); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("title", bays); |
| | | result.put("body", body); |
| | | return R.ok(result); |
| | | } else if( row == 10) { |
| | | // 获取排级数据 |
| | | // 表格标题:列 ===>> 升序 |
| | | // List<String> bays = new ArrayList<>(); |
| | | String[] bays = new String[33]; |
| | | for (int i = 1; i <= 32; i ++) { |
| | | bays[i] = String.valueOf(i); |
| | | } |
| | | |
| | | // !表格第一列放层级数 |
| | | bays[0] = ""; |
| | | // 表格行:层 ====>> 倒序 |
| | | List<String> levs = new ArrayList<>(); |
| | | for (int i = 5; i>= 1; i --) { |
| | | levs.add(String.valueOf(i)); |
| | | } |
| | | List<Map<String, Object>> body = new ArrayList<>(); |
| | | for (String lev : levs){ |
| | | // 获取层级数据 |
| | | // List<ViewLocMapDto> dtos = reportQueryMapper.getViewLocBays(row, Integer.parseInt(lev)); |
| | | List<ViewLocMapDto> dtos = manLocDetlMapper.getViewLocBays(String.valueOf(row), lev); |
| | | // !表格第一列放层级数 |
| | | dtos.add(0, new ViewLocMapDto(null ,null, lev)); |
| | | for (int i = 15;i <= 18; i ++) { |
| | | dtos.add(i,new ViewLocMapDto(null ,i, "X")); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("loc", dtos); |
| | | body.add(map); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("title", bays); |
| | | result.put("body", body); |
| | | return R.ok(result); |
| | | } else { |
| | | // 获取排级数据 |
| | | // 表格标题:列 ===>> 升序 |
| | | List<String> bays = reportQueryMapper.getViewLocBayCount(row); |
| | |
| | | result.put("title", bays); |
| | | result.put("body", body); |
| | | return R.ok(result); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | public R viewWorkCountInList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | List<ViewWorkCountInView> allCountIn = reportQueryMapper.selectWorkCountIn(Integer.valueOf((String) param.get("pageNumber")), Integer.valueOf((String) param.get("pageSize"))); |
| | | Integer total = reportQueryMapper.selectWorkCountInTotal(); |
| | | String startTime = "1970.1.2"; |
| | | String endTime = "2099.1.2"; |
| | | if (!Cools.isEmpty(param.get("query_date"))) { |
| | | String queryDate = (String) param.get("query_date"); |
| | | String[] split = queryDate.split(" - "); |
| | | startTime= split[0].split(" ")[0].replace("-","."); |
| | | endTime = split[1].split(" ")[0].replace("-","."); |
| | | } |
| | | List<ViewWorkCountInView> allCountIn = reportQueryMapper.selectWorkCountIn(Integer.valueOf((String) param.get("pageNumber")), Integer.valueOf((String) param.get("pageSize")), (String) param.get("matnr"), startTime,endTime); |
| | | Integer total = reportQueryMapper.selectWorkCountInTotal((String) param.get("matnr"), startTime,endTime); |
| | | Page<ViewWorkCountInView> page = new Page<>(); |
| | | page.setRecords(allCountIn); |
| | | page.setTotal(total); |
| | | return R.ok(page); |
| | | Integer sum = reportQueryMapper.selectWorkCountInSum((String) param.get("matnr"), startTime,endTime); |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | result.put("page",page); |
| | | result.put("sum",sum); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R viewWorkCountOutList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | List<ViewWorkCountInView> allCountIn = reportQueryMapper.selectWorkCountOut(Integer.valueOf((String) param.get("pageNumber")), Integer.valueOf((String) param.get("pageSize"))); |
| | | Integer total = reportQueryMapper.selectWorkCountOutTotal(); |
| | | String startTime = "1970.1.2"; |
| | | String endTime = "2099.1.2"; |
| | | if (!Cools.isEmpty(param.get("query_date"))) { |
| | | String queryDate = (String) param.get("query_date"); |
| | | String[] split = queryDate.split(" - "); |
| | | startTime= split[0].split(" ")[0].replace("-","."); |
| | | endTime = split[1].split(" ")[0].replace("-","."); |
| | | } |
| | | List<ViewWorkCountInView> allCountIn = reportQueryMapper.selectWorkCountOut(Integer.valueOf((String) param.get("pageNumber")), Integer.valueOf((String) param.get("pageSize")), (String) param.get("matnr"), startTime,endTime); |
| | | Integer total = reportQueryMapper.selectWorkCountOutTotal((String) param.get("matnr"), startTime,endTime); |
| | | Page<ViewWorkCountInView> page = new Page<>(); |
| | | page.setRecords(allCountIn); |
| | | page.setTotal(total); |
| | | return R.ok(page); |
| | | Integer sum = reportQueryMapper.selectWorkCountOutSum((String) param.get("matnr"), startTime,endTime); |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | result.put("page",page); |
| | | result.put("sum",sum); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | //excel导出 |