| | |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.OpenService; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/4/8 |
| | |
| | | |
| | | @Autowired |
| | | private OpenService openService; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @PostMapping("/order/matSync/default/v1") |
| | | @AppAuth(memo = "商品信息同步接口") |
| | |
| | | if (Cools.isEmpty(param1.getMatList())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | |
| | | for (OpenOrderPakinJDParam.DetlDto2 detlDto2:param1.getMatList()){ |
| | | Mat mat = matService.selectByMatnr(detlDto2.getMatnr()); |
| | | if (Cools.isEmpty(mat)){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("matnr", detlDto2.getMatnr()); |
| | | map.put("maktx", detlDto2.getMaktx()); |
| | | // map.put("owner", detlDto2.getOwner()); |
| | | // map.put("batch", detlDto2.getBatch()); |
| | | result.add(map); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(result) && result.size()!=0){ |
| | | return R.error("请先下发以下商品信息:").add(result); |
| | | } |
| | | |
| | | |
| | | OpenOrderPakinParam param = new OpenOrderPakinParam(param1); |
| | | openService.pakinOrderCreate(param); |
| | | return R.ok(); |
| | |
| | | return R.error("单据编号[orderNo]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param1.getFormId())) { |
| | | return R.error("单据类型[orderType]不能为空"); |
| | | return R.error("单据类型[FormId]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param1.getCreateDate())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | |
| | | for (OpenOrderPakinJDParam.DetlDto2 detlDto2:param1.getMatList()){ |
| | | Mat mat = matService.selectByMatnr(detlDto2.getMatnr()); |
| | | if (Cools.isEmpty(mat)){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("matnr", detlDto2.getMatnr()); |
| | | map.put("maktx", detlDto2.getMaktx()); |
| | | // map.put("owner", detlDto2.getOwner()); |
| | | // map.put("batch", detlDto2.getBatch()); |
| | | result.add(map); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(result) && result.size()!=0){ |
| | | return R.error("请先下发以下商品信息:").add(result); |
| | | } |
| | | OpenOrderPakoutParam param = new OpenOrderPakoutParam(param1); |
| | | |
| | | openService.pakoutOrderCreate(param); |