code formate
parent
8da9620e1d
commit
b14ce3fd8f
|
@ -415,7 +415,6 @@ public class MdGoodsController extends BaseController {
|
||||||
|
|
||||||
if(StringUtil.isEmpty(mdGoods.getChlKongZhi()) ){
|
if(StringUtil.isEmpty(mdGoods.getChlKongZhi()) ){
|
||||||
mdGoods.setChlKongZhi("N");
|
mdGoods.setChlKongZhi("N");
|
||||||
|
|
||||||
}
|
}
|
||||||
if(StringUtil.isEmpty(mdGoods.getChlShl())){
|
if(StringUtil.isEmpty(mdGoods.getChlShl())){
|
||||||
mdGoods.setChlShl("1");
|
mdGoods.setChlShl("1");
|
||||||
|
@ -426,7 +425,6 @@ public class MdGoodsController extends BaseController {
|
||||||
int bzhiq = Integer.parseInt(mdGoods.getBzhiQi());
|
int bzhiq = Integer.parseInt(mdGoods.getBzhiQi());
|
||||||
mdGoods.setZhlKgm(Integer.toString(bzhiq));
|
mdGoods.setZhlKgm(Integer.toString(bzhiq));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -439,11 +437,9 @@ public class MdGoodsController extends BaseController {
|
||||||
int bzhiq = Integer.parseInt(mdGoods.getBzhiQi());
|
int bzhiq = Integer.parseInt(mdGoods.getBzhiQi());
|
||||||
mdGoods.setZhlKgm(Integer.toString(bzhiq));
|
mdGoods.setZhlKgm(Integer.toString(bzhiq));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
// TODO: handle exception
|
|
||||||
}
|
}
|
||||||
MyBeanUtils.copyBeanNotNull2Bean(mdGoods, mdGoods1);
|
MyBeanUtils.copyBeanNotNull2Bean(mdGoods, mdGoods1);
|
||||||
mdGoodsService.updateEntitie(mdGoods1);
|
mdGoodsService.updateEntitie(mdGoods1);
|
||||||
|
@ -474,10 +470,7 @@ public class MdGoodsController extends BaseController {
|
||||||
@RequestParam(value="searchstrin1", required=false)String searchstrin1,
|
@RequestParam(value="searchstrin1", required=false)String searchstrin1,
|
||||||
@RequestParam(value="searchstrin2", required=false)String searchstrin2,
|
@RequestParam(value="searchstrin2", required=false)String searchstrin2,
|
||||||
@RequestParam(value="searchstrin3", required=false)String searchstrin3) {
|
@RequestParam(value="searchstrin3", required=false)String searchstrin3) {
|
||||||
|
|
||||||
|
|
||||||
ResultDO D0 = new ResultDO();
|
ResultDO D0 = new ResultDO();
|
||||||
|
|
||||||
String hql = " from MdGoodsEntity where 1 = 1 ";
|
String hql = " from MdGoodsEntity where 1 = 1 ";
|
||||||
D0.setOK(true);
|
D0.setOK(true);
|
||||||
if(!StringUtil.isEmpty(searchstr)) {
|
if(!StringUtil.isEmpty(searchstr)) {
|
||||||
|
@ -497,7 +490,6 @@ public class MdGoodsController extends BaseController {
|
||||||
}
|
}
|
||||||
result.add(t);
|
result.add(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
D0.setObj(result);
|
D0.setObj(result);
|
||||||
return new ResponseEntity(D0, HttpStatus.OK);
|
return new ResponseEntity(D0, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -518,7 +510,6 @@ public class MdGoodsController extends BaseController {
|
||||||
UriComponentsBuilder uriBuilder) {
|
UriComponentsBuilder uriBuilder) {
|
||||||
ResultDO D0 = new ResultDO();
|
ResultDO D0 = new ResultDO();
|
||||||
MdGoodsEntity mdGoods = (MdGoodsEntity)JSONHelper.json2Object(mdGoodsstr,MdGoodsEntity.class);
|
MdGoodsEntity mdGoods = (MdGoodsEntity)JSONHelper.json2Object(mdGoodsstr,MdGoodsEntity.class);
|
||||||
|
|
||||||
// 保存
|
// 保存
|
||||||
try {
|
try {
|
||||||
mdGoodsService.save(mdGoods);
|
mdGoodsService.save(mdGoods);
|
||||||
|
@ -550,10 +541,7 @@ public class MdGoodsController extends BaseController {
|
||||||
mdGoodsService.saveOrUpdate(t);
|
mdGoodsService.saveOrUpdate(t);
|
||||||
}else{
|
}else{
|
||||||
mdGoodsService.save(mdGoodsEntity);
|
mdGoodsService.save(mdGoodsEntity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
MdCusEntity mdcus1 = systemService.findUniqueByProperty(MdCusEntity.class, "keHuBianMa", mdGoodsEntity.getSuoShuKeHu());
|
MdCusEntity mdcus1 = systemService.findUniqueByProperty(MdCusEntity.class, "keHuBianMa", mdGoodsEntity.getSuoShuKeHu());
|
||||||
if(mdcus1==null){
|
if(mdcus1==null){
|
||||||
|
@ -562,11 +550,8 @@ public class MdGoodsController extends BaseController {
|
||||||
mdcus1.setZhongWenQch(mdGoodsEntity.getCusName());
|
mdcus1.setZhongWenQch(mdGoodsEntity.getCusName());
|
||||||
systemService.save(mdcus1);
|
systemService.save(mdcus1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
D0.setOK(true);
|
D0.setOK(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -589,15 +574,12 @@ public class MdGoodsController extends BaseController {
|
||||||
mdGoodsService.saveOrUpdate(t);
|
mdGoodsService.saveOrUpdate(t);
|
||||||
}else{
|
}else{
|
||||||
mdGoodsService.save(mdGoods);
|
mdGoodsService.save(mdGoods);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
D0.setOK(true);
|
D0.setOK(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
D0.setOK(false);
|
D0.setOK(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 按Restful约定,返回204状态码, 无内容. 也可以返回200状态码.
|
// 按Restful约定,返回204状态码, 无内容. 也可以返回200状态码.
|
||||||
return new ResponseEntity(D0, HttpStatus.OK);
|
return new ResponseEntity(D0, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -618,7 +600,6 @@ public class MdGoodsController extends BaseController {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
D0.setOK(false);
|
D0.setOK(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 按Restful约定,返回204状态码, 无内容. 也可以返回200状态码.
|
// 按Restful约定,返回204状态码, 无内容. 也可以返回200状态码.
|
||||||
return new ResponseEntity(D0, HttpStatus.OK);
|
return new ResponseEntity(D0, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -629,10 +610,8 @@ public class MdGoodsController extends BaseController {
|
||||||
UriComponentsBuilder uriBuilder) { // 调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息.
|
UriComponentsBuilder uriBuilder) { // 调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息.
|
||||||
ResultDO D0 = new ResultDO();
|
ResultDO D0 = new ResultDO();
|
||||||
WmOmNoticeImpnewPage pageheader = (WmOmNoticeImpnewPage)JSONHelper.json2Object(mdGoodsstr,WmOmNoticeImpnewPage.class);
|
WmOmNoticeImpnewPage pageheader = (WmOmNoticeImpnewPage)JSONHelper.json2Object(mdGoodsstr,WmOmNoticeImpnewPage.class);
|
||||||
|
|
||||||
WmOmNoticeHEntity wmOmNoticeH = null;
|
WmOmNoticeHEntity wmOmNoticeH = null;
|
||||||
MdGoodsEntity t = systemService.get(MdGoodsEntity.class,pageheader.getId());
|
MdGoodsEntity t = systemService.get(MdGoodsEntity.class,pageheader.getId());
|
||||||
|
|
||||||
List<WmOmNoticeHEntity> wmomh = systemService.findByProperty(WmOmNoticeHEntity.class, "imCusCode", pageheader.getImCusCode());
|
List<WmOmNoticeHEntity> wmomh = systemService.findByProperty(WmOmNoticeHEntity.class, "imCusCode", pageheader.getImCusCode());
|
||||||
if(wmomh!=null&&wmomh.size()>0){
|
if(wmomh!=null&&wmomh.size()>0){
|
||||||
wmOmNoticeH = wmomh.get(0);
|
wmOmNoticeH = wmomh.get(0);
|
||||||
|
@ -646,7 +625,6 @@ public class MdGoodsController extends BaseController {
|
||||||
wmOmNoticeH.setImCusCode(pageheader.getImCusCode());
|
wmOmNoticeH.setImCusCode(pageheader.getImCusCode());
|
||||||
wmOmNoticeH.setReCarno(pageheader.getReCarno());
|
wmOmNoticeH.setReCarno(pageheader.getReCarno());
|
||||||
wmOmNoticeH.setOmBeizhu(pageheader.getImBeizhu());
|
wmOmNoticeH.setOmBeizhu(pageheader.getImBeizhu());
|
||||||
|
|
||||||
systemService.save(wmOmNoticeH);
|
systemService.save(wmOmNoticeH);
|
||||||
}
|
}
|
||||||
WmOmNoticeIEntity wmi = new WmOmNoticeIEntity();
|
WmOmNoticeIEntity wmi = new WmOmNoticeIEntity();
|
||||||
|
@ -662,7 +640,6 @@ public class MdGoodsController extends BaseController {
|
||||||
try{
|
try{
|
||||||
wmi.setGoodsQua(pageheader.getGoodsQua());//
|
wmi.setGoodsQua(pageheader.getGoodsQua());//
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
||||||
}
|
}
|
||||||
systemService.save(wmi);
|
systemService.save(wmi);
|
||||||
D0.setErrorMsg("订单生成成功");
|
D0.setErrorMsg("订单生成成功");
|
||||||
|
|
Loading…
Reference in New Issue