| | |
| | | import com.zy.common.entity.PlaExcel; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Synchronized; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | @Slf4j |
| | | public class PlaController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Pla> wrapper = new EntityWrapper<>(); |
| | | |
| | | if(!Cools.isEmpty(param.get("brand"))){ |
| | | wrapper.eq("brand",param.get("brand")); |
| | | param.remove("brand"); |
| | | } |
| | | |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("modify_time",false); |
| | | allLike(Pla.class, param.keySet(), wrapper, condition); |
| | |
| | | public R delete(@RequestBody List<Pla> plas) { |
| | | System.out.println(plas.toString()); |
| | | plas.forEach(pla -> { |
| | | if(!pla.getStatus().equals(GlobleParameter.PLA_STATUS_00) || pla.getStatus().equals(GlobleParameter.PLA_STATUS_0)){ |
| | | throw new CoolException("非待入库的数据无法被删除"); |
| | | if(!pla.getStatus().equals(GlobleParameter.PLA_STATUS_00) && !pla.getStatus().equals(GlobleParameter.PLA_STATUS_0) && !pla.getStatus().equals(GlobleParameter.PLA_STATUS_1)){ |
| | | throw new CoolException("已入库的数据无法被删除"); |
| | | } |
| | | Pla plaSave = plaService.selectById(pla.getId()); |
| | | pla.setModifyTime(new Date()); |
| | |
| | | pla.setModifyTime(new Date()); |
| | | pla.setWeightAnfme(0.0); |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(1,pla.getLocNo(),pla.getBatch()+","+pla.getPackageNo(),anfme,getUser().getUsername()); |
| | | SaasUtils.insertLog(1,pla.getLocNo(),pla.getBrand(),anfme,getUser().getUsername(), |
| | | null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop()); |
| | | }); |
| | | |
| | | return R.ok(); |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/statis/auth") |
| | | @ManagerAuth |
| | | public R statis(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | |
| | | Page<Pla> stockStatis = plaService.getStockStatisAll(toPage(curr, limit, param, Pla.class)); |
| | | |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | | /** |
| | | * excel导入模板下载 |
| | | */ |
| | |
| | | try { |
| | | EasyExcel.read(file.getInputStream(), PlaExcel.class, listener).sheet().doRead(); |
| | | }catch (Exception e){ |
| | | throw new CoolException("导入的数据格式错误,原因:" + e.getMessage()); |
| | | e.printStackTrace(); |
| | | int index = listener.getIndex() - 1; |
| | | throw new CoolException("导入的数据格式错误,原因:" + e.getMessage() + ",第" + index + ",数据格式不对"); |
| | | } |
| | | log.info("导入修改信息输出:" + listener.getRecordLog()); |
| | | return R.ok("成功同步"+listener.getTotal()+"条pla物料数据"); |
| | | } |
| | | |
| | |
| | | manPakOut.setMaktx(plaQty.getBrand()); |
| | | manPakOut.setLocNo(plaQty.getLocNo()); |
| | | manPakOut.setBatch(plaQty.getBatch()); |
| | | manPakOut.setBarcode(plaQty.getPackageNo()); |
| | | manPakOut.setBarcode(plaQty.getPackageNo() + ""); |
| | | manPakOut.setUuid(String.valueOf(System.currentTimeMillis())); |
| | | manPakOut.setCreateTime(new Date()); |
| | | manPakOut.setUpdateTime(new Date()); |
| | |
| | | manPakOut.setStatus(0); |
| | | manPakOut.setDocId(plaQty.getOrderDetlId()); |
| | | manPakOut.setNodeId(plaQty.getId()); |
| | | manPakOut.setCustName(plaQty.getCustomer()); |
| | | //manPakOut.setNodeId(plaQty.getOrderDetlId()); |
| | | manPakOutService.insert(manPakOut); |
| | | return R.ok(); |