|
@@ -30,6 +30,9 @@ import com.xt.jygl.accessory.entity.AccessoryEntity;
|
|
|
import com.xt.jygl.accessory.service.AccessoryService;
|
|
|
import com.xt.jygl.common.BaseWebCtl;
|
|
|
import com.xt.jygl.common.Constants;
|
|
|
+import com.xt.jygl.common.GlobalData;
|
|
|
+import com.xt.jygl.ftp.Ftp;
|
|
|
+import com.xt.jygl.ftp.FtpUtil;
|
|
|
import com.xt.jygl.gkjcxx.gk.service.GkService;
|
|
|
import com.xt.jygl.gkjcxx.gq.service.GqService;
|
|
|
import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
|
|
@@ -37,6 +40,7 @@ import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.service.GkjyrService;
|
|
|
import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzxxEntity;
|
|
|
import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzxxService;
|
|
|
import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxksq.service.XzjydyService;
|
|
|
+import com.xt.jygl.gkjygl.gklhxkgl.gkjylhsq.entity.LhsqEntity;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.entity.LhyxEntity;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.entity.LhyxfjEntity;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.service.LhyxService;
|
|
@@ -44,6 +48,7 @@ import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.service.LhyxfjService;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.vo.LhyxVo;
|
|
|
import com.xt.jygl.workflow.entity.TaskInfoEntity;
|
|
|
import com.xt.jygl.workflow.service.TaskInfoService;
|
|
|
+import com.xt.jygl.workflow.vo.TaskInfoVo;
|
|
|
import com.xtframe.core.anon.auth.RequiresPermissions;
|
|
|
import com.xtframe.core.base.ctl.WebJsonResult;
|
|
|
import com.xtframe.sec.common.BaseEntity;
|
|
@@ -134,6 +139,11 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
if (entity != null) {
|
|
|
BeanUtils.copyProperties(entity, vo);
|
|
|
if (entity.getRecordStatus() != 9) {
|
|
|
+ // 获取流程最新步骤
|
|
|
+ TaskInfoEntity info = taskInfoService.findByStep(entity.getId(), LhyxEntity.PROCESS_DEFINITION_KEY);
|
|
|
+ if (info != null) {
|
|
|
+ vo.setCurrentname(info.getCurrName());
|
|
|
+ }
|
|
|
if ((lhyxService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || lhyxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
|
|
|
List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), LhyxEntity.PROCESS_DEFINITION_KEY);
|
|
|
if (lists != null & lists.size() > 0) {
|
|
@@ -144,9 +154,18 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
vo.setTaskState(Constants.IS_MY_TASK);
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if ("1".equals(entity.getFlowstatus())) {
|
|
|
+ vo.setCurrentname("退回地市");
|
|
|
+ } else if ("2".equals(entity.getFlowstatus())) {
|
|
|
+ vo.setCurrentname("完成且数据已同步");
|
|
|
+ }
|
|
|
}
|
|
|
- voList.add(vo);
|
|
|
+
|
|
|
+ } else if (entity.getRecordStatus() == BaseEntity.RECORD_STATE_COMPLETED) {
|
|
|
+ vo.setCurrentname("完成");
|
|
|
}
|
|
|
+ voList.add(vo);
|
|
|
}
|
|
|
}
|
|
|
model.addAttribute("lczt", lczt);
|
|
@@ -157,6 +176,12 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
model.addAttribute("menuid", menuid);
|
|
|
// 翻页共通
|
|
|
putPageInfo(model, page, list);
|
|
|
+ // 判断省市区别
|
|
|
+ if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
|
|
|
+ model.addAttribute("ssFlag", "1");
|
|
|
+ } else {
|
|
|
+ model.addAttribute("ssFlag", "0");
|
|
|
+ }
|
|
|
return "gkjygl/gklhxkgl/gkjylhyx/lhyxmain";
|
|
|
}
|
|
|
|
|
@@ -184,7 +209,12 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
model.addAttribute("oneyear", nf);
|
|
|
nf = nf - 1;
|
|
|
model.addAttribute("twoyear", nf);
|
|
|
-
|
|
|
+ // 判断省市区别
|
|
|
+ if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
|
|
|
+ model.addAttribute("ssFlag", "1");
|
|
|
+ } else {
|
|
|
+ model.addAttribute("ssFlag", "0");
|
|
|
+ }
|
|
|
return "gkjygl/gklhxkgl/gkjylhyx/lhyxadd";
|
|
|
}
|
|
|
|
|
@@ -193,12 +223,93 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
public String view(Model model, String id, String flag, String opflag) {
|
|
|
model.addAttribute("flag", flag);
|
|
|
LhyxEntity lhyx = lhyxService.findOne(id);
|
|
|
-
|
|
|
+ model.addAttribute("record", lhyx);
|
|
|
List<LhyxfjEntity> list = lhyxfjService.findByYxid(lhyx.getId());
|
|
|
if (list != null && list.size() > 0) {
|
|
|
model.addAttribute("fjlist", list);
|
|
|
+ for (LhyxfjEntity fj : list) {
|
|
|
+ AccessoryEntity acc = accessoryService.findOne(fj.getFjid());
|
|
|
+ if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
|
|
|
+ try {
|
|
|
+ Ftp f = getftp();
|
|
|
+ // 本地目录
|
|
|
+ String localBaseDir = GlobalData.UPLOAD_FILE_PATH + acc.getFilepath();
|
|
|
+ File newfile = new File(localBaseDir);
|
|
|
+ // 如果文件夹不存在则创建
|
|
|
+ if (!newfile.exists() && !newfile.isDirectory()) {
|
|
|
+ newfile.mkdirs();
|
|
|
+ }
|
|
|
+ // 远程目录
|
|
|
+ String remoteBaseDir = acc.getFilepath();
|
|
|
+ // 下载ftp文件
|
|
|
+ boolean downflag = FtpUtil.startDown(f, localBaseDir, remoteBaseDir, acc.getFilename());
|
|
|
+ if (downflag) {
|
|
|
+ System.out.println("ok");
|
|
|
+ acc.setFjbz("1");
|
|
|
+ accessoryService.save(acc);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
- model.addAttribute("record", lhyx);
|
|
|
+
|
|
|
+ String roleCode = "";
|
|
|
+ String currName = "";
|
|
|
+ TaskInfoEntity taskinfo = taskInfoService.findByStep(id, LhyxEntity.PROCESS_DEFINITION_KEY);
|
|
|
+ if (taskinfo != null) {
|
|
|
+ if ("kssc".equals(taskinfo.getTaskKey())) {
|
|
|
+ roleCode = Constants.ROLE_FGLD;
|
|
|
+ currName = "分管领导审批";
|
|
|
+ } else if ("fgldsp".equals(taskinfo.getTaskKey())) {
|
|
|
+ roleCode = Constants.ROLE_LD;
|
|
|
+ currName = "领导批准";
|
|
|
+ } else if ("ldpz".equals(taskinfo.getTaskKey())) {
|
|
|
+ roleCode = Constants.YES;
|
|
|
+ }
|
|
|
+ model.addAttribute("taskKey", taskinfo.getTaskKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ model.addAttribute("currName", currName);
|
|
|
+ model.addAttribute("roleCode", roleCode);
|
|
|
+
|
|
|
+ List<TaskInfoEntity> slist = taskInfoService.findByBusIdAndBusKeyOrderByIdAsc(id, LhyxEntity.PROCESS_DEFINITION_KEY);
|
|
|
+ List<TaskInfoVo> volist = new ArrayList<TaskInfoVo>();
|
|
|
+ for (int i = 0; i < slist.size(); i++) {
|
|
|
+ TaskInfoEntity taskentity = slist.get(i);
|
|
|
+ TaskInfoVo opvo = new TaskInfoVo();
|
|
|
+ opvo.setCurrName(taskentity.getCurrName());
|
|
|
+ opvo.setTaskKey(taskentity.getTaskKey());
|
|
|
+ opvo.setState(taskentity.getState());
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String opStr = "";
|
|
|
+ int voflag = 0;
|
|
|
+ for (int j = 0; j < volist.size(); j++) {
|
|
|
+ TaskInfoVo taskvo = volist.get(j);
|
|
|
+ if (taskvo.getTaskKey().equals(taskentity.getTaskKey())) {
|
|
|
+ if ("2".equals(taskvo.getState())) {
|
|
|
+ opStr += taskvo.getYj();
|
|
|
+ }
|
|
|
+ voflag = j;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("2".equals(taskentity.getState())) {
|
|
|
+ opStr += "<div style = 'float:left;width:100%;text-align: left;'>" + taskentity.getAuditMsg() + "</div><div style = 'float:left;width:100%;text-align: right;'>" + taskentity.getAuditUsername() + "<br/>" + formatter.format(taskentity.getAuditTime()) + "</div>";
|
|
|
+ opvo.setYj(opStr);
|
|
|
+ } else {
|
|
|
+ opStr += "<div id='" + taskentity.getTaskKey() + "' style = 'float:left;width:100%;text-align: left;'>" + "</div><div style = 'float:left;width:100%;text-align: right;'>" + securityMgr.getCurrUser().getName() + "<br/>" + formatter.format(new Date()) + "</div>";
|
|
|
+ opvo.setYj(opStr);
|
|
|
+ }
|
|
|
+ if (voflag > 0) {
|
|
|
+ volist.remove(voflag);
|
|
|
+ }
|
|
|
+ volist.add(opvo);
|
|
|
+ }
|
|
|
+ model.addAttribute("list", volist);
|
|
|
return "gkjygl/gklhxkgl/gkjylhyx/lhyxview";
|
|
|
}
|
|
|
|
|
@@ -214,6 +325,14 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
if (list != null && list.size() > 0) {
|
|
|
model.addAttribute("fjlist", list);
|
|
|
}
|
|
|
+ // 判断省市区别
|
|
|
+ if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
|
|
|
+ model.addAttribute("ssFlag", "1");
|
|
|
+ } else {
|
|
|
+ model.addAttribute("ssFlag", "0");
|
|
|
+ model.addAttribute("roleCode", Constants.ROLE_KS);
|
|
|
+ model.addAttribute("currName", "科室审查");
|
|
|
+ }
|
|
|
return "gkjygl/gklhxkgl/gkjylhyx/lhyxedit";
|
|
|
}
|
|
|
|
|
@@ -236,6 +355,7 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
lhyxEntity.setLhll(code.getLhll());
|
|
|
lhyxEntity.setLxl(code.getLxl());
|
|
|
lhyxEntity.setLxll(code.getLxll());
|
|
|
+ lhyxEntity.setSftb(Constants.NO);
|
|
|
lhyxEntity = lhyxService.save(lhyxEntity);
|
|
|
} else {
|
|
|
code.setId(null);
|
|
@@ -246,6 +366,7 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
code.setSzgq(jyr.getSzgq());
|
|
|
code.setSzd(jyr.getSzd());
|
|
|
}
|
|
|
+ code.setSftb(Constants.NO);
|
|
|
lhyxEntity = lhyxService.save(code);
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(accid)) {
|
|
@@ -271,7 +392,7 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
// 保存
|
|
|
@RequestMapping(value = "/submit")
|
|
|
@ResponseBody
|
|
|
- public WebJsonResult submit(Model model, LhyxEntity code, String accid) {
|
|
|
+ public WebJsonResult submit(Model model, LhyxEntity code, String accid, String userids) {
|
|
|
WebJsonResult wr = success();
|
|
|
|
|
|
LhyxEntity lhyxEntity = new LhyxEntity();
|
|
@@ -289,7 +410,7 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
lhyxEntity.setLhll(code.getLhll());
|
|
|
lhyxEntity.setLxl(code.getLxl());
|
|
|
lhyxEntity.setLxll(code.getLxll());
|
|
|
- lhyxEntity = lhyxService.submit(lhyxEntity);
|
|
|
+ lhyxEntity = lhyxService.submit(lhyxEntity, userids);
|
|
|
} else {
|
|
|
GkjyrEntity jyr = gkjyrService.findOne(code.getJyrid());
|
|
|
if (jyr != null) {
|
|
@@ -297,7 +418,7 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
code.setSzgq(jyr.getSzgq());
|
|
|
code.setSzd(jyr.getSzd());
|
|
|
}
|
|
|
- lhyxEntity = lhyxService.submit(code);
|
|
|
+ lhyxEntity = lhyxService.submit(code, userids);
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(accid)) {
|
|
|
// 关联附件
|
|
@@ -311,7 +432,7 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
}
|
|
|
}
|
|
|
// rtx提醒
|
|
|
- rtxSend("", Constants.ROLE_KS, "你有一条理货延续待办事务,请及时处理!");
|
|
|
+ rtxSend(userids, "", "你有一条理货延续待办事务,请及时处理!");
|
|
|
} catch (Exception e) {
|
|
|
wr.setSuccess(false);
|
|
|
wr.setMessage("操作失败!");
|
|
@@ -322,7 +443,7 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
|
|
|
@RequestMapping(value = "/submitAudit")
|
|
|
@ResponseBody
|
|
|
- public WebJsonResult submitAudit(LhyxEntity code, String accid) {
|
|
|
+ public WebJsonResult submitAudit(LhyxEntity code, String accid, String userids) {
|
|
|
WebJsonResult wr = success();
|
|
|
LhyxEntity lhyxEntity = new LhyxEntity();
|
|
|
try {
|
|
@@ -349,9 +470,9 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
if (lhyxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), code.getId()) != null) {
|
|
|
lhyxService.claim(code.getId(), SecUtils.getCurrUser().getId().toString());
|
|
|
}
|
|
|
- lhyxService.changeAudit(null, lhyxEntity, true);
|
|
|
+ lhyxService.changeAudit(null, lhyxEntity, true, userids);
|
|
|
// rtx提醒
|
|
|
- rtxSend("", Constants.ROLE_KS, "你有一条理货延续待办事务,请及时处理!");
|
|
|
+ rtxSend(userids, "", "你有一条理货延续待办事务,请及时处理!");
|
|
|
} catch (Exception e) {
|
|
|
wr.setSuccess(false);
|
|
|
wr.setMessage("操作失败!");
|
|
@@ -441,36 +562,50 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
|
|
|
@RequestMapping(value = "/audit")
|
|
|
@ResponseBody
|
|
|
- public WebJsonResult audit(String shyj, String id, boolean flag) {
|
|
|
+ public WebJsonResult audit(String shyj, String id, boolean flag,String userids) {
|
|
|
WebJsonResult wr = success();
|
|
|
LhyxEntity entity = new LhyxEntity();
|
|
|
- String role = "";
|
|
|
try {
|
|
|
entity = lhyxService.findOne(id);
|
|
|
- List<TaskInfoEntity> list = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id, LhyxEntity.PROCESS_DEFINITION_KEY);
|
|
|
- if (list != null & list.size() > 0) {
|
|
|
- TaskInfoEntity taskinfo = list.get(0);
|
|
|
- if ("kssc".equals(taskinfo.getTaskKey())) {
|
|
|
- role = Constants.ROLE_FGLD;
|
|
|
- } else if ("fgldsp".equals(taskinfo.getTaskKey())) {
|
|
|
- role = Constants.ROLE_LD;
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- wr.setSuccess(false);
|
|
|
- wr.setMessage("id不能为空!");
|
|
|
- return wr;
|
|
|
- }
|
|
|
- try {
|
|
|
+ TaskInfoEntity info = taskInfoService.findByStep(entity.getId(), LhsqEntity.PROCESS_DEFINITION_KEY);
|
|
|
+
|
|
|
if (lhyxService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id) != null) {
|
|
|
lhyxService.claim(id, SecUtils.getCurrUser().getId().toString());
|
|
|
}
|
|
|
- boolean jflag = lhyxService.changeAudit(shyj, entity, flag);
|
|
|
+ boolean jflag = lhyxService.changeAudit(shyj, entity, flag,userids);
|
|
|
if (jflag) {
|
|
|
-
|
|
|
+ if (flag) {// 流程完成状态 2.审核通过1.退回地市
|
|
|
+ entity.setFlowstatus("2");
|
|
|
+ } else {
|
|
|
+ if (info != null && "sljbr".equals(info.getTaskKey())) {
|
|
|
+ entity.setFlowstatus("1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ entity.setSftb(Constants.YES);
|
|
|
+ entity = lhyxService.save(entity);
|
|
|
+ // 如果是省级审核通过或不通过后同步到市级
|
|
|
+ try {
|
|
|
+ List<LhyxfjEntity> fjlist = lhyxfjService.findByYxid(id);
|
|
|
+ String fjid = "";
|
|
|
+ if (fjlist != null && fjlist.size() > 0) {
|
|
|
+ for (LhyxfjEntity fj : fjlist) {
|
|
|
+ fjid = fjid + fj.getFjid() + ",";
|
|
|
+ }
|
|
|
+ fjid = fjid.substring(0, fjid.length() - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ String url = "/GK_OPERATION_JSJY_LHYX_ONE_PC?condition=ID=" + entity.getId()+";FJID="+fjid;
|
|
|
+ boolean tbflag = getTbStatus(url);
|
|
|
+ if (tbflag) {
|
|
|
+ entity.setTbzt("Y");
|
|
|
+ lhyxService.save(entity);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
} else {
|
|
|
// rtx提醒
|
|
|
- rtxSend("", role, "你有一条理货延续待办事务,请及时处理!");
|
|
|
+ rtxSend(userids, "", "你有一条理货延续待办事务,请及时处理!");
|
|
|
}
|
|
|
wr.setAttr("jflag", jflag);
|
|
|
} catch (Exception e) {
|
|
@@ -481,6 +616,36 @@ public class LhyxCtl extends BaseWebCtl {
|
|
|
return wr;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "/saveTbzt")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult saveTbzt(Model model, String id) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ LhyxEntity entity = lhyxService.findOne(id);
|
|
|
+ List<LhyxfjEntity> fjlist = lhyxfjService.findByYxid(id);
|
|
|
+ String fjid = "";
|
|
|
+ if (fjlist != null && fjlist.size() > 0) {
|
|
|
+ for (LhyxfjEntity fj : fjlist) {
|
|
|
+ fjid = fjid + fj.getFjid() + ",";
|
|
|
+ }
|
|
|
+ fjid = fjid.substring(0, fjid.length() - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ entity.setSftb(Constants.YES);
|
|
|
+ lhyxService.save(entity);
|
|
|
+ String url = "/GK_OPERATION_JSJY_LHYX_ONE_CP?condition=ID=" + id + ";FJID=" + fjid;
|
|
|
+
|
|
|
+ boolean flag = getTbStatus(url);
|
|
|
+ if (flag) {
|
|
|
+ entity.setFlowstatus("0");
|
|
|
+ entity.setTbzt(Constants.YES);
|
|
|
+ lhyxService.save(entity);
|
|
|
+ } else {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("提交失败");
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 签收
|
|
|
*
|