diff --git a/pom.xml b/pom.xml index 848f29db..4b347ed0 100644 --- a/pom.xml +++ b/pom.xml @@ -432,16 +432,16 @@ - - org.codehaus.jackson - jackson-mapper-asl - ${jackson.version} - - - org.codehaus.jackson - jackson-core-asl - ${jackson.version} - + + + + + + + + + + net.sf.json-lib json-lib @@ -947,27 +947,38 @@ springfox-swagger2 2.4.0 - - com.fasterxml.jackson.core - jackson-core - 2.5.1 - - - com.fasterxml.jackson.core - jackson-databind - 2.5.1 - - - com.fasterxml.jackson.core - jackson-annotations - 2.5.1 - + + + + + + + + + + + + + + + org.jdom jdom2 2.0.4 + + + + com.fasterxml.jackson.core + jackson-databind + 2.8.8.1 + + + + + diff --git a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java index ffa6ad19..d8bfab5e 100644 --- a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java @@ -20,6 +20,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.ConstraintViolation; import javax.validation.Validator; +import com.zzjee.wm.entity.*; import org.apache.log4j.Logger; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFClientAnchor; @@ -81,11 +82,6 @@ import com.zzjee.md.entity.MdCusEntity; import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.md.entity.MdSupEntity; import com.zzjee.md.entity.MvGoodsEntity; -import com.zzjee.wm.entity.WmImNoticeHEntity; -import com.zzjee.wm.entity.WmImNoticeIEntity; -import com.zzjee.wm.entity.WmInQmIEntity; -import com.zzjee.wm.entity.WmPlatIoEntity; -import com.zzjee.wm.entity.WmToUpGoodsEntity; import com.zzjee.wm.page.WmImNoticeHPage; import com.zzjee.wm.page.WmNoticeImpPage; import com.zzjee.wm.service.WmImNoticeHServiceI; @@ -2304,7 +2300,7 @@ public class WmImNoticeHController extends BaseController { return listWmImNoticeHs; } - @RequestMapping(value = "/{id}", method = RequestMethod.GET) + @RequestMapping(value = "/{id}", method = RequestMethod.GET ) @ResponseBody public ResponseEntity get(@PathVariable("id") String id) { WmImNoticeHEntity task = wmImNoticeHService.get( @@ -2315,21 +2311,13 @@ public class WmImNoticeHController extends BaseController { return new ResponseEntity(task, HttpStatus.OK); } - @RequestMapping(method = RequestMethod.POST, produces = "application/json;charset=UTF-8") + @RequestMapping(value = "/apicreate") @ResponseBody public ResponseEntity create( - @RequestBody WmImNoticeHPage wmImNoticeHPage, - UriComponentsBuilder uriBuilder) { + @RequestBody WmImNoticeHPage wmImNoticeHPage) { // 调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. ResultDO D0 = new ResultDO(); - Set> failures = validator - .validate(wmImNoticeHPage); - if (!failures.isEmpty()) { - return new ResponseEntity( - BeanValidators.extractPropertyAndMessage(failures), - HttpStatus.BAD_REQUEST); - } // 保存 List wmImNoticeIList = wmImNoticeHPage @@ -2337,11 +2325,25 @@ public class WmImNoticeHController extends BaseController { WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity(); try { - MyBeanUtils.copyBeanNotNull2Bean(wmImNoticeH, wmImNoticeHPage); + String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()) ; + wmImNoticeHPage.setNoticeId(noticeid); + MyBeanUtils.copyBeanNotNull2Bean(wmImNoticeHPage,wmImNoticeH); } catch (Exception e) { logger.info(e.getMessage()); } - wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIList); + + List wmOmNoticeIListnew = new ArrayList<>(); + for(WmImNoticeIEntity t: wmImNoticeIList){ + try{ + MdGoodsEntity md =systemService.findUniqueByProperty(MdGoodsEntity.class,"shpBianMa",t.getGoodsCode()); + wmImNoticeH.setCusCode(md.getSuoShuKeHu()); + }catch ( Exception e){ + + } + + wmOmNoticeIListnew.add(t); + } + wmImNoticeHService.addMain(wmImNoticeH, wmOmNoticeIListnew); D0.setOK(true); return new ResponseEntity(D0, HttpStatus.OK); diff --git a/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java index 3edd5079..5bb848a4 100644 --- a/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java @@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.ConstraintViolation; import javax.validation.Validator; +import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.tms.entity.TmsYwDingdanEntity; import com.zzjee.wm.page.*; import org.apache.commons.collections.CollectionUtils; @@ -2404,25 +2405,33 @@ public class WmOmNoticeHController extends BaseController { return new ResponseEntity(task, HttpStatus.OK); } - @RequestMapping(method = RequestMethod.POST, produces = "application/json;charset=UTF-8") - public ResponseEntity create(@RequestBody WmOmNoticeHPage wmOmNoticeHPage, UriComponentsBuilder uriBuilder) { + @RequestMapping(value = "/apicreate") + @ResponseBody + public ResponseEntity create(@RequestBody WmOmNoticeHPage wmOmNoticeHPage ) { //调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. ResultDO D0 = new ResultDO(); - Set> failures = validator.validate(wmOmNoticeHPage); - if (!failures.isEmpty()) { - return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); - } - //保存 List wmOmNoticeIList = wmOmNoticeHPage.getWmOmNoticeIList(); - + String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeHPage.getOrderTypeCode()); + wmOmNoticeHPage.setOmNoticeId(noticeid); WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity(); try{ - MyBeanUtils.copyBeanNotNull2Bean(wmOmNoticeH,wmOmNoticeHPage); + MyBeanUtils.copyBeanNotNull2Bean(wmOmNoticeHPage,wmOmNoticeH); }catch(Exception e){ logger.info(e.getMessage()); } - wmOmNoticeHService.addMain(wmOmNoticeH, wmOmNoticeIList); + List wmOmNoticeIListnew = new ArrayList<>(); + for(WmOmNoticeIEntity t: wmOmNoticeIList){ + try{ + MdGoodsEntity md =systemService.findUniqueByProperty(MdGoodsEntity.class,"shpBianMa",t.getGoodsId()); + t.setCusCode(md.getSuoShuKeHu()); + }catch ( Exception e){ + + } + + wmOmNoticeIListnew.add(t); + } + wmOmNoticeHService.addMain(wmOmNoticeH, wmOmNoticeIListnew); D0.setOK(true); //按照Restful风格约定,创建指向新任务的url, 也可以直接返回id或对象. return new ResponseEntity(D0, HttpStatus.OK); diff --git a/src/main/java/com/zzjee/wm/page/WmImNoticeHPage.java b/src/main/java/com/zzjee/wm/page/WmImNoticeHPage.java index 7c29a19d..b7f353e5 100644 --- a/src/main/java/com/zzjee/wm/page/WmImNoticeHPage.java +++ b/src/main/java/com/zzjee/wm/page/WmImNoticeHPage.java @@ -27,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.ExcelCollection; * @version V1.0 * */ -public class WmImNoticeHPage implements java.io.Serializable { +public class WmImNoticeHPage { /**主键*/ private java.lang.String id; /**创建人名称*/ @@ -59,37 +59,27 @@ public class WmImNoticeHPage implements java.io.Serializable { private java.lang.String sysCompanyCode; /**客户编码*/ - @Excel(name="客户编码") private java.lang.String cusCode; /**预计到货时间*/ - @Excel(name="预计到货时间",format = "yyyy-MM-dd") private java.util.Date imData; /**客户订单号*/ - @Excel(name="客户订单号") private java.lang.String imCusCode; /**司机*/ - @Excel(name="司机") private java.lang.String imCarDri; /**司机电话*/ - @Excel(name="司机电话") private java.lang.String imCarMobile; /**车号*/ - @Excel(name="车号") private java.lang.String imCarNo; /**订单类型*/ private java.lang.String orderTypeCode; /**月台*/ - @Excel(name="月台") private java.lang.String platformCode; /**备注*/ - @Excel(name="备注") private java.lang.String imBeizhu; /**单据状态*/ - @Excel(name="单据状态") private java.lang.String imSta; /**进货通知单号*/ - @Excel(name="进货通知单号") private java.lang.String noticeId; /**附件*/ @@ -468,8 +458,7 @@ public class WmImNoticeHPage implements java.io.Serializable { this.piMaster = piMaster; } - /**保存-预约通知项目*/ - @ExcelCollection(name="预约通知项目") + private List wmImNoticeIList = new ArrayList(); public List getWmImNoticeIList() { return wmImNoticeIList; diff --git a/src/main/java/com/zzjee/wm/page/WmOmNoticeHPage.java b/src/main/java/com/zzjee/wm/page/WmOmNoticeHPage.java index 3b387250..df054231 100644 --- a/src/main/java/com/zzjee/wm/page/WmOmNoticeHPage.java +++ b/src/main/java/com/zzjee/wm/page/WmOmNoticeHPage.java @@ -59,51 +59,36 @@ public class WmOmNoticeHPage implements java.io.Serializable { private java.lang.String sysCompanyCode; /**客户*/ - @Excel(name="客户") private java.lang.String cusCode; /**要求交货时间*/ - @Excel(name="要求交货时间",format = "yyyy-MM-dd") private java.util.Date delvData; /**收货人*/ - @Excel(name="收货人") private java.lang.String delvMember; /**收货人电话*/ - @Excel(name="收货人电话") private java.lang.String delvMobile; /**收货人地址*/ - @Excel(name="收货人地址") private java.lang.String delvAddr; /**承运人*/ - @Excel(name="承运人") private java.lang.String reMember; /**承运人电话*/ - @Excel(name="承运人电话") private java.lang.String reMobile; /**承运人车号*/ - @Excel(name="承运人车号") private java.lang.String reCarno; /**发货月台*/ - @Excel(name="发货月台") private java.lang.String omPlatNo; /**备注*/ - @Excel(name="备注") private java.lang.String omBeizhu; /**状态*/ - @Excel(name="状态") private java.lang.String omSta; /**出货单号*/ - @Excel(name="出货单号") private java.lang.String omNoticeId; /**附件*/ private java.lang.String fuJian; - @Excel(name="三方客户编号") private java.lang.String ocusCode; - @Excel(name="三方客户名称") private java.lang.String ocusName; - @Excel(name="客户订单号") private java.lang.String imCusCode; private java.lang.String printStatus; private java.lang.String piClass; @@ -515,7 +500,6 @@ public class WmOmNoticeHPage implements java.io.Serializable { } /**保存-出货通知项目*/ - @ExcelCollection(name="出货通知项目") private List wmOmNoticeIList = new ArrayList(); public List getWmOmNoticeIList() { return wmOmNoticeIList; @@ -524,16 +508,15 @@ public class WmOmNoticeHPage implements java.io.Serializable { this.wmOmNoticeIList = wmOmNoticeIList; } - /**保存-出货通知项目*/ - @ExcelCollection(name="运输项目") - private List wmOmtmsIList = new ArrayList(); - - - public List getWmOmtmsIList() { - return wmOmtmsIList; - } - - public void setWmOmtmsIList(List wmOmtmsIList) { - this.wmOmtmsIList = wmOmtmsIList; - } +// /**保存-出货通知项目*/ +// private List wmOmtmsIList = new ArrayList(); +// +// +// public List getWmOmtmsIList() { +// return wmOmtmsIList; +// } +// +// public void setWmOmtmsIList(List wmOmtmsIList) { +// this.wmOmtmsIList = wmOmtmsIList; +// } } diff --git a/src/main/resources/spring-mvc.xml b/src/main/resources/spring-mvc.xml index 52b18a0b..3db87fe8 100644 --- a/src/main/resources/spring-mvc.xml +++ b/src/main/resources/spring-mvc.xml @@ -27,6 +27,17 @@ text/html;charset=UTF-8 + text/json;charset=UTF-8 + application/json;charset=UTF-8 + + + + + + + + + text/plain;charset=UTF-8