| | |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatPrint; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.utils.MatExcelListener; |
| | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | return R.ok(matService.getMatTurnPage(toPage(curr, limit, param, Mat.class))); |
| | | } |
| | | |
| | | @RequestMapping("/mat/turn/over/out/start") |
| | | @ManagerAuth(memo = "品号移交") |
| | | public R turnOverOutStart(@RequestBody EmptyPlateOutParam param) { |
| | | |
| | | return R.ok("品号移交成功"); |
| | | } |
| | | |
| | | @RequestMapping("/mat/turn/over/take/site") |
| | |
| | | return R.ok().add(valueVos); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/list/pda/page/auth") |
| | | @ManagerAuth |
| | | public R pdaPageList(@RequestParam(required = true)Long tagId, |
| | | @RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit){ |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("tag_id", tagId); |
| | | wrapper.orderBy("create_time", false); |
| | | return R.ok().add(matService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/split") |
| | | @ManagerAuth(memo = "解析物料码") |
| | | public R split(@RequestParam("matnr") String matnr) { |
| | | if (Cools.isEmpty(matnr)) { |
| | | return R.error("数据为空"); |
| | | } |
| | | String[] split = matnr.split(","); |
| | | if (split.length != 8) { |
| | | return R.error("数据错误"); |
| | | } |
| | | // Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", split[0])); |
| | | // if (Cools.isEmpty(mat)){ |
| | | // return R.error("未查询到物料信息,"+split[0]); |
| | | // } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (split[0].equals("00000000")) { |
| | | // 原材料码解析规则 |
| | | map.put("matnr", split[0]); |
| | | map.put("batch", split[1]); |
| | | map.put("specs", split[2]); |
| | | map.put("manuDate", split[3]); |
| | | map.put("model", split[4]); |
| | | String[] split1 = split[5].split("\\*"); |
| | | double a = Double.parseDouble(split1[0]); // 厚度 |
| | | double b = Double.parseDouble(split1[1]); // 宽幅 |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | map.put("weight", df.format(b)); |
| | | map.put("length", split[6]); |
| | | map.put("volume", df.format(a * b)); |
| | | } else { |
| | | // 半成品码解析规则 |
| | | map.put("matnr", split[0]); |
| | | map.put("batch", split[1]); |
| | | map.put("specs", split[2].substring(0, split[2].length() - 1)); |
| | | map.put("manuDate", split[3]); |
| | | map.put("model", split[4].substring(0, split[4].length() - 1)); |
| | | map.put("weight", split[5].substring(0, split[5].length() - 2)); |
| | | map.put("length", split[6]); |
| | | map.put("volume", split[7]); |
| | | } |
| | | |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | //0205040001,K44132-09-0724,PE@,20240724,HD-233L@,70@@,2816,53908.56626 80000001 |
| | | } |