上下架读取商品名称

master
e 2020-01-10 10:54:44 +08:00
parent 0d264cae1b
commit cceda3ab5c
4 changed files with 72 additions and 6 deletions

View File

@ -15,6 +15,7 @@ import javax.validation.Validator;
import com.zzjee.md.entity.MdCusEntity; import com.zzjee.md.entity.MdCusEntity;
import com.zzjee.wm.entity.WmOmQmIEntity; import com.zzjee.wm.entity.WmOmQmIEntity;
import com.zzjee.wm.page.WmOmNoticeImpnewPage; import com.zzjee.wm.page.WmOmNoticeImpnewPage;
import com.zzjee.wm.page.WmTmsNoticeHPage;
import com.zzjee.wmutil.dsc.dscUtil; import com.zzjee.wmutil.dsc.dscUtil;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.jeecgframework.core.common.controller.BaseController; import org.jeecgframework.core.common.controller.BaseController;
@ -37,12 +38,7 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -574,6 +570,43 @@ public class MdGoodsController extends BaseController {
} }
@RequestMapping(value = "/apicreategoods")
@ResponseBody
public ResponseEntity<?> creategoods(@RequestBody MdGoodsEntity mdGoodsEntity ) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
ResultDO D0 = new ResultDO();
try {
MdGoodsEntity t = systemService.findUniqueByProperty(MdGoodsEntity.class,"shpBianMa",mdGoodsEntity.getShpBianMa());
if(t!=null){
MyBeanUtils.copyBeanNotNull2Bean(mdGoodsEntity,t);
mdGoodsService.saveOrUpdate(t);
}else{
mdGoodsService.save(mdGoodsEntity);
}
try{
MdCusEntity mdcus1 = systemService.findUniqueByProperty(MdCusEntity.class, "keHuBianMa", mdGoodsEntity.getSuoShuKeHu());
if(mdcus1==null){
mdcus1 = new MdCusEntity();
mdcus1.setKeHuBianMa(mdGoodsEntity.getSuoShuKeHu());
mdcus1.setZhongWenQch(mdGoodsEntity.getCusName());
systemService.save(mdcus1);
}
}catch(Exception e){
}
D0.setOK(true);
} catch (Exception e) {
e.printStackTrace();
D0.setOK(false);
}
return new ResponseEntity(D0, HttpStatus.OK);
}
@RequestMapping(value = "/addgoods", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/addgoods", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody @ResponseBody
public ResponseEntity<?> addgoods(@RequestParam String mdGoodsstr, public ResponseEntity<?> addgoods(@RequestParam String mdGoodsstr,

View File

@ -42,6 +42,10 @@ public class MdGoodsEntity implements java.io.Serializable {
/**所属客户*/ /**所属客户*/
@Excel(name="所属客户") @Excel(name="所属客户")
private java.lang.String suoShuKeHu; private java.lang.String suoShuKeHu;
@Excel(name="客户名称")
private java.lang.String cusName;
@Excel(name="配送点")
private java.lang.String peisongdian;
/**商品名称*/ /**商品名称*/
@Excel(name="商品名称") @Excel(name="商品名称")
private java.lang.String shpMingCheng; private java.lang.String shpMingCheng;
@ -893,4 +897,23 @@ public class MdGoodsEntity implements java.io.Serializable {
public void setRwMingCheng(String rwMingCheng) { public void setRwMingCheng(String rwMingCheng) {
this.rwMingCheng = rwMingCheng; this.rwMingCheng = rwMingCheng;
} }
@Column(name ="cus_name",nullable=true,length=32)
public String getCusName() {
return cusName;
}
public void setCusName(String cusName) {
this.cusName = cusName;
}
@Column(name ="peisongdian",nullable=true,length=32)
public String getPeisongdian() {
return peisongdian;
}
public void setPeisongdian(String peisongdian) {
this.peisongdian = peisongdian;
}
} }

View File

@ -269,6 +269,7 @@ public class WmInQmIController extends BaseController {
wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode()); wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode());
wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName()); wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName());
wmToUpGoodsEntity.setActTypeCode("01"); wmToUpGoodsEntity.setActTypeCode("01");
wmToUpGoodsEntity.setWmToUpId(wmInQmIEntity.getId());
// String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '" // String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '"
// + wmInQmIEntity.getBinId() + "'"; // + wmInQmIEntity.getBinId() + "'";
// Map<String, Object> binMap = systemService.findOneForJdbc(sql); // Map<String, Object> binMap = systemService.findOneForJdbc(sql);

View File

@ -2466,6 +2466,15 @@ public class WmOmNoticeHController extends BaseController {
wmOmNoticeIListnew.add(t); wmOmNoticeIListnew.add(t);
} }
wmOmNoticeHService.addMaintms(wmOmNoticeH, wmOmNoticeIListnew); wmOmNoticeHService.addMaintms(wmOmNoticeH, wmOmNoticeIListnew);
TmsYwDingdanEntity tms = new TmsYwDingdanEntity();
tms.setYwkhdh(wmOmNoticeH.getImCusCode());//单号
tms.setYwddbz(wmOmNoticeH.getOmBeizhu());//备注
tms.setShrsj(wmOmNoticeH.getDelvMobile());//收货人手机
tms.setShouhuoren(wmOmNoticeH.getDelvMember());//收货人
tms.setShrdh(wmOmNoticeH.getDelvAddr());//收货人地址
tms.setBy1(wmOmNoticeH.getReMember());//区域
tms.setFadh(noticeid);
systemService.save(tms);
D0.setOK(true); D0.setOK(true);
//按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象. //按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象.
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);