|
@@ -0,0 +1,504 @@
|
|
|
+package com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.ctl;
|
|
|
+
|
|
|
+import java.io.File;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import javax.persistence.criteria.CriteriaBuilder;
|
|
|
+import javax.persistence.criteria.CriteriaQuery;
|
|
|
+import javax.persistence.criteria.Predicate;
|
|
|
+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;
|
|
|
+import org.springframework.data.jpa.domain.Specification;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.Model;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+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.gkjcxx.gk.service.GkService;
|
|
|
+import com.xt.jygl.gkjcxx.gq.service.GqService;
|
|
|
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
|
|
|
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.service.GkjyrService;
|
|
|
+import com.xt.jygl.gkjygl.gkjyxkgl.gkjyxksq.service.XzjydyService;
|
|
|
+import com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.entity.LhbgEntity;
|
|
|
+import com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.entity.LhbgfjEntity;
|
|
|
+import com.xt.jygl.gkjygl.gklhxkgl.gkjylhbg.service.LhbgService;
|
|
|
+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.xtframe.core.anon.auth.RequiresPermissions;
|
|
|
+import com.xtframe.core.base.ctl.WebJsonResult;
|
|
|
+import com.xtframe.sec.common.BaseEntity;
|
|
|
+import com.xtframe.sec.common.QueryService;
|
|
|
+import com.xtframe.sec.common.SimplePageRequest;
|
|
|
+import com.xtframe.sec.user.entity.UserEntity;
|
|
|
+import com.xtframe.sec.utils.SecUtils;
|
|
|
+import com.xtframe.util.StringUtils;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 理货管理Controller
|
|
|
+ *
|
|
|
+ * @author xuhx
|
|
|
+ *
|
|
|
+ */
|
|
|
+@Controller
|
|
|
+@RequestMapping("/lhbg")
|
|
|
+public class LhbgCtl extends BaseWebCtl {
|
|
|
+ @Autowired
|
|
|
+ private QueryService query;
|
|
|
+ @Autowired
|
|
|
+ private LhbgService lhbgService;
|
|
|
+ @Autowired
|
|
|
+ private GkjyrService gkjyrService;
|
|
|
+ @Autowired
|
|
|
+ private XzjydyService xzjydyService;
|
|
|
+ @Autowired
|
|
|
+ private TaskInfoService taskInfoService;
|
|
|
+ @Autowired
|
|
|
+ private GkService gkService;
|
|
|
+ @Autowired
|
|
|
+ private GqService gqService;
|
|
|
+ @Autowired
|
|
|
+ private LhbgfjService lhbgfjService;
|
|
|
+ @Autowired
|
|
|
+ private AccessoryService accessoryService;
|
|
|
+
|
|
|
+ @RequestMapping(value = "/main")
|
|
|
+ public String main(SimplePageRequest page, Model model, final String lczt, final String szdid, final String szgkid, final String szgqid, final String gkjyr, final String fddbr, final String bgdd, String menuid) throws JsonProcessingException {
|
|
|
+ UserEntity user = securityMgr.getCurrUser();
|
|
|
+ GkjyrEntity jyr = new GkjyrEntity();
|
|
|
+ if (!StringUtils.isEmpty(user.getSsjyr())) {
|
|
|
+ jyr = user.getSsjyr();
|
|
|
+ model.addAttribute("jyr", jyr);
|
|
|
+ }
|
|
|
+ model.addAttribute("user", user);
|
|
|
+
|
|
|
+ // 查询条件
|
|
|
+ Specification<LhbgEntity> spec = new Specification<LhbgEntity>() {
|
|
|
+ @Override
|
|
|
+ public Predicate toPredicate(Root<LhbgEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
+ List<Predicate> list = new ArrayList<Predicate>();
|
|
|
+ if (StringUtils.isNotEmpty(szdid)) {
|
|
|
+ list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + szdid + "%"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(szgkid)) {
|
|
|
+ list.add(cb.like(root.get("szgk").get("id").as(String.class), "%" + szgkid + "%"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(szgqid)) {
|
|
|
+ list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + szgqid + "%"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(gkjyr)) {
|
|
|
+ list.add(cb.like(root.get("jyrmc").as(String.class), "%" + gkjyr + "%"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(fddbr)) {
|
|
|
+ list.add(cb.like(root.get("fddbr").as(String.class), "%" + fddbr + "%"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(bgdd)) {
|
|
|
+ list.add(cb.like(root.get("bgdd").as(String.class), "%" + bgdd + "%"));
|
|
|
+ }
|
|
|
+
|
|
|
+ list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
|
|
|
+ // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
|
|
|
+ /*
|
|
|
+ * if (!isJyr()) { //
|
|
|
+ * list.add(cb.like(root.get("szd").get("id").as(String.class),
|
|
|
+ * // "%" + SecUtils.getCurrUser().getSzd().getId() + "%"));
|
|
|
+ *
|
|
|
+ * In<String> in =
|
|
|
+ * cb.in(root.get("szgq").get("id").as(String.class));
|
|
|
+ * List<String> gqlist = (List<String>)
|
|
|
+ * Utils.getSession().getAttribute("gqList"); if (gqlist != null
|
|
|
+ * && gqlist.size() > 0) { for (int i = 0; i < gqlist.size();
|
|
|
+ * i++) { in.value(gqlist.get(i)); } list.add(in); }
|
|
|
+ *
|
|
|
+ * } else { Subquery<GkjyrEntity> subquery =
|
|
|
+ * query.subquery(GkjyrEntity.class); Root<GkjyrEntity> dpRoot =
|
|
|
+ * subquery.from(GkjyrEntity.class); subquery.select(dpRoot);
|
|
|
+ * List<Predicate> subQueryPredicates = new
|
|
|
+ * ArrayList<Predicate>();
|
|
|
+ * subQueryPredicates.add(cb.equal(root.get
|
|
|
+ * ("jyrid").as(String.class),
|
|
|
+ * dpRoot.get("id").as(String.class)));
|
|
|
+ * subQueryPredicates.add(cb
|
|
|
+ * .equal(dpRoot.get("yjyrid").as(String.class),
|
|
|
+ * getSsjyr().getId()));
|
|
|
+ * subquery.where(subQueryPredicates.toArray(new Predicate[]
|
|
|
+ * {})); list.add(cb.exists(subquery)); }
|
|
|
+ */
|
|
|
+
|
|
|
+ return cb.and(list.toArray(new Predicate[] {}));
|
|
|
+ }
|
|
|
+ };
|
|
|
+ Page<LhbgEntity> list = query.findAll(spec, toPageRequest(page), LhbgEntity.class);
|
|
|
+ List<LhbgVo> voList = new ArrayList<LhbgVo>();
|
|
|
+ for (LhbgEntity entity : list) {
|
|
|
+ LhbgVo vo = new LhbgVo();
|
|
|
+ if (entity != null) {
|
|
|
+ BeanUtils.copyProperties(entity, vo);
|
|
|
+ if (entity.getRecordStatus() != 9) {
|
|
|
+ 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) {
|
|
|
+ TaskInfoEntity taskinfo = lists.get(0);
|
|
|
+ if ("申请".equals(taskinfo.getCurrName())) {
|
|
|
+ vo.setTaskState("TH");
|
|
|
+ } else {
|
|
|
+ vo.setTaskState(Constants.IS_MY_TASK);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ voList.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ model.addAttribute("lczt", lczt);
|
|
|
+ model.addAttribute("gkjyr", gkjyr);
|
|
|
+ model.addAttribute("fddbr", fddbr);
|
|
|
+ model.addAttribute("bgdd", bgdd);
|
|
|
+ model.addAttribute("list", voList);
|
|
|
+ model.addAttribute("menuid", menuid);
|
|
|
+ // 翻页共通
|
|
|
+ putPageInfo(model, page, list);
|
|
|
+ return "gkjygl/gklhxkgl/gkjylhbg/lhbgmain";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 时间格式化
|
|
|
+ private String transFormatDate(Date d) {
|
|
|
+ if (d == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ return sdf.format(d);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 新增
|
|
|
+ @RequestMapping(value = "/add")
|
|
|
+ public String add(Model model) {
|
|
|
+ UserEntity user = securityMgr.getCurrUser();
|
|
|
+ GkjyrEntity jyr = new GkjyrEntity();
|
|
|
+ if (user.getSsjyr() != null) {
|
|
|
+ jyr = gkjyrService.findOne(user.getSsjyr().getId());
|
|
|
+ }
|
|
|
+ model.addAttribute("gkjyr", jyr);
|
|
|
+ model.addAttribute("sqr", user.getName());
|
|
|
+ SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Date today = new Date();
|
|
|
+ model.addAttribute("sqsj", dateTimeFormat.format(today));
|
|
|
+
|
|
|
+ return "gkjygl/gklhxkgl/gkjylhbg/lhbgadd";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 新增
|
|
|
+ @RequestMapping(value = "/view")
|
|
|
+ public String view(Model model, String id, String flag, String opflag) {
|
|
|
+ model.addAttribute("flag", flag);
|
|
|
+ LhbgEntity lhbg = lhbgService.findOne(id);
|
|
|
+
|
|
|
+ List<LhbgfjEntity> list = lhbgfjService.findByBgid(lhbg.getId());
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ model.addAttribute("fjlist", list);
|
|
|
+ }
|
|
|
+ model.addAttribute("record", lhbg);
|
|
|
+ return "gkjygl/gklhxkgl/gkjylhbg/lhbgview";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 新增
|
|
|
+ @RequestMapping(value = "/edit")
|
|
|
+ public String edit(Model model, String id, String flag) {
|
|
|
+ model.addAttribute("flag", flag);
|
|
|
+ LhbgEntity lhbg = lhbgService.findOne(id);
|
|
|
+ model.addAttribute("record", lhbg);
|
|
|
+
|
|
|
+ List<LhbgfjEntity> list = lhbgfjService.findByBgid(lhbg.getId());
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ model.addAttribute("fjlist", list);
|
|
|
+ }
|
|
|
+ return "gkjygl/gklhxkgl/gkjylhbg/lhbgedit";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 保存
|
|
|
+ @RequestMapping(value = "/save")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult save(Model model, LhbgEntity code, String accid) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ LhbgEntity lhbgEntity = new LhbgEntity();
|
|
|
+ try {
|
|
|
+ if (!StringUtils.isEmpty(code.getId())) {
|
|
|
+ lhbgEntity = lhbgService.findOne(code.getId());
|
|
|
+ lhbgEntity.setLxr(code.getLxr());
|
|
|
+ lhbgEntity.setDh(code.getDh());
|
|
|
+ lhbgEntity.setCz(code.getCz());
|
|
|
+ lhbgEntity.setXbgdz(code.getXbgdz());
|
|
|
+ lhbgEntity.setXfddbr(code.getXfddbr());
|
|
|
+ lhbgEntity = lhbgService.save(lhbgEntity);
|
|
|
+ } else {
|
|
|
+ code.setId(null);
|
|
|
+ code.setSqrq(new Date());
|
|
|
+ lhbgEntity.setYbgdz(code.getYbgdz());
|
|
|
+ lhbgEntity.setYfddbr(code.getYfddbr());
|
|
|
+ lhbgEntity.setXbgdz(code.getXbgdz());
|
|
|
+ lhbgEntity.setXfddbr(code.getXfddbr());
|
|
|
+ GkjyrEntity jyr = gkjyrService.findOne(code.getJyrid());
|
|
|
+ if (jyr != null) {
|
|
|
+ code.setSzgk(jyr.getSzgk());
|
|
|
+ code.setSzgq(jyr.getSzgq());
|
|
|
+ code.setSzd(jyr.getSzd());
|
|
|
+ }
|
|
|
+ lhbgEntity = lhbgService.save(code);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(accid)) {
|
|
|
+ // 关联附件
|
|
|
+ String[] ssids = accid.split(",");
|
|
|
+ for (String ssid : ssids) {
|
|
|
+ LhbgfjEntity fj = lhbgfjService.findOne(ssid);
|
|
|
+ if (fj != null) {
|
|
|
+ fj.setBgid(lhbgEntity.getId());
|
|
|
+ lhbgfjService.save(fj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 保存
|
|
|
+ @RequestMapping(value = "/submit")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult submit(Model model, LhbgEntity code, String accid) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+
|
|
|
+ LhbgEntity lhbgEntity = new LhbgEntity();
|
|
|
+ try {
|
|
|
+ if (!StringUtils.isEmpty(code.getId())) {
|
|
|
+ lhbgEntity = lhbgService.findOne(code.getId());
|
|
|
+ lhbgEntity.setXbgdz(code.getXbgdz());
|
|
|
+ lhbgEntity.setXfddbr(code.getXfddbr());
|
|
|
+
|
|
|
+ lhbgEntity = lhbgService.submit(lhbgEntity);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ GkjyrEntity jyr = gkjyrService.findOne(code.getJyrid());
|
|
|
+ if (jyr != null) {
|
|
|
+ code.setSzgk(jyr.getSzgk());
|
|
|
+ code.setSzgq(jyr.getSzgq());
|
|
|
+
|
|
|
+ code.setSzd(jyr.getSzd());
|
|
|
+ }
|
|
|
+ lhbgEntity = lhbgService.submit(code);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(accid)) {
|
|
|
+ // 关联附件
|
|
|
+ String[] ssids = accid.split(",");
|
|
|
+ for (String ssid : ssids) {
|
|
|
+ LhbgfjEntity fj = lhbgfjService.findOne(ssid);
|
|
|
+ if (fj != null) {
|
|
|
+ fj.setBgid(lhbgEntity.getId());
|
|
|
+ lhbgfjService.save(fj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // rtx提醒
|
|
|
+ // rtxSend(lhbgEntity.getSzgq().getId(), Constants.ROLE_CLSC,
|
|
|
+ // "你有一条许可证变更待办事务,请及时处理!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ @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) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ LhbgEntity lhbgEntity = new LhbgEntity();
|
|
|
+ try {
|
|
|
+ if (!StringUtils.isEmpty(code.getId())) {
|
|
|
+ lhbgEntity = lhbgService.findOne(code.getId());
|
|
|
+ lhbgEntity.setXbgdz(code.getXbgdz());
|
|
|
+ lhbgEntity.setXfddbr(code.getXfddbr());
|
|
|
+ lhbgEntity = lhbgService.save(lhbgEntity);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (lhbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), code.getId()) != null) {
|
|
|
+ lhbgService.claim(code.getId(), SecUtils.getCurrUser().getId().toString());
|
|
|
+ }
|
|
|
+ lhbgService.changeAudit(null, lhbgEntity, true);
|
|
|
+ // rtx提醒
|
|
|
+ // rtxSend(lhbgEntity.getSzgq().getId(), Constants.ROLE_CLSC,
|
|
|
+ // "你有一条许可证变更待办事务,请及时处理!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 删除
|
|
|
+ @RequestMapping(value = "/delete")
|
|
|
+ @ResponseBody
|
|
|
+ @RequiresPermissions("gkjyxkbg:delete")
|
|
|
+ public WebJsonResult logicdelete(Model model, String id) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ try {
|
|
|
+ // 逻辑删除
|
|
|
+ lhbgService.logicDelete(id);
|
|
|
+ LhbgEntity entity = lhbgService.findOne(id);
|
|
|
+ GkjyrEntity gkjyr = gkjyrService.findOne(entity.getJyrid());
|
|
|
+ gkjyr.setRecordStatus(BaseEntity.RECORD_STATE_VALID);
|
|
|
+ gkjyrService.save(gkjyr);
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("操作失败!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 保存附件
|
|
|
+ @RequestMapping(value = "/saveFile")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult saveFile(@RequestParam("file") List<MultipartFile> file, String sfbx, Model model, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ if (file != null && file.size() > 0) {
|
|
|
+ LhbgfjEntity fjEntity = new LhbgfjEntity();
|
|
|
+ for (int i = 0; i < file.size(); i++) {
|
|
|
+ MultipartFile f = file.get(i);
|
|
|
+ if (f.getSize() > 0) {
|
|
|
+ AccessoryEntity acc = accessoryService.saveFile(f, "lhbg");
|
|
|
+ if (acc != null) {
|
|
|
+ fjEntity.setFjid(acc.getId());
|
|
|
+ fjEntity.setFjmc(acc.getName());
|
|
|
+ fjEntity = lhbgfjService.save(fjEntity);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wr.setAttr("acc", fjEntity);
|
|
|
+ } else {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("请上传附件!");
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除附件
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/delFj")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult delFj(String[] ids) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ try {
|
|
|
+ for (String id : ids) {
|
|
|
+ LhbgfjEntity entity = lhbgfjService.findOne(id);
|
|
|
+ if (entity != null) {
|
|
|
+ AccessoryEntity acc = accessoryService.findOne(entity.getFjid());
|
|
|
+ if (acc != null) {
|
|
|
+ accessoryService.delete(acc);
|
|
|
+ if (entity != null) {
|
|
|
+ String path = acc.getFilepath() + acc.getFilename();
|
|
|
+ File file = new File(path);
|
|
|
+ if (file.isFile() && file.exists()) {
|
|
|
+ file.delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lhbgfjService.delete(entity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ }
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/audit")
|
|
|
+ @ResponseBody
|
|
|
+ public WebJsonResult audit(String shyj, String id, boolean flag) {
|
|
|
+ WebJsonResult wr = success();
|
|
|
+ UserEntity user = securityMgr.getCurrUser();
|
|
|
+ LhbgEntity entity = new LhbgEntity();
|
|
|
+ String role = "";
|
|
|
+ try {
|
|
|
+ entity = lhbgService.findOne(id);
|
|
|
+ Date today = new Date();
|
|
|
+ List<TaskInfoEntity> list = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id, LhbgEntity.PROCESS_DEFINITION_KEY);
|
|
|
+ if (list != null & list.size() > 0) {
|
|
|
+ TaskInfoEntity taskinfo = list.get(0);
|
|
|
+
|
|
|
+ lhbgService.save(entity);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ wr.setSuccess(false);
|
|
|
+ wr.setMessage("id不能为空!");
|
|
|
+ return wr;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (lhbgService.getCandidateTaskByUserAndBusKey(SecUtils.getCurrUser().getId().toString(), id) != null) {
|
|
|
+ lhbgService.claim(id, SecUtils.getCurrUser().getId().toString());
|
|
|
+ }
|
|
|
+ boolean jflag = lhbgService.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(LhbgEntity entity) {
|
|
|
+ try {
|
|
|
+ lhbgService.claim(entity.getId().toString(), SecUtils.getCurrUser().getId().toString());
|
|
|
+ } catch (ActivitiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|