master
e 2019-08-19 11:35:03 +08:00
parent 3e0641b89e
commit 6347094e13
6 changed files with 99 additions and 94 deletions

61
pom.xml
View File

@ -432,16 +432,16 @@
<!-- 工具包 --> <!-- 工具包 -->
<!-- JSON begin --> <!-- JSON begin -->
<dependency> <!--<dependency>-->
<groupId>org.codehaus.jackson</groupId> <!--<groupId>org.codehaus.jackson</groupId>-->
<artifactId>jackson-mapper-asl</artifactId> <!--<artifactId>jackson-mapper-asl</artifactId>-->
<version>${jackson.version}</version> <!--<version>${jackson.version}</version>-->
</dependency> <!--</dependency>-->
<dependency> <!--<dependency>-->
<groupId>org.codehaus.jackson</groupId> <!--<groupId>org.codehaus.jackson</groupId>-->
<artifactId>jackson-core-asl</artifactId> <!--<artifactId>jackson-core-asl</artifactId>-->
<version>${jackson.version}</version> <!--<version>${jackson.version}</version>-->
</dependency> <!--</dependency>-->
<dependency> <dependency>
<groupId>net.sf.json-lib</groupId> <groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId> <artifactId>json-lib</artifactId>
@ -947,27 +947,38 @@
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>2.4.0</version> <version>2.4.0</version>
</dependency> </dependency>
<dependency> <!--<dependency>-->
<groupId>com.fasterxml.jackson.core</groupId> <!--<groupId>com.fasterxml.jackson.core</groupId>-->
<artifactId>jackson-core</artifactId> <!--<artifactId>jackson-core</artifactId>-->
<version>2.5.1</version> <!--<version>2.5.1</version>-->
</dependency> <!--</dependency>-->
<dependency> <!--<dependency>-->
<groupId>com.fasterxml.jackson.core</groupId> <!--<groupId>com.fasterxml.jackson.core</groupId>-->
<artifactId>jackson-databind</artifactId> <!--<artifactId>jackson-databind</artifactId>-->
<version>2.5.1</version> <!--<version>2.5.1</version>-->
</dependency> <!--</dependency>-->
<dependency> <!--<dependency>-->
<groupId>com.fasterxml.jackson.core</groupId> <!--<groupId>com.fasterxml.jackson.core</groupId>-->
<artifactId>jackson-annotations</artifactId> <!--<artifactId>jackson-annotations</artifactId>-->
<version>2.5.1</version> <!--<version>2.5.1</version>-->
</dependency> <!--</dependency>-->
<!-- swagger end --> <!-- swagger end -->
<dependency> <dependency>
<groupId>org.jdom</groupId> <groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId> <artifactId>jdom2</artifactId>
<version>2.0.4</version> <version>2.0.4</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.8.1</version>
</dependency>
</dependencies> </dependencies>
<organization> <organization>

View File

@ -20,6 +20,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validator; import javax.validation.Validator;
import com.zzjee.wm.entity.*;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor; 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.MdGoodsEntity;
import com.zzjee.md.entity.MdSupEntity; import com.zzjee.md.entity.MdSupEntity;
import com.zzjee.md.entity.MvGoodsEntity; 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.WmImNoticeHPage;
import com.zzjee.wm.page.WmNoticeImpPage; import com.zzjee.wm.page.WmNoticeImpPage;
import com.zzjee.wm.service.WmImNoticeHServiceI; import com.zzjee.wm.service.WmImNoticeHServiceI;
@ -2304,7 +2300,7 @@ public class WmImNoticeHController extends BaseController {
return listWmImNoticeHs; return listWmImNoticeHs;
} }
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET )
@ResponseBody @ResponseBody
public ResponseEntity<?> get(@PathVariable("id") String id) { public ResponseEntity<?> get(@PathVariable("id") String id) {
WmImNoticeHEntity task = wmImNoticeHService.get( WmImNoticeHEntity task = wmImNoticeHService.get(
@ -2315,21 +2311,13 @@ public class WmImNoticeHController extends BaseController {
return new ResponseEntity(task, HttpStatus.OK); return new ResponseEntity(task, HttpStatus.OK);
} }
@RequestMapping(method = RequestMethod.POST, produces = "application/json;charset=UTF-8") @RequestMapping(value = "/apicreate")
@ResponseBody @ResponseBody
public ResponseEntity<?> create( public ResponseEntity<?> create(
@RequestBody WmImNoticeHPage wmImNoticeHPage, @RequestBody WmImNoticeHPage wmImNoticeHPage) {
UriComponentsBuilder uriBuilder) {
// 调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息. // 调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
ResultDO D0 = new ResultDO(); ResultDO D0 = new ResultDO();
Set<ConstraintViolation<WmImNoticeHPage>> failures = validator
.validate(wmImNoticeHPage);
if (!failures.isEmpty()) {
return new ResponseEntity(
BeanValidators.extractPropertyAndMessage(failures),
HttpStatus.BAD_REQUEST);
}
// 保存 // 保存
List<WmImNoticeIEntity> wmImNoticeIList = wmImNoticeHPage List<WmImNoticeIEntity> wmImNoticeIList = wmImNoticeHPage
@ -2337,11 +2325,25 @@ public class WmImNoticeHController extends BaseController {
WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity(); WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity();
try { try {
MyBeanUtils.copyBeanNotNull2Bean(wmImNoticeH, wmImNoticeHPage); String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()) ;
wmImNoticeHPage.setNoticeId(noticeid);
MyBeanUtils.copyBeanNotNull2Bean(wmImNoticeHPage,wmImNoticeH);
} catch (Exception e) { } catch (Exception e) {
logger.info(e.getMessage()); logger.info(e.getMessage());
} }
wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIList);
List<WmImNoticeIEntity> 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); D0.setOK(true);
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);

View File

@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validator; import javax.validation.Validator;
import com.zzjee.md.entity.MdGoodsEntity;
import com.zzjee.tms.entity.TmsYwDingdanEntity; import com.zzjee.tms.entity.TmsYwDingdanEntity;
import com.zzjee.wm.page.*; import com.zzjee.wm.page.*;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
@ -2404,25 +2405,33 @@ public class WmOmNoticeHController extends BaseController {
return new ResponseEntity(task, HttpStatus.OK); return new ResponseEntity(task, HttpStatus.OK);
} }
@RequestMapping(method = RequestMethod.POST, produces = "application/json;charset=UTF-8") @RequestMapping(value = "/apicreate")
public ResponseEntity<?> create(@RequestBody WmOmNoticeHPage wmOmNoticeHPage, UriComponentsBuilder uriBuilder) { @ResponseBody
public ResponseEntity<?> create(@RequestBody WmOmNoticeHPage wmOmNoticeHPage ) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息. //调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
ResultDO D0 = new ResultDO(); ResultDO D0 = new ResultDO();
Set<ConstraintViolation<WmOmNoticeHPage>> failures = validator.validate(wmOmNoticeHPage);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存 //保存
List<WmOmNoticeIEntity> wmOmNoticeIList = wmOmNoticeHPage.getWmOmNoticeIList(); List<WmOmNoticeIEntity> wmOmNoticeIList = wmOmNoticeHPage.getWmOmNoticeIList();
String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeHPage.getOrderTypeCode());
wmOmNoticeHPage.setOmNoticeId(noticeid);
WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity(); WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity();
try{ try{
MyBeanUtils.copyBeanNotNull2Bean(wmOmNoticeH,wmOmNoticeHPage); MyBeanUtils.copyBeanNotNull2Bean(wmOmNoticeHPage,wmOmNoticeH);
}catch(Exception e){ }catch(Exception e){
logger.info(e.getMessage()); logger.info(e.getMessage());
} }
wmOmNoticeHService.addMain(wmOmNoticeH, wmOmNoticeIList); List<WmOmNoticeIEntity> 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); D0.setOK(true);
//按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象. //按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象.
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);

View File

@ -27,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.ExcelCollection;
* @version V1.0 * @version V1.0
* *
*/ */
public class WmImNoticeHPage implements java.io.Serializable { public class WmImNoticeHPage {
/**主键*/ /**主键*/
private java.lang.String id; private java.lang.String id;
/**创建人名称*/ /**创建人名称*/
@ -59,37 +59,27 @@ public class WmImNoticeHPage implements java.io.Serializable {
private java.lang.String sysCompanyCode; private java.lang.String sysCompanyCode;
/**客户编码*/ /**客户编码*/
@Excel(name="客户编码")
private java.lang.String cusCode; private java.lang.String cusCode;
/**预计到货时间*/ /**预计到货时间*/
@Excel(name="预计到货时间",format = "yyyy-MM-dd")
private java.util.Date imData; private java.util.Date imData;
/**客户订单号*/ /**客户订单号*/
@Excel(name="客户订单号")
private java.lang.String imCusCode; private java.lang.String imCusCode;
/**司机*/ /**司机*/
@Excel(name="司机")
private java.lang.String imCarDri; private java.lang.String imCarDri;
/**司机电话*/ /**司机电话*/
@Excel(name="司机电话")
private java.lang.String imCarMobile; private java.lang.String imCarMobile;
/**车号*/ /**车号*/
@Excel(name="车号")
private java.lang.String imCarNo; private java.lang.String imCarNo;
/**订单类型*/ /**订单类型*/
private java.lang.String orderTypeCode; private java.lang.String orderTypeCode;
/**月台*/ /**月台*/
@Excel(name="月台")
private java.lang.String platformCode; private java.lang.String platformCode;
/**备注*/ /**备注*/
@Excel(name="备注")
private java.lang.String imBeizhu; private java.lang.String imBeizhu;
/**单据状态*/ /**单据状态*/
@Excel(name="单据状态")
private java.lang.String imSta; private java.lang.String imSta;
/**进货通知单号*/ /**进货通知单号*/
@Excel(name="进货通知单号")
private java.lang.String noticeId; private java.lang.String noticeId;
/**附件*/ /**附件*/
@ -468,8 +458,7 @@ public class WmImNoticeHPage implements java.io.Serializable {
this.piMaster = piMaster; this.piMaster = piMaster;
} }
/**保存-预约通知项目*/
@ExcelCollection(name="预约通知项目")
private List<WmImNoticeIEntity> wmImNoticeIList = new ArrayList<WmImNoticeIEntity>(); private List<WmImNoticeIEntity> wmImNoticeIList = new ArrayList<WmImNoticeIEntity>();
public List<WmImNoticeIEntity> getWmImNoticeIList() { public List<WmImNoticeIEntity> getWmImNoticeIList() {
return wmImNoticeIList; return wmImNoticeIList;

View File

@ -59,51 +59,36 @@ public class WmOmNoticeHPage implements java.io.Serializable {
private java.lang.String sysCompanyCode; private java.lang.String sysCompanyCode;
/**客户*/ /**客户*/
@Excel(name="客户")
private java.lang.String cusCode; private java.lang.String cusCode;
/**要求交货时间*/ /**要求交货时间*/
@Excel(name="要求交货时间",format = "yyyy-MM-dd")
private java.util.Date delvData; private java.util.Date delvData;
/**收货人*/ /**收货人*/
@Excel(name="收货人")
private java.lang.String delvMember; private java.lang.String delvMember;
/**收货人电话*/ /**收货人电话*/
@Excel(name="收货人电话")
private java.lang.String delvMobile; private java.lang.String delvMobile;
/**收货人地址*/ /**收货人地址*/
@Excel(name="收货人地址")
private java.lang.String delvAddr; private java.lang.String delvAddr;
/**承运人*/ /**承运人*/
@Excel(name="承运人")
private java.lang.String reMember; private java.lang.String reMember;
/**承运人电话*/ /**承运人电话*/
@Excel(name="承运人电话")
private java.lang.String reMobile; private java.lang.String reMobile;
/**承运人车号*/ /**承运人车号*/
@Excel(name="承运人车号")
private java.lang.String reCarno; private java.lang.String reCarno;
/**发货月台*/ /**发货月台*/
@Excel(name="发货月台")
private java.lang.String omPlatNo; private java.lang.String omPlatNo;
/**备注*/ /**备注*/
@Excel(name="备注")
private java.lang.String omBeizhu; private java.lang.String omBeizhu;
/**状态*/ /**状态*/
@Excel(name="状态")
private java.lang.String omSta; private java.lang.String omSta;
/**出货单号*/ /**出货单号*/
@Excel(name="出货单号")
private java.lang.String omNoticeId; private java.lang.String omNoticeId;
/**附件*/ /**附件*/
private java.lang.String fuJian; private java.lang.String fuJian;
@Excel(name="三方客户编号")
private java.lang.String ocusCode; private java.lang.String ocusCode;
@Excel(name="三方客户名称")
private java.lang.String ocusName; private java.lang.String ocusName;
@Excel(name="客户订单号")
private java.lang.String imCusCode; private java.lang.String imCusCode;
private java.lang.String printStatus; private java.lang.String printStatus;
private java.lang.String piClass; private java.lang.String piClass;
@ -515,7 +500,6 @@ public class WmOmNoticeHPage implements java.io.Serializable {
} }
/**保存-出货通知项目*/ /**保存-出货通知项目*/
@ExcelCollection(name="出货通知项目")
private List<WmOmNoticeIEntity> wmOmNoticeIList = new ArrayList<WmOmNoticeIEntity>(); private List<WmOmNoticeIEntity> wmOmNoticeIList = new ArrayList<WmOmNoticeIEntity>();
public List<WmOmNoticeIEntity> getWmOmNoticeIList() { public List<WmOmNoticeIEntity> getWmOmNoticeIList() {
return wmOmNoticeIList; return wmOmNoticeIList;
@ -524,16 +508,15 @@ public class WmOmNoticeHPage implements java.io.Serializable {
this.wmOmNoticeIList = wmOmNoticeIList; this.wmOmNoticeIList = wmOmNoticeIList;
} }
/**保存-出货通知项目*/ // /**保存-出货通知项目*/
@ExcelCollection(name="运输项目") // private List<TmsYwDingdanEntity> wmOmtmsIList = new ArrayList<TmsYwDingdanEntity>();
private List<TmsYwDingdanEntity> wmOmtmsIList = new ArrayList<TmsYwDingdanEntity>(); //
//
// public List<TmsYwDingdanEntity> getWmOmtmsIList() {
public List<TmsYwDingdanEntity> getWmOmtmsIList() { // return wmOmtmsIList;
return wmOmtmsIList; // }
} //
// public void setWmOmtmsIList(List<TmsYwDingdanEntity> wmOmtmsIList) {
public void setWmOmtmsIList(List<TmsYwDingdanEntity> wmOmtmsIList) { // this.wmOmtmsIList = wmOmtmsIList;
this.wmOmtmsIList = wmOmtmsIList; // }
}
} }

View File

@ -27,6 +27,17 @@
<property name="supportedMediaTypes"> <property name="supportedMediaTypes">
<list> <list>
<value>text/html;charset=UTF-8</value> <value>text/html;charset=UTF-8</value>
<value>text/json;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
<!-- ResponseBody返回字符串带双引号解决 -->
<bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" index="0"/>
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list> </list>
</property> </property>
</bean> </bean>