|
@@ -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;
|
|
@@ -42,6 +45,7 @@ import com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.service.LhbgfjService;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.vo.LhbgVo;
|
|
|
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;
|
|
@@ -130,6 +134,11 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
if (entity != null) {
|
|
|
BeanUtils.copyProperties(entity, vo);
|
|
|
if (entity.getRecordStatus() != 9) {
|
|
|
+ // 获取流程最新步骤
|
|
|
+ TaskInfoEntity info = taskInfoService.findByStep(entity.getId(), LhbgEntity.PROCESS_DEFINITION_KEY);
|
|
|
+ if (info != null) {
|
|
|
+ vo.setCurrentname(info.getCurrName());
|
|
|
+ }
|
|
|
if ((lhbgService.getTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) || lhbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), entity.getId().toString()) != null) {
|
|
|
List<TaskInfoEntity> lists = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(entity.getId(), LhbgEntity.PROCESS_DEFINITION_KEY);
|
|
|
if (lists != null & lists.size() > 0) {
|
|
@@ -140,9 +149,18 @@ public class LhbgCtl 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);
|
|
@@ -153,12 +171,18 @@ public class LhbgCtl 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/gkjylhbg/lhbgmain";
|
|
|
}
|
|
|
|
|
|
// 新增
|
|
|
@RequestMapping(value = "/add")
|
|
|
- @RequiresPermissions("lhlh:add")
|
|
|
+ @RequiresPermissions("lhbg:add")
|
|
|
public String add(Model model) {
|
|
|
UserEntity user = securityMgr.getCurrUser();
|
|
|
GkjyrEntity jyr = new GkjyrEntity();
|
|
@@ -170,7 +194,12 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date today = new Date();
|
|
|
model.addAttribute("sqsj", dateTimeFormat.format(today));
|
|
|
-
|
|
|
+ // 判断省市区别
|
|
|
+ if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
|
|
|
+ model.addAttribute("ssFlag", "1");
|
|
|
+ } else {
|
|
|
+ model.addAttribute("ssFlag", "0");
|
|
|
+ }
|
|
|
return "gkjygl/gklhxkgl/gkjylhbg/lhbgadd";
|
|
|
}
|
|
|
|
|
@@ -183,8 +212,90 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
List<LhbgfjEntity> list = lhbgfjService.findByBgid(lhbg.getId());
|
|
|
if (list != null && list.size() > 0) {
|
|
|
model.addAttribute("fjlist", list);
|
|
|
+ for (LhbgfjEntity 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", lhbg);
|
|
|
+
|
|
|
+ String roleCode = "";
|
|
|
+ String currName = "";
|
|
|
+ TaskInfoEntity taskinfo = taskInfoService.findByStep(id, LhbgEntity.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, LhbgEntity.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/gkjylhbg/lhbgview";
|
|
|
}
|
|
|
|
|
@@ -200,6 +311,14 @@ public class LhbgCtl 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/gkjylhbg/lhbgedit";
|
|
|
}
|
|
|
|
|
@@ -217,6 +336,7 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
lhbgEntity.setCz(code.getCz());
|
|
|
lhbgEntity.setXbgdz(code.getXbgdz());
|
|
|
lhbgEntity.setXfddbr(code.getXfddbr());
|
|
|
+ lhbgEntity.setSftb(Constants.NO);
|
|
|
lhbgEntity = lhbgService.save(lhbgEntity);
|
|
|
} else {
|
|
|
code.setId(null);
|
|
@@ -227,6 +347,7 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
code.setSzgq(jyr.getSzgq());
|
|
|
code.setSzd(jyr.getSzd());
|
|
|
}
|
|
|
+ code.setSftb(Constants.NO);
|
|
|
lhbgEntity = lhbgService.save(code);
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(accid)) {
|
|
@@ -249,10 +370,40 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
return wr;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "/saveTbzt")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult saveTbzt(Model model, String id) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ LhbgEntity entity = lhbgService.findOne(id);
|
|
|
+ List<LhbgfjEntity> fjlist = lhbgfjService.findByBgid(id);
|
|
|
+ String fjid = "";
|
|
|
+ if (fjlist != null && fjlist.size() > 0) {
|
|
|
+ for (LhbgfjEntity fj : fjlist) {
|
|
|
+ fjid = fjid + fj.getFjid() + ",";
|
|
|
+ }
|
|
|
+ fjid = fjid.substring(0, fjid.length() - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ entity.setSftb(Constants.YES);
|
|
|
+ lhbgService.save(entity);
|
|
|
+ String url = "/GK_OPERATION_JSJY_LHBG_ONE_CP?condition=ID=" + id + ";FJID=" + fjid;
|
|
|
+
|
|
|
+ boolean flag = getTbStatus(url);
|
|
|
+ if (flag) {
|
|
|
+ entity.setFlowstatus("0");
|
|
|
+ entity.setTbzt(Constants.YES);
|
|
|
+ lhbgService.save(entity);
|
|
|
+ } else {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("提交失败");
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
// 保存
|
|
|
@RequestMapping(value = "/submit")
|
|
|
@ResponseBody
|
|
|
- public WebJsonResult submit(Model model, LhbgEntity code, String accid) {
|
|
|
+ public WebJsonResult submit(Model model, LhbgEntity code, String accid, String userids) {
|
|
|
WebJsonResult wr = success();
|
|
|
|
|
|
LhbgEntity lhbgEntity = new LhbgEntity();
|
|
@@ -264,7 +415,7 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
lhbgEntity.setCz(code.getCz());
|
|
|
lhbgEntity.setXbgdz(code.getXbgdz());
|
|
|
lhbgEntity.setXfddbr(code.getXfddbr());
|
|
|
- lhbgEntity = lhbgService.submit(lhbgEntity);
|
|
|
+ lhbgEntity = lhbgService.submit(lhbgEntity, userids);
|
|
|
} else {
|
|
|
|
|
|
GkjyrEntity jyr = gkjyrService.findOne(code.getJyrid());
|
|
@@ -274,7 +425,7 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
|
|
|
code.setSzd(jyr.getSzd());
|
|
|
}
|
|
|
- lhbgEntity = lhbgService.submit(code);
|
|
|
+ lhbgEntity = lhbgService.submit(code, userids);
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(accid)) {
|
|
|
// 关联附件
|
|
@@ -288,7 +439,7 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
}
|
|
|
}
|
|
|
// rtx提醒
|
|
|
- rtxSend("", Constants.ROLE_KS, "你有一条理货变更待办事务,请及时处理!");
|
|
|
+ rtxSend(userids, "", "你有一条理货变更待办事务,请及时处理!");
|
|
|
} catch (Exception e) {
|
|
|
wr.setSuccess(false);
|
|
|
wr.setMessage("操作失败!");
|
|
@@ -299,7 +450,7 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
|
|
|
@RequestMapping(value = "/submitAudit")
|
|
|
@ResponseBody
|
|
|
- public WebJsonResult submitAudit(LhbgEntity code, String[] jydyids, String accid, String mtids, String bwids, String cgids, String ckids, String dcids, String ryids, String sssbids, String qytzids, String zxjxids) {
|
|
|
+ public WebJsonResult submitAudit(LhbgEntity code, String[] jydyids, String accid, String userids, String mtids, String bwids, String cgids, String ckids, String dcids, String ryids, String sssbids, String qytzids, String zxjxids) {
|
|
|
WebJsonResult wr = success();
|
|
|
LhbgEntity lhbgEntity = new LhbgEntity();
|
|
|
try {
|
|
@@ -321,9 +472,9 @@ public class LhbgCtl extends BaseWebCtl {
|
|
|
if (lhbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), code.getId()) != null) {
|
|
|
lhbgService.claim(code.getId(), SecUtils.getCurrUser().getId().toString());
|
|
|
}
|
|
|
- lhbgService.changeAudit(null, lhbgEntity, true);
|
|
|
+ lhbgService.changeAudit(null, lhbgEntity, true, userids);
|
|
|
// rtx提醒
|
|
|
- rtxSend("", Constants.ROLE_KS, "你有一条理货变更待办事务,请及时处理!");
|
|
|
+ rtxSend(userids, "", "你有一条理货变更待办事务,请及时处理!");
|
|
|
} catch (Exception e) {
|
|
|
wr.setSuccess(false);
|
|
|
wr.setMessage("操作失败!");
|
|
@@ -414,36 +565,49 @@ public class LhbgCtl 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();
|
|
|
LhbgEntity entity = new LhbgEntity();
|
|
|
- String role = "";
|
|
|
try {
|
|
|
entity = lhbgService.findOne(id);
|
|
|
- List<TaskInfoEntity> list = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id, LhbgEntity.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(), LhbgEntity.PROCESS_DEFINITION_KEY);
|
|
|
+
|
|
|
if (lhbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id) != null) {
|
|
|
lhbgService.claim(id, SecUtils.getCurrUser().getId().toString());
|
|
|
}
|
|
|
- boolean jflag = lhbgService.changeAudit(shyj, entity, flag);
|
|
|
+ boolean jflag = lhbgService.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 = lhbgService.save(entity);
|
|
|
+ // 如果是省级审核通过或不通过后同步到市级
|
|
|
+ try {
|
|
|
+ List<LhbgfjEntity> fjlist = lhbgfjService.findByBgid(id);
|
|
|
+ String fjid = "";
|
|
|
+ if (fjlist != null && fjlist.size() > 0) {
|
|
|
+ for (LhbgfjEntity fj : fjlist) {
|
|
|
+ fjid = fjid + fj.getFjid() + ",";
|
|
|
+ }
|
|
|
+ fjid = fjid.substring(0, fjid.length() - 1);
|
|
|
+ }
|
|
|
+ String url = "/GK_OPERATION_JSJY_LHBG_ONE_PC?condition=ID=" + entity.getId()+";FJID="+fjid;
|
|
|
+ boolean tbflag = getTbStatus(url);
|
|
|
+ if (tbflag) {
|
|
|
+ entity.setTbzt("Y");
|
|
|
+ lhbgService.save(entity);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
} else {
|
|
|
// rtx提醒
|
|
|
- rtxSend("", role, "你有一条理货变更待办事务,请及时处理!");
|
|
|
+ rtxSend(userids, "", "你有一条理货变更待办事务,请及时处理!");
|
|
|
}
|
|
|
wr.setAttr("jflag", jflag);
|
|
|
} catch (Exception e) {
|