|
@@ -426,6 +426,96 @@ public class LhsqCtl extends BaseWebCtl {
|
|
|
return wr;
|
|
|
}
|
|
|
|
|
|
+ // 保存
|
|
|
+ @RequestMapping(value = "/saveTb")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult saveTb(Model model, LhsqEntity code, String accid) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ LhsqEntity lhsqEntity = new LhsqEntity();
|
|
|
+ try {
|
|
|
+ if (!StringUtils.isEmpty(code.getId())) {
|
|
|
+ lhsqEntity = lhsqService.findOne(code.getId());
|
|
|
+ lhsqEntity.setSqr(code.getSqr());
|
|
|
+ lhsqEntity.setSqnr(code.getSqnr());
|
|
|
+ lhsqEntity.setSqrdz(code.getSqrdz());
|
|
|
+ lhsqEntity.setSqrqz(code.getSqrqz());
|
|
|
+ lhsqEntity.setSqrlxfs(code.getSqrlxfs());
|
|
|
+ lhsqEntity.setSqryzbm(code.getSqryzbm());
|
|
|
+ lhsqEntity.setWtdlrlxfs(code.getWtdlrlxfs());
|
|
|
+ lhsqEntity.setWtdlrxm(code.getWtdlrxm());
|
|
|
+ lhsqEntity.setGdmc(code.getGdmc());
|
|
|
+ lhsqEntity.setZcd(code.getZcd());
|
|
|
+ lhsqEntity.setTzgb(code.getTzgb());
|
|
|
+ lhsqEntity.setLxr(code.getLxr());
|
|
|
+ lhsqEntity.setLxdh(code.getLxdh());
|
|
|
+ lhsqEntity.setYgzs(code.getYgzs());
|
|
|
+ lhsqEntity.setLhys(code.getLhys());
|
|
|
+ lhsqEntity.setYysr(code.getYysr());
|
|
|
+ lhsqEntity.setYysrr(code.getYysrr());
|
|
|
+ lhsqEntity.setLhl(code.getLhl());
|
|
|
+ lhsqEntity.setLhll(code.getLhll());
|
|
|
+ lhsqEntity.setLxl(code.getLxl());
|
|
|
+ lhsqEntity.setLxll(code.getLxll());
|
|
|
+ lhsqEntity.setSftb(Constants.NO);
|
|
|
+ lhsqEntity = lhsqService.save(lhsqEntity);
|
|
|
+ } else {
|
|
|
+ code.setId(null);
|
|
|
+ code.setSqrq(new Date());
|
|
|
+ GkjyrEntity jyr = gkjyrService.findOne(code.getJyrid());
|
|
|
+ if (jyr != null) {
|
|
|
+ code.setSzgk(jyr.getSzgk());
|
|
|
+ code.setSzgq(jyr.getSzgq());
|
|
|
+ code.setSzd(jyr.getSzd());
|
|
|
+ }
|
|
|
+ code.setSftb(Constants.NO);
|
|
|
+ lhsqEntity = lhsqService.save(code);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(accid)) {
|
|
|
+ // 关联附件
|
|
|
+ String[] ssids = accid.split(",");
|
|
|
+ for (String ssid : ssids) {
|
|
|
+ LhsqfjEntity fj = lhsqfjService.findOne(ssid);
|
|
|
+ if (fj != null) {
|
|
|
+ fj.setSqid(lhsqEntity.getId());
|
|
|
+ lhsqfjService.save(fj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<LhsqfjEntity> fjlist = lhsqfjService.findBySqid(lhsqEntity.getId());
|
|
|
+ String fjid = "";
|
|
|
+ if (fjlist != null && fjlist.size() > 0) {
|
|
|
+ for (LhsqfjEntity fj : fjlist) {
|
|
|
+ fjid = fjid + fj.getFjid() + ",";
|
|
|
+ }
|
|
|
+ fjid = fjid.substring(0, fjid.length() - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ lhsqEntity.setSftb(Constants.YES);
|
|
|
+ lhsqService.save(lhsqEntity);
|
|
|
+ String url = "/GK_OPERATION_JSJY_LHSQ_ONE_CP?condition=ID=" + lhsqEntity.getId() + ";FJID=" + fjid;
|
|
|
+
|
|
|
+ boolean flag = getTbStatus(url);
|
|
|
+ if (flag) {
|
|
|
+ lhsqEntity.setFlowstatus("0");
|
|
|
+ lhsqEntity.setTbzt(Constants.YES);
|
|
|
+ lhsqService.save(lhsqEntity);
|
|
|
+ } else {
|
|
|
+ lhsqEntity.setFlowstatus(null);
|
|
|
+ lhsqEntity.setTbzt(Constants.NO);
|
|
|
+ lhsqService.save(lhsqEntity);
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("转报省局失败");
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 保存附件
|
|
|
@RequestMapping(value = "/saveFile")
|
|
|
@ResponseBody
|