| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.PlaExcelListener; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.entity.PlaExcel; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Synchronized; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class PlaController extends BaseController { |
| | |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private PlaLogService plaLogService; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @RequestMapping(value = "/pla/list/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok("解除冻结成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matMaktxQuery/auth") |
| | | @ManagerAuth |
| | | public R queryMat(String condition) { |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("maktx", condition); |
| | | Page<Mat> page = matService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Mat mat : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", mat.getMaktx()); |
| | | map.put("value", mat.getMaktx()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * excel导入模板下载 |
| | | */ |
| | |
| | | return R.ok("成功同步"+listener.getTotal()+"条pla物料数据"); |
| | | } |
| | | |
| | | // // 打印 |
| | | // @RequestMapping(value = "/pla/print/auth") |
| | | // @ManagerAuth(memo = "pla编码打印") |
| | | // public R matCodePrint(@RequestParam(value = "param[]") String[] param) { |
| | | // if(Cools.isEmpty(param)) { |
| | | // return R.parse(CodeRes.EMPTY); |
| | | // } |
| | | // List<MatPrint> res = new ArrayList<>(); |
| | | // for (String matnr : param){ |
| | | // Mat mat = matService.selectByMatnr(matnr); |
| | | // // 打印数据注入 |
| | | // MatPrint print = new MatPrint(); |
| | | // print.setMatnr(mat.getMatnr()); |
| | | // print.setBarcode(mat.getBarcode()); |
| | | // print.setMaktx(mat.getMaktx()); |
| | | // print.setSpecs(mat.getSpecs()); |
| | | // print.setUnit(mat.getUnit()); |
| | | // print.setMemo(mat.getMemo()); |
| | | // res.add(print); |
| | | // } |
| | | // return R.ok().add(res); |
| | | // } |
| | | // 打印 |
| | | @RequestMapping(value = "/pla/print/auth") |
| | | @ManagerAuth(memo = "pla编码打印") |
| | | public R matCodePrint(@RequestBody List<Pla> plas) { |
| | | if(Cools.isEmpty(plas)) { |
| | | return R.parse(CodeRes.EMPTY); |
| | | } |
| | | List<Pla> res = new ArrayList<>(); |
| | | for (Pla pla : plas){ |
| | | res.add(pla); |
| | | } |
| | | return R.ok().add(res); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |