|
@@ -13,6 +13,7 @@ import javax.persistence.criteria.Root;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import org.activiti.engine.ActivitiException;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -39,7 +40,6 @@ import com.xt.jygl.gkjygl.gklhxkgl.gkjylhsq.entity.LhsqfjEntity;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhsq.service.LhsqService;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhsq.service.LhsqfjService;
|
|
|
import com.xt.jygl.gkjygl.gklhxkgl.gkjylhsq.vo.LhsqVo;
|
|
|
-import com.xt.jygl.gkjygl.gklhxkgl.gkjylhyx.entity.LhyxEntity;
|
|
|
import com.xt.jygl.workflow.entity.TaskInfoEntity;
|
|
|
import com.xt.jygl.workflow.service.TaskInfoService;
|
|
|
import com.xtframe.core.base.ctl.WebJsonResult;
|
|
@@ -328,4 +328,152 @@ public class LhsqCtl extends BaseWebCtl {
|
|
|
}
|
|
|
return wr;
|
|
|
}
|
|
|
+
|
|
|
+ // 保存
|
|
|
+ @RequestMapping(value = "/submit")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult submit(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 = lhsqService.findOne(code.getId());
|
|
|
+ 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 = lhsqService.submit(lhsqEntity);
|
|
|
+ } else {
|
|
|
+ GkjyrEntity jyr = gkjyrService.findOne(code.getJyrid());
|
|
|
+ if (jyr != null) {
|
|
|
+ code.setSzgk(jyr.getSzgk());
|
|
|
+ code.setSzgq(jyr.getSzgq());
|
|
|
+ code.setSzd(jyr.getSzd());
|
|
|
+ }
|
|
|
+ lhsqEntity = lhsqService.submit(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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // rtx提醒
|
|
|
+ // rtxSend(lhsqEntity.getSzgq().getId(), Constants.ROLE_CLSC,
|
|
|
+ // "你有一条许可证变更待办事务,请及时处理!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/submitAudit")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult submitAudit(LhsqEntity code, String accid) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ LhsqEntity lhsqEntity = new LhsqEntity();
|
|
|
+ try {
|
|
|
+ if (!StringUtils.isEmpty(code.getId())) {
|
|
|
+ lhsqEntity = lhsqService.findOne(code.getId());
|
|
|
+ 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 = lhsqService.save(lhsqEntity);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (lhsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), code.getId()) != null) {
|
|
|
+ lhsqService.claim(code.getId(), SecUtils.getCurrUser().getId().toString());
|
|
|
+ }
|
|
|
+ lhsqService.changeAudit(null, lhsqEntity, true);
|
|
|
+ // rtx提醒
|
|
|
+ // rtxSend(lhsqEntity.getSzgq().getId(), Constants.ROLE_CLSC,
|
|
|
+ // "你有一条许可证变更待办事务,请及时处理!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/audit")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult audit(String shyj, String id, boolean flag) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ LhsqEntity entity = new LhsqEntity();
|
|
|
+ try {
|
|
|
+ entity = lhsqService.findOne(id);
|
|
|
+ List<TaskInfoEntity> list = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id, LhsqEntity.PROCESS_DEFINITION_KEY);
|
|
|
+ if (list != null & list.size() > 0) {
|
|
|
+ TaskInfoEntity taskinfo = list.get(0);
|
|
|
+
|
|
|
+ lhsqService.save(entity);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("id不能为空!");
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (lhsqService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id) != null) {
|
|
|
+ lhsqService.claim(id, SecUtils.getCurrUser().getId().toString());
|
|
|
+ }
|
|
|
+ boolean jflag = lhsqService.changeAudit(shyj, entity, flag);
|
|
|
+ if (jflag) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // rtx提醒
|
|
|
+ // rtxSend(entity.getSzgq().getId(), role,
|
|
|
+ // "你有一条许可证变更待办事务,请及时处理!");
|
|
|
+ }
|
|
|
+ wr.setAttr("jflag", jflag);
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 签收
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void claim(LhsqEntity entity) {
|
|
|
+ try {
|
|
|
+ lhsqService.claim(entity.getId().toString(), SecUtils.getCurrUser().getId().toString());
|
|
|
+ } catch (ActivitiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|