|
@@ -57,16 +57,16 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
|
|
|
|
// @SuppressWarnings("unused")
|
|
// @SuppressWarnings("unused")
|
|
@RequestMapping(value = "/main")
|
|
@RequestMapping(value = "/main")
|
|
- @RequiresPermissions("hxhbtj:main")
|
|
|
|
- public String main(SimplePageRequest page, Model model, final HttpServletRequest request, final String rq, final String szgkid, final String menuid) throws JsonProcessingException {
|
|
|
|
|
|
+ // @RequiresPermissions("hxhbtj:main")
|
|
|
|
+ public String main(SimplePageRequest page, Model model, final HttpServletRequest request, final String rq, final String dq, final String menuid) throws JsonProcessingException {
|
|
// 查询条件
|
|
// 查询条件
|
|
Specification<HxhbtjEntity> spec = new Specification<HxhbtjEntity>() {
|
|
Specification<HxhbtjEntity> spec = new Specification<HxhbtjEntity>() {
|
|
@Override
|
|
@Override
|
|
public Predicate toPredicate(Root<HxhbtjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
public Predicate toPredicate(Root<HxhbtjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
// 所在港口
|
|
// 所在港口
|
|
- if (StringUtils.isNotEmpty(szgkid)) {
|
|
|
|
- list.add(cb.like(root.get("szgk").get("id").as(String.class), "%" + szgkid + "%"));
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(dq)) {
|
|
|
|
+ list.add(cb.like(root.get("dq").as(String.class), "%" + dq + "%"));
|
|
}
|
|
}
|
|
// 日期
|
|
// 日期
|
|
if (rq != null) {
|
|
if (rq != null) {
|
|
@@ -90,14 +90,27 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
|
|
vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
|
|
vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
|
|
vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
|
|
vo.setRq(entity.getRq() != null ? entity.getRq().toString() : "");
|
|
vo.setRq(entity.getRq() != null ? entity.getRq().toString() : "");
|
|
|
|
+ if (!StringUtils.isEmpty(entity.getDq())) {
|
|
|
|
+ CodeEntity code = securityMgr.codeService().findOne(entity.getDq());
|
|
|
|
+ if (code != null) {
|
|
|
|
+ vo.setDqzw(code.getText());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
vo.setRecordStatus(entity.getRecordStatus());
|
|
vo.setRecordStatus(entity.getRecordStatus());
|
|
voList.add(vo);
|
|
voList.add(vo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String szd = GlobalData.CITY_CODE;
|
|
|
|
+ if (!StringUtils.isEmpty(szd)) {
|
|
|
|
+ List<CodeEntity> codelist = securityMgr.codeService().findByBz(szd);
|
|
|
|
+ model.addAttribute("dqlist", codelist);
|
|
|
|
+ }
|
|
|
|
+
|
|
model.addAttribute("list", voList);
|
|
model.addAttribute("list", voList);
|
|
model.addAttribute("menuid", menuid);
|
|
model.addAttribute("menuid", menuid);
|
|
- model.addAttribute("szgkid", szgkid);
|
|
|
|
|
|
+ model.addAttribute("dq", dq);
|
|
|
|
+ // model.addAttribute("szgkid", szgkid);
|
|
model.addAttribute("rq", rq);
|
|
model.addAttribute("rq", rq);
|
|
|
|
|
|
// 翻页共通
|
|
// 翻页共通
|
|
@@ -125,7 +138,7 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
HxhbtjEntity entity = hxhbtjService.findOne(id);
|
|
HxhbtjEntity entity = hxhbtjService.findOne(id);
|
|
HxhbtjVo vo = new HxhbtjVo();
|
|
HxhbtjVo vo = new HxhbtjVo();
|
|
BeanUtils.copyProperties(entity, vo);
|
|
BeanUtils.copyProperties(entity, vo);
|
|
- vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
|
|
|
|
|
|
+ //vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
|
|
vo.setBywcl(entity.getBywcl() != null ? entity.getBywcl().toString() : "");
|
|
vo.setBywcl(entity.getBywcl() != null ? entity.getBywcl().toString() : "");
|
|
vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
|
|
vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
|
|
vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
|
|
vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
|
|
@@ -173,18 +186,24 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
} else {
|
|
} else {
|
|
vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
|
|
vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(entity.getDq())) {
|
|
|
|
+ CodeEntity code = securityMgr.codeService().findOne(entity.getDq());
|
|
|
|
+ if (code != null) {
|
|
|
|
+ vo.setDqzw(code.getText());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
model.addAttribute("record", vo);
|
|
model.addAttribute("record", vo);
|
|
model.addAttribute("menuid", menuid);
|
|
model.addAttribute("menuid", menuid);
|
|
return "gkyxtjyfx/hxhbtj/hxhbtjView";
|
|
return "gkyxtjyfx/hxhbtj/hxhbtjView";
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/add")
|
|
@RequestMapping(value = "/add")
|
|
- @RequiresPermissions("hxhbtj:add")
|
|
|
|
|
|
+ // @RequiresPermissions("hxhbtj:add")
|
|
public String add(Model model, String menuid, String path) {
|
|
public String add(Model model, String menuid, String path) {
|
|
- if (!StringUtils.isEmpty(path)) {
|
|
|
|
- path = path.replace(":", "&");
|
|
|
|
- String jyrid = path.substring(path.lastIndexOf("=") + 1);
|
|
|
|
|
|
+ String szd = GlobalData.CITY_CODE;
|
|
|
|
+ if (!StringUtils.isEmpty(szd)) {
|
|
|
|
+ List<CodeEntity> codelist = securityMgr.codeService().findByBz(szd);
|
|
|
|
+ model.addAttribute("dqlist", codelist);
|
|
}
|
|
}
|
|
if (SecUtils.getCurrUser() != null) {
|
|
if (SecUtils.getCurrUser() != null) {
|
|
List<CodeEntity> list = securityMgr.codeService().findValidCodesByGroupCodeAndCity(Constants.GROUP_CODE_SZD, GlobalData.CITY_CODE);
|
|
List<CodeEntity> list = securityMgr.codeService().findValidCodesByGroupCodeAndCity(Constants.GROUP_CODE_SZD, GlobalData.CITY_CODE);
|
|
@@ -200,16 +219,13 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/edit")
|
|
@RequestMapping(value = "/edit")
|
|
- @RequiresPermissions("hxhbtj:edit")
|
|
|
|
- public String edit(Model model, String id, String path) {
|
|
|
|
- if (!StringUtils.isEmpty(path)) {
|
|
|
|
- path = path.replace(":", "&");
|
|
|
|
- }
|
|
|
|
- model.addAttribute("path", path);
|
|
|
|
|
|
+ // @RequiresPermissions("hxhbtj:edit")
|
|
|
|
+ public String edit(Model model, String id) {
|
|
|
|
+
|
|
HxhbtjEntity entity = hxhbtjService.findOne(id);
|
|
HxhbtjEntity entity = hxhbtjService.findOne(id);
|
|
HxhbtjVo vo = new HxhbtjVo();
|
|
HxhbtjVo vo = new HxhbtjVo();
|
|
BeanUtils.copyProperties(entity, vo);
|
|
BeanUtils.copyProperties(entity, vo);
|
|
- vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
|
|
|
|
|
|
+ vo.setDq(entity.getDq() != null ? entity.getDq().toString() : "");
|
|
vo.setBywcl(entity.getBywcl() != null ? entity.getBywcl().toString() : "");
|
|
vo.setBywcl(entity.getBywcl() != null ? entity.getBywcl().toString() : "");
|
|
vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
|
|
vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
|
|
vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
|
|
vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
|
|
@@ -257,24 +273,30 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
} else {
|
|
} else {
|
|
vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
|
|
vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
|
|
}
|
|
}
|
|
|
|
+ if (!StringUtils.isEmpty(entity.getDq())) {
|
|
|
|
+ CodeEntity code = securityMgr.codeService().findOne(entity.getDq());
|
|
|
|
+ if (code != null) {
|
|
|
|
+ vo.setDqzw(code.getText());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
model.addAttribute("record", vo);
|
|
model.addAttribute("record", vo);
|
|
- model.addAttribute("szgkid", entity.getSzgk().getId());
|
|
|
|
return "gkyxtjyfx/hxhbtj/hxhbtjEdit";
|
|
return "gkyxtjyfx/hxhbtj/hxhbtjEdit";
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/save")
|
|
@RequestMapping(value = "/save")
|
|
// @RequiresPermissions("hxhbtj:add")
|
|
// @RequiresPermissions("hxhbtj:add")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public WebJsonResult save(Model model, String path, String szgkid, String rq, HxhbtjEntity code) {
|
|
|
|
|
|
+ public WebJsonResult save(Model model, String path, String szgkid, String rq, HxhbtjEntity code, String dq) {
|
|
WebJsonResult wr = success();
|
|
WebJsonResult wr = success();
|
|
- if (StringUtils.isEmpty(szgkid)) {
|
|
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isEmpty(rq)) {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
- wr.setMessage("请选择所在港口!");
|
|
|
|
|
|
+ wr.setMessage("请选择日期!");
|
|
return wr;
|
|
return wr;
|
|
}
|
|
}
|
|
- if (StringUtils.isEmpty(rq)) {
|
|
|
|
|
|
+ if (StringUtils.isEmpty(dq)) {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
- wr.setMessage("请选择日期!");
|
|
|
|
|
|
+ wr.setMessage("请选择所在地区!");
|
|
return wr;
|
|
return wr;
|
|
}
|
|
}
|
|
// 日期、港口不能重复
|
|
// 日期、港口不能重复
|
|
@@ -293,7 +315,7 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
entity.setBnljl(code.getBnljl());
|
|
entity.setBnljl(code.getBnljl());
|
|
entity.setTbzzs(code.getTbzzs());
|
|
entity.setTbzzs(code.getTbzzs());
|
|
entity.setRq(code.getRq());
|
|
entity.setRq(code.getRq());
|
|
-
|
|
|
|
|
|
+ entity.setDq(dq);
|
|
// 月内外贸完成量
|
|
// 月内外贸完成量
|
|
entity.setNmjzxttl(code.getNmjzxttl());
|
|
entity.setNmjzxttl(code.getNmjzxttl());
|
|
entity.setWmjzxttl(code.getWmjzxttl());
|
|
entity.setWmjzxttl(code.getWmjzxttl());
|
|
@@ -329,12 +351,13 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
entity.setNmxkphxs(code.getNmxkphxs());
|
|
entity.setNmxkphxs(code.getNmxkphxs());
|
|
entity.setNmtkhxs(code.getNmtkhxs());
|
|
entity.setNmtkhxs(code.getNmtkhxs());
|
|
|
|
|
|
- GkEntity szgk = new GkEntity();
|
|
|
|
- szgk.setId(szgkid);
|
|
|
|
- entity.setSzgk(szgk);
|
|
|
|
|
|
+ /*
|
|
|
|
+ * GkEntity szgk = new GkEntity(); szgk.setId(szgkid);
|
|
|
|
+ * entity.setSzgk(szgk);
|
|
|
|
+ */
|
|
|
|
|
|
entity = hxhbtjService.save(entity);
|
|
entity = hxhbtjService.save(entity);
|
|
-
|
|
|
|
|
|
+
|
|
if ("1".equals(path)) {
|
|
if ("1".equals(path)) {
|
|
entity.setRecordStatus(code.getRecordStatus());
|
|
entity.setRecordStatus(code.getRecordStatus());
|
|
}
|
|
}
|
|
@@ -488,12 +511,12 @@ public class HxhbtjCtl extends BaseWebCtl {
|
|
// 同步省级数据
|
|
// 同步省级数据
|
|
@RequestMapping(value = "/saveTbzt")
|
|
@RequestMapping(value = "/saveTbzt")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public WebJsonResult saveTbzt(Model model, String path, String spflag, String szgkid, String rq, HxhbtjEntity code) {
|
|
|
|
|
|
+ public WebJsonResult saveTbzt(Model model, String path, String spflag, String szgkid, String rq, HxhbtjEntity code, String dq) {
|
|
WebJsonResult wr = success();
|
|
WebJsonResult wr = success();
|
|
try {
|
|
try {
|
|
// HxhbtjEntity entity = hxhbtjService.findOne(id);
|
|
// HxhbtjEntity entity = hxhbtjService.findOne(id);
|
|
code.setRecordStatus(2);
|
|
code.setRecordStatus(2);
|
|
- wr = save(model, "1", szgkid, rq, code);
|
|
|
|
|
|
+ wr = save(model, "1", szgkid, rq, code, dq);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
wr.setMessage("提交失败");
|
|
wr.setMessage("提交失败");
|