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

View File

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