code format

master
erzhongxmu 2024-02-23 18:26:51 +08:00
parent 7ea711d21d
commit e3c411950e
2 changed files with 403 additions and 434 deletions

View File

@ -75,13 +75,6 @@ import org.springframework.web.util.UriComponentsBuilder;
import static com.xiaoleilu.hutool.date.DateTime.now; import static com.xiaoleilu.hutool.date.DateTime.now;
/**
* @author onlineGenerator
* @version V1.0
* @Title: Controller
* @Description: wave_to_down
* @date 2019-12-11 11:32:25
*/
@Controller @Controller
@RequestMapping("/waveToDownController") @RequestMapping("/waveToDownController")
public class WaveToDownController extends BaseController { public class WaveToDownController extends BaseController {
@ -115,10 +108,6 @@ public class WaveToDownController extends BaseController {
public ModelAndView doPrint(String waveid, HttpServletRequest request) { public ModelAndView doPrint(String waveid, HttpServletRequest request) {
String hql = "from WmOmQmIEntity where waveId = ? "; String hql = "from WmOmQmIEntity where waveId = ? ";
List<WmOmQmIEntity> wavelist = systemService.findHql(hql, waveid); List<WmOmQmIEntity> wavelist = systemService.findHql(hql, waveid);
// for(WmOmQmIEntity t: wavelist ){
// t.setFirstRq("已打印");
// systemService.updateEntitie(t);
// }
request.setAttribute("kprq", DateUtils.date2Str(DateUtils.date_sdf)); request.setAttribute("kprq", DateUtils.date2Str(DateUtils.date_sdf));
request.setAttribute("comname", ResourceUtil.getConfigByName("comname")); request.setAttribute("comname", ResourceUtil.getConfigByName("comname"));
request.setAttribute("waveid", waveid); request.setAttribute("waveid", waveid);
@ -134,11 +123,6 @@ public class WaveToDownController extends BaseController {
CriteriaQuery cq = new CriteriaQuery(WaveToDownEntity.class, dataGrid); CriteriaQuery cq = new CriteriaQuery(WaveToDownEntity.class, dataGrid);
//查询条件组装器 //查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, waveToDown, request.getParameterMap()); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, waveToDown, request.getParameterMap());
try {
//自定义追加查询条件
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add(); cq.add();
this.waveToDownService.getDataGridReturn(cq, true); this.waveToDownService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid); TagUtil.datagrid(response, dataGrid);
@ -161,7 +145,6 @@ public class WaveToDownController extends BaseController {
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
message = "wave_to_down删除失败";
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
j.setMsg(message); j.setMsg(message);
@ -189,7 +172,6 @@ public class WaveToDownController extends BaseController {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
message = "wave_to_down删除失败";
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
j.setMsg(message); j.setMsg(message);
@ -213,7 +195,6 @@ public class WaveToDownController extends BaseController {
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
message = "wave_to_down添加失败";
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
j.setMsg(message); j.setMsg(message);
@ -238,7 +219,6 @@ public class WaveToDownController extends BaseController {
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
message = "wave_to_down更新失败";
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
j.setMsg(message); j.setMsg(message);
@ -467,18 +447,13 @@ public class WaveToDownController extends BaseController {
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);
} }
D0.setOK(true); D0.setOK(true);
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);
} }
@RequestMapping(value = "/jsondown", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/jsondown", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> update(@RequestBody WaveToDownEntity waveToDown) { public ResponseEntity<?> update(@RequestBody WaveToDownEntity waveToDown) {
ResultDO D0 = new ResultDO(); ResultDO D0 = new ResultDO();
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息. //调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
//保存 //保存
try { try {
String hql = "from WmOmQmIEntity where waveId = ? and goodsId = ? and proData = ? and tinId = ? and binId = ? and binSta = ?"; String hql = "from WmOmQmIEntity where waveId = ? and goodsId = ? and proData = ? and tinId = ? and binId = ? and binSta = ?";
@ -504,7 +479,6 @@ public class WaveToDownController extends BaseController {
wmToDownGoods.setImCusCode(wmOmQmI.getImCusCode());//客户单号 wmToDownGoods.setImCusCode(wmOmQmI.getImCusCode());//客户单号
wmToDownGoods.setOrderType("99");//默认为01 wmToDownGoods.setOrderType("99");//默认为01
wmToDownGoods.setCreateDate(now()); wmToDownGoods.setCreateDate(now());
systemService.save(wmToDownGoods); systemService.save(wmToDownGoods);
wmOmQmI.setBinSta("H"); wmOmQmI.setBinSta("H");
wmOmQmI.setFirstRq(waveToDown.getFirstRq()); wmOmQmI.setFirstRq(waveToDown.getFirstRq());

View File

@ -1,8 +1,10 @@
package com.zzjee.wave.controller; package com.zzjee.wave.controller;
import com.zzjee.api.ResultDO; import com.zzjee.api.ResultDO;
import com.zzjee.wave.entity.WaveToDownEntity; import com.zzjee.wave.entity.WaveToDownEntity;
import com.zzjee.wave.entity.WaveToFjEntity; import com.zzjee.wave.entity.WaveToFjEntity;
import com.zzjee.wave.service.WaveToFjServiceI; import com.zzjee.wave.service.WaveToFjServiceI;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -46,6 +48,7 @@ import java.io.IOException;
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 java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
@ -57,21 +60,15 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.jeecgframework.core.beanvalidator.BeanValidators; import org.jeecgframework.core.beanvalidator.BeanValidators;
import java.util.Set; import java.util.Set;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validator; import javax.validation.Validator;
import java.net.URI; import java.net.URI;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
/**
* @Title: Controller
* @Description: wave_to_fj
* @author onlineGenerator
* @date 2019-12-11 11:32:18
* @version V1.0
*
*/
@Controller @Controller
@RequestMapping("/waveToFjController") @RequestMapping("/waveToFjController")
public class WaveToFjController extends BaseController { public class WaveToFjController extends BaseController {
@ -84,9 +81,6 @@ public class WaveToFjController extends BaseController {
private WaveToFjServiceI waveToFjService; private WaveToFjServiceI waveToFjService;
@Autowired @Autowired
private SystemService systemService; private SystemService systemService;
@Autowired
private Validator validator;
/** /**
@ -105,17 +99,16 @@ public class WaveToFjController extends BaseController {
* @param request * @param request
* @param response * @param response
* @param dataGrid * @param dataGrid
*/ */
@RequestMapping(params = "datagrid") @RequestMapping(params = "datagrid")
public void datagrid(WaveToFjEntity waveToFj,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { public void datagrid(WaveToFjEntity waveToFj, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(WaveToFjEntity.class, dataGrid); CriteriaQuery cq = new CriteriaQuery(WaveToFjEntity.class, dataGrid);
//查询条件组装器 //查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, waveToFj, request.getParameterMap()); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, waveToFj, request.getParameterMap());
try{ try {
//自定义追加查询条件 //自定义追加查询条件
}catch (Exception e) { } catch (Exception e) {
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
cq.add(); cq.add();
@ -135,10 +128,10 @@ public class WaveToFjController extends BaseController {
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
waveToFj = systemService.getEntity(WaveToFjEntity.class, waveToFj.getId()); waveToFj = systemService.getEntity(WaveToFjEntity.class, waveToFj.getId());
message = "wave_to_fj"; message = "wave_to_fj";
try{ try {
waveToFjService.delete(waveToFj); waveToFjService.delete(waveToFj);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
message = "wave_to_fj"; message = "wave_to_fj";
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
@ -154,19 +147,19 @@ public class WaveToFjController extends BaseController {
*/ */
@RequestMapping(params = "doBatchDel") @RequestMapping(params = "doBatchDel")
@ResponseBody @ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){ public AjaxJson doBatchDel(String ids, HttpServletRequest request) {
String message = null; String message = null;
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
message = "wave_to_fj"; message = "wave_to_fj";
try{ try {
for(String id:ids.split(",")){ for (String id : ids.split(",")) {
WaveToFjEntity waveToFj = systemService.getEntity(WaveToFjEntity.class, WaveToFjEntity waveToFj = systemService.getEntity(WaveToFjEntity.class,
id id
); );
waveToFjService.delete(waveToFj); waveToFjService.delete(waveToFj);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
} }
}catch(Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
message = "wave_to_fj"; message = "wave_to_fj";
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
@ -179,7 +172,6 @@ public class WaveToFjController extends BaseController {
/** /**
* wave_to_fj * wave_to_fj
* *
* @return * @return
*/ */
@RequestMapping(params = "doAdd") @RequestMapping(params = "doAdd")
@ -188,10 +180,10 @@ public class WaveToFjController extends BaseController {
String message = null; String message = null;
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
message = "wave_to_fj添加成功"; message = "wave_to_fj添加成功";
try{ try {
waveToFjService.save(waveToFj); waveToFjService.save(waveToFj);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
message = "wave_to_fj添加失败"; message = "wave_to_fj添加失败";
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
@ -203,7 +195,6 @@ public class WaveToFjController extends BaseController {
/** /**
* wave_to_fj * wave_to_fj
* *
* @return * @return
*/ */
@RequestMapping(params = "doUpdate") @RequestMapping(params = "doUpdate")
@ -240,6 +231,7 @@ public class WaveToFjController extends BaseController {
} }
return new ModelAndView("com/zzjee/wave/waveToFj-add"); return new ModelAndView("com/zzjee/wave/waveToFj-add");
} }
/** /**
* wave_to_fj * wave_to_fj
* *
@ -261,7 +253,7 @@ public class WaveToFjController extends BaseController {
*/ */
@RequestMapping(params = "upload") @RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) { public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","waveToFjController"); req.setAttribute("controller_name", "waveToFjController");
return new ModelAndView("common/upload/pub_excel_upload"); return new ModelAndView("common/upload/pub_excel_upload");
} }
@ -272,18 +264,19 @@ public class WaveToFjController extends BaseController {
* @param response * @param response
*/ */
@RequestMapping(params = "exportXls") @RequestMapping(params = "exportXls")
public String exportXls(WaveToFjEntity waveToFj,HttpServletRequest request,HttpServletResponse response public String exportXls(WaveToFjEntity waveToFj, HttpServletRequest request, HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) { , DataGrid dataGrid, ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(WaveToFjEntity.class, dataGrid); CriteriaQuery cq = new CriteriaQuery(WaveToFjEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, waveToFj, request.getParameterMap()); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, waveToFj, request.getParameterMap());
List<WaveToFjEntity> waveToFjs = this.waveToFjService.getListByCriteriaQuery(cq,false); List<WaveToFjEntity> waveToFjs = this.waveToFjService.getListByCriteriaQuery(cq, false);
modelMap.put(NormalExcelConstants.FILE_NAME,"wave_to_fj"); modelMap.put(NormalExcelConstants.FILE_NAME, "wave_to_fj");
modelMap.put(NormalExcelConstants.CLASS,WaveToFjEntity.class); modelMap.put(NormalExcelConstants.CLASS, WaveToFjEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("wave_to_fj列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(), modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("wave_to_fj列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
"导出信息")); "导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,waveToFjs); modelMap.put(NormalExcelConstants.DATA_LIST, waveToFjs);
return NormalExcelConstants.JEECG_EXCEL_VIEW; return NormalExcelConstants.JEECG_EXCEL_VIEW;
} }
/** /**
* excel 使 * excel 使
* *
@ -291,13 +284,13 @@ public class WaveToFjController extends BaseController {
* @param response * @param response
*/ */
@RequestMapping(params = "exportXlsByT") @RequestMapping(params = "exportXlsByT")
public String exportXlsByT(WaveToFjEntity waveToFj,HttpServletRequest request,HttpServletResponse response public String exportXlsByT(WaveToFjEntity waveToFj, HttpServletRequest request, HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) { , DataGrid dataGrid, ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"wave_to_fj"); modelMap.put(NormalExcelConstants.FILE_NAME, "wave_to_fj");
modelMap.put(NormalExcelConstants.CLASS,WaveToFjEntity.class); modelMap.put(NormalExcelConstants.CLASS, WaveToFjEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("wave_to_fj列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(), modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("wave_to_fj列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
"导出信息")); "导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList()); modelMap.put(NormalExcelConstants.DATA_LIST, new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW; return NormalExcelConstants.JEECG_EXCEL_VIEW;
} }
@ -316,7 +309,7 @@ public class WaveToFjController extends BaseController {
params.setHeadRows(1); params.setHeadRows(1);
params.setNeedSave(true); params.setNeedSave(true);
try { try {
List<WaveToFjEntity> listWaveToFjEntitys = ExcelImportUtil.importExcel(file.getInputStream(),WaveToFjEntity.class,params); List<WaveToFjEntity> listWaveToFjEntitys = ExcelImportUtil.importExcel(file.getInputStream(), WaveToFjEntity.class, params);
for (WaveToFjEntity waveToFj : listWaveToFjEntitys) { for (WaveToFjEntity waveToFj : listWaveToFjEntitys) {
waveToFjService.save(waveToFj); waveToFjService.save(waveToFj);
} }
@ -324,7 +317,7 @@ public class WaveToFjController extends BaseController {
} catch (Exception e) { } catch (Exception e) {
j.setMsg("文件导入失败!"); j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e)); logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{ } finally {
try { try {
file.getInputStream().close(); file.getInputStream().close();
} catch (IOException e) { } catch (IOException e) {
@ -338,85 +331,86 @@ public class WaveToFjController extends BaseController {
@RequestMapping(method = RequestMethod.GET) @RequestMapping(method = RequestMethod.GET)
@ResponseBody @ResponseBody
public List<WaveToFjEntity> list() { public List<WaveToFjEntity> list() {
List<WaveToFjEntity> listWaveToFjs=waveToFjService.getList(WaveToFjEntity.class); List<WaveToFjEntity> listWaveToFjs = waveToFjService.getList(WaveToFjEntity.class);
return listWaveToFjs; return listWaveToFjs;
} }
@RequestMapping(value = "/list/tofj", method = RequestMethod.GET) @RequestMapping(value = "/list/tofj", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<?> list(@RequestParam(value="username", required=false) String username, public ResponseEntity<?> list(@RequestParam(value = "username", required = false) String username,
@RequestParam(value="searchstr", required=false)String searchstr,//波次号 @RequestParam(value = "searchstr", required = false) String searchstr,//波次号
@RequestParam(value="searchstr2", required=false)String searchstr2,//一次容器 @RequestParam(value = "searchstr2", required = false) String searchstr2,//一次容器
@RequestParam(value="searchstr3", required=false)String searchstr3,//商品编码 @RequestParam(value = "searchstr3", required = false) String searchstr3,//商品编码
@RequestParam(value="searchstr4", required=false)String searchstr4,//二次容器 @RequestParam(value = "searchstr4", required = false) String searchstr4,//二次容器
@RequestParam(value="searchstr5", required=false)String searchstr5)//排序方式 @RequestParam(value = "searchstr5", required = false) String searchstr5)//排序方式
{ {
ResultDO D0 = new ResultDO(); ResultDO D0 = new ResultDO();
D0.setOK(true); D0.setOK(true);
String hql="from WaveToDownEntity where waveId = ? "; String hql = "from WaveToDownEntity where waveId = ? ";
List<WaveToFjEntity> listWaveToFjs =new ArrayList<>(); List<WaveToFjEntity> listWaveToFjs = new ArrayList<>();
List<WaveToFjEntity> listWaveToFjsnew =new ArrayList<>(); List<WaveToFjEntity> listWaveToFjsnew = new ArrayList<>();
if(StringUtil.isEmpty(searchstr5)||"null".equals(searchstr5)){ if (StringUtil.isEmpty(searchstr5) || "null".equals(searchstr5)) {
searchstr5 = "asc"; searchstr5 = "asc";
} }
String orderby = "order by secondRq " + searchstr5; String orderby = "order by secondRq " + searchstr5;
if(StringUtil.isEmpty(searchstr)&&StringUtil.isEmpty(searchstr2)){ if (StringUtil.isEmpty(searchstr) && StringUtil.isEmpty(searchstr2)) {
hql="from WaveToFjEntity where 1 = 1 "+orderby; hql = "from WaveToFjEntity where 1 = 1 " + orderby;
listWaveToFjs=waveToFjService.findHql(hql); listWaveToFjs = waveToFjService.findHql(hql);
} }
if(StringUtil.isNotEmpty(searchstr)&&StringUtil.isEmpty(searchstr2)){ if (StringUtil.isNotEmpty(searchstr) && StringUtil.isEmpty(searchstr2)) {
hql="from WaveToFjEntity where waveId = ? "+orderby; hql = "from WaveToFjEntity where waveId = ? " + orderby;
listWaveToFjs=waveToFjService.findHql(hql,searchstr); listWaveToFjs = waveToFjService.findHql(hql, searchstr);
} }
if(StringUtil.isEmpty(searchstr)&&StringUtil.isNotEmpty(searchstr2)){ if (StringUtil.isEmpty(searchstr) && StringUtil.isNotEmpty(searchstr2)) {
hql="from WaveToFjEntity where firstRq = ? "+orderby; hql = "from WaveToFjEntity where firstRq = ? " + orderby;
listWaveToFjs=waveToFjService.findHql(hql,searchstr2); listWaveToFjs = waveToFjService.findHql(hql, searchstr2);
} }
if(StringUtil.isNotEmpty(searchstr)&&StringUtil.isNotEmpty(searchstr2)){ if (StringUtil.isNotEmpty(searchstr) && StringUtil.isNotEmpty(searchstr2)) {
hql="from WaveToFjEntity where waveId = ? and firstRq = ?"+orderby; hql = "from WaveToFjEntity where waveId = ? and firstRq = ?" + orderby;
listWaveToFjs=waveToFjService.findHql(hql,searchstr,searchstr2); listWaveToFjs = waveToFjService.findHql(hql, searchstr, searchstr2);
} }
// List<WaveToFjEntity> listWaveToFjs=waveToFjService.getList(WaveToFjEntity.class); // List<WaveToFjEntity> listWaveToFjs=waveToFjService.getList(WaveToFjEntity.class);
String omnoticeid="1"; String omnoticeid = "1";
String siji = ""; String siji = "";
String chehao = ""; String chehao = "";
System.out.println("11111searchstr3="+searchstr3); System.out.println("11111searchstr3=" + searchstr3);
for(WaveToFjEntity t:listWaveToFjs) { for (WaveToFjEntity t : listWaveToFjs) {
System.out.println("searchstr4="+searchstr4); System.out.println("searchstr4=" + searchstr4);
if(StringUtil.isNotEmpty(searchstr4)){ if (StringUtil.isNotEmpty(searchstr4)) {
if ( !StringUtil.strPos(t.getSecondRq(), searchstr4) ) { if (!StringUtil.strPos(t.getSecondRq(), searchstr4)) {
continue; continue;
} }
} }
if (StringUtil.isNotEmpty(searchstr3)) { if (StringUtil.isNotEmpty(searchstr3)) {
System.out.println("t.getGoodsId()="+t.getGoodsId()); System.out.println("t.getGoodsId()=" + t.getGoodsId());
System.out.println("searchstr3="+searchstr3); System.out.println("searchstr3=" + searchstr3);
try{ try {
if (!(StringUtil.strPos(t.getGoodsId(), searchstr3)||StringUtil.strPos(t.getShpTiaoMa(),searchstr3))) { if (!(StringUtil.strPos(t.getGoodsId(), searchstr3) || StringUtil.strPos(t.getShpTiaoMa(), searchstr3))) {
continue; continue;
} }
}catch (Exception e){ } catch (Exception e) {
} }
} }
WaveToFjEntity t1 = new WaveToFjEntity(); WaveToFjEntity t1 = new WaveToFjEntity();
try{ try {
MyBeanUtils.copyBean2Bean(t1,t); MyBeanUtils.copyBean2Bean(t1, t);
}catch (Exception e){ } catch (Exception e) {
} }
try { try {
if(omnoticeid.equals( t.getOmNoticeId())){ if (omnoticeid.equals(t.getOmNoticeId())) {
t1.setBy1(siji);//司机 t1.setBy1(siji);//司机
t1.setBy2(chehao);//车号 t1.setBy2(chehao);//车号
}else{ } else {
WmOmNoticeHEntity wmom = systemService.findUniqueByProperty(WmOmNoticeHEntity.class, "omNoticeId", t.getOmNoticeId()); WmOmNoticeHEntity wmom = systemService.findUniqueByProperty(WmOmNoticeHEntity.class, "omNoticeId", t.getOmNoticeId());
omnoticeid =t.getOmNoticeId(); omnoticeid = t.getOmNoticeId();
siji = wmom.getReMember(); siji = wmom.getReMember();
chehao = wmom.getReCarno(); chehao = wmom.getReCarno();
t1.setBy1(siji);//司机 t1.setBy1(siji);//司机
@ -432,6 +426,7 @@ public class WaveToFjController extends BaseController {
D0.setObj(listWaveToFjsnew); D0.setObj(listWaveToFjsnew);
return new ResponseEntity(D0, HttpStatus.OK); return new ResponseEntity(D0, HttpStatus.OK);
} }
@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) {
@ -445,24 +440,24 @@ public class WaveToFjController extends BaseController {
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody @ResponseBody
public ResponseEntity<?> create(@RequestParam String waveToFjstr , UriComponentsBuilder uriBuilder) { public ResponseEntity<?> create(@RequestParam String waveToFjstr, UriComponentsBuilder uriBuilder) {
ResultDO D0 = new ResultDO(); ResultDO D0 = new ResultDO();
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息. //调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
WaveToFjEntity waveToFj = (WaveToFjEntity)JSONHelper.json2Object(waveToFjstr,WaveToFjEntity.class); WaveToFjEntity waveToFj = (WaveToFjEntity) JSONHelper.json2Object(waveToFjstr, WaveToFjEntity.class);
//保存 //保存
try{ try {
String omnoticeid =""; String omnoticeid = "";
WmOmQmIEntity wmOmQmI = systemService.getEntity( WmOmQmIEntity wmOmQmI = systemService.getEntity(
WmOmQmIEntity.class, waveToFj.getId()); WmOmQmIEntity.class, waveToFj.getId());
if (wmOmQmI != null&&wmOmQmI.getBinSta().equals("H")) { if (wmOmQmI != null && wmOmQmI.getBinSta().equals("H")) {
wmOmQmI.setBinSta("Y"); wmOmQmI.setBinSta("Y");
wmOmQmI.setSecondRq(waveToFj.getSecondRq()); wmOmQmI.setSecondRq(waveToFj.getSecondRq());
wmOmQmI.setUpdateBy(waveToFj.getCreateBy());//分拣人 wmOmQmI.setUpdateBy(waveToFj.getCreateBy());//分拣人
systemService.saveOrUpdate(wmOmQmI); systemService.saveOrUpdate(wmOmQmI);
String hql = "From WmOmQmIEntity where omNoticeId = ? and binSta = ?"; String hql = "From WmOmQmIEntity where omNoticeId = ? and binSta = ?";
List<WmOmQmIEntity> listom = systemService.findHql(hql,wmOmQmI.getOmNoticeId(),"H"); List<WmOmQmIEntity> listom = systemService.findHql(hql, wmOmQmI.getOmNoticeId(), "H");
omnoticeid = wmOmQmI.getOmNoticeId(); omnoticeid = wmOmQmI.getOmNoticeId();
for(WmOmQmIEntity tom: listom){ for (WmOmQmIEntity tom : listom) {
tom.setSecondRq(waveToFj.getSecondRq()); tom.setSecondRq(waveToFj.getSecondRq());
systemService.saveOrUpdate(tom); systemService.saveOrUpdate(tom);
} }
@ -486,10 +481,10 @@ public class WaveToFjController extends BaseController {
ResultDO D0 = new ResultDO(); ResultDO D0 = new ResultDO();
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息. //调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
//保存 //保存
try{ try {
WmOmQmIEntity wmOmQmI = systemService.getEntity( WmOmQmIEntity wmOmQmI = systemService.getEntity(
WmOmQmIEntity.class, waveToFj.getId()); WmOmQmIEntity.class, waveToFj.getId());
if (wmOmQmI != null&&wmOmQmI.getBinSta().equals("H")) { if (wmOmQmI != null && wmOmQmI.getBinSta().equals("H")) {
wmOmQmI.setBinSta("Y"); wmOmQmI.setBinSta("Y");
systemService.saveOrUpdate(wmOmQmI); systemService.saveOrUpdate(wmOmQmI);
} }