| | |
| | | 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.service.MobileService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.third.CodeDataParam; |
| | | import com.zy.asrs.third.CodeParam; |
| | | import com.zy.asrs.third.TokenUtils; |
| | | import com.zy.asrs.utils.MatExcelListener; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | import com.zy.common.utils.QrCode; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Autowired |
| | | private MobileService mobileService; |
| | | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @Value("mes.url") |
| | | private String url; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | | public R autoMatnr(){ |
| | |
| | | return R.ok(matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/tiaoma/auth") |
| | | @ManagerAuth |
| | | public R findByTiaoMa(@RequestParam("matnr") String matnr, @RequestParam(required = false, value = "orderNo") String orderNo) { |
| | | List<CodeDataParam> data = mobileService.getData(TokenUtils.getToken(url), new CodeParam(Arrays.asList(matnr))); |
| | | if (data == null || data.isEmpty()) { |
| | | return R.error("条码不存在"); |
| | | } |
| | | CodeDataParam codeDataParam = data.get(0); |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", orderNo).eq("matnr", codeDataParam.getProductionCode())); |
| | | if (orderDetls.isEmpty()) { |
| | | return R.error("该商品不存在在单据中"); |
| | | } |
| | | } |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", codeDataParam.getProductionCode())); |
| | | mat.setMatnr(codeDataParam.getProductionCode()); |
| | | mat.setSafeQty(codeDataParam.getQty()); |
| | | mat.setUnit(codeDataParam.getBatchNum()); |
| | | mat.setMemo(matnr); |
| | | return R.ok(mat); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |