Przeglądaj źródła

git-svn-id: https://192.168.57.71/svn/jsgkj@235 931142cf-59ea-a443-aa0e-51397b428577

ld_xuhx 9 lat temu
rodzic
commit
833a7b566d

+ 6 - 12
gkjsjy/trunk/src/com/xt/jygl/gkjygl/gklhxkgl/gkjylhbg/ctl/LhbgCtl.java

@@ -178,15 +178,6 @@ public class LhbgCtl extends BaseWebCtl {
 		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) {
@@ -288,9 +279,11 @@ public class LhbgCtl extends BaseWebCtl {
 		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.submit(lhbgEntity);
 			} else {
 
@@ -333,6 +326,9 @@ public class LhbgCtl extends BaseWebCtl {
 		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);
@@ -442,9 +438,7 @@ public class LhbgCtl extends BaseWebCtl {
 	@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();

+ 3 - 8
gkjsjy/trunk/src/com/xt/jygl/gkjygl/gklhxkgl/gkjylhbg/service/impl/LhbgServiceImpl.java

@@ -48,15 +48,10 @@ public class LhbgServiceImpl extends BaseWorkFlowServiceImpl<LhbgEntity, String>
 		} else {
 			entity.setRecordStatus(BaseEntity.RECORD_STATE_SUBMIT);
 			entity = this.save(entity);
-			String gqid = "";
-			if (securityMgr.getCurrUser().getSfjyr().getText().equals("是")) {
-				gqid = entity.getSzgq().getId();
-			}
 			Map<String, Object> variables = new HashMap<String, Object>();
-			variables.put("role_clsc", Constants.ROLE_CLSC + ":" + gqid);
-			variables.put("role_hc", Constants.ROLE_HC + ":" + gqid);
-			variables.put("role_fh", Constants.ROLE_FH + ":" + gqid);
-			variables.put("role_sp", Constants.ROLE_SP + ":" + gqid);
+			variables.put("role_ks", Constants.ROLE_LD);
+			variables.put("role_fgld", Constants.ROLE_LD);
+			variables.put("role_ld", Constants.ROLE_LD);
 			WorkFlowParam param = new WorkFlowParam();
 			param.put(WorkFlowParam.DESCRIPTION, entity.getJyrmc() + "的理货变更");
 

+ 149 - 1
gkjsjy/trunk/src/com/xt/jygl/gkjygl/gklhxkgl/gkjylhsq/ctl/LhsqCtl.java

@@ -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();
+		}
+	}
+
 }

+ 1 - 1
gkjsjy/trunk/src/com/xt/jygl/gkjygl/gklhxkgl/gkjylhsq/entity/LhsqEntity.java

@@ -25,7 +25,7 @@ public class LhsqEntity extends BaseEntity<String> implements Cloneable {
 	 */
 	private static final long serialVersionUID = 5726376213442414828L;
 
-	public static final String PROCESS_DEFINITION_KEY = "gklhxkgl";
+	public static final String PROCESS_DEFINITION_KEY = "lhsq";
 	private String id = null;
 	// 经营人ID
 	private String jyrid = null;

+ 3 - 8
gkjsjy/trunk/src/com/xt/jygl/gkjygl/gklhxkgl/gkjylhsq/service/impl/LhsqServiceImpl.java

@@ -48,15 +48,10 @@ public class LhsqServiceImpl extends BaseWorkFlowServiceImpl<LhsqEntity, String>
 		} else {
 			entity.setRecordStatus(BaseEntity.RECORD_STATE_SUBMIT);
 			entity = this.save(entity);
-			String gqid = "";
-			if (securityMgr.getCurrUser().getSfjyr().getText().equals("是")) {
-				gqid = entity.getSzgq().getId();
-			}
 			Map<String, Object> variables = new HashMap<String, Object>();
-			variables.put("role_clsc", Constants.ROLE_CLSC + ":" + gqid);
-			variables.put("role_hc", Constants.ROLE_HC + ":" + gqid);
-			variables.put("role_fh", Constants.ROLE_FH + ":" + gqid);
-			variables.put("role_sp", Constants.ROLE_SP + ":" + gqid);
+			variables.put("role_ks", Constants.ROLE_LD);
+			variables.put("role_fgld", Constants.ROLE_LD);
+			variables.put("role_ld", Constants.ROLE_LD);
 			WorkFlowParam param = new WorkFlowParam();
 			param.put(WorkFlowParam.DESCRIPTION, entity.getJyrmc() + "的理货申请");
 

+ 22 - 9
gkjsjy/trunk/src/com/xt/jygl/gkjygl/gklhxkgl/gkjylhyx/ctl/LhyxCtl.java

@@ -44,7 +44,6 @@ 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.xtframe.core.anon.auth.RequiresPermissions;
 import com.xtframe.core.base.ctl.WebJsonResult;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
@@ -274,15 +273,23 @@ public class LhyxCtl extends BaseWebCtl {
 		try {
 			if (!StringUtils.isEmpty(code.getId())) {
 				lhyxEntity = lhyxService.findOne(code.getId());
-
+				lhyxEntity = lhyxService.findOne(code.getId());
+				lhyxEntity.setLxr(code.getLxr());
+				lhyxEntity.setLxdh(code.getLxdh());
+				lhyxEntity.setYgzs(code.getYgzs());
+				lhyxEntity.setLhys(code.getLhys());
+				lhyxEntity.setYysr(code.getYysr());
+				lhyxEntity.setYysrr(code.getYysrr());
+				lhyxEntity.setLhl(code.getLhl());
+				lhyxEntity.setLhll(code.getLhll());
+				lhyxEntity.setLxl(code.getLxl());
+				lhyxEntity.setLxll(code.getLxll());
 				lhyxEntity = lhyxService.submit(lhyxEntity);
 			} else {
-
 				GkjyrEntity jyr = gkjyrService.findOne(code.getJyrid());
 				if (jyr != null) {
 					code.setSzgk(jyr.getSzgk());
 					code.setSzgq(jyr.getSzgq());
-
 					code.setSzd(jyr.getSzd());
 				}
 				lhyxEntity = lhyxService.submit(code);
@@ -311,13 +318,22 @@ public class LhyxCtl extends BaseWebCtl {
 
 	@RequestMapping(value = "/submitAudit")
 	@ResponseBody
-	public WebJsonResult submitAudit(LhyxEntity 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(LhyxEntity code,  String accid) {
 		WebJsonResult wr = success();
 		LhyxEntity lhyxEntity = new LhyxEntity();
 		try {
 			if (!StringUtils.isEmpty(code.getId())) {
 				lhyxEntity = lhyxService.findOne(code.getId());
-
+				lhyxEntity.setLxr(code.getLxr());
+				lhyxEntity.setLxdh(code.getLxdh());
+				lhyxEntity.setYgzs(code.getYgzs());
+				lhyxEntity.setLhys(code.getLhys());
+				lhyxEntity.setYysr(code.getYysr());
+				lhyxEntity.setYysrr(code.getYysrr());
+				lhyxEntity.setLhl(code.getLhl());
+				lhyxEntity.setLhll(code.getLhll());
+				lhyxEntity.setLxl(code.getLxl());
+				lhyxEntity.setLxll(code.getLxll());
 				lhyxEntity = lhyxService.save(lhyxEntity);
 			}
 		} catch (Exception e) {
@@ -423,12 +439,9 @@ public class LhyxCtl extends BaseWebCtl {
 	@ResponseBody
 	public WebJsonResult audit(String shyj, String id, boolean flag) {
 		WebJsonResult wr = success();
-		UserEntity user = securityMgr.getCurrUser();
 		LhyxEntity entity = new LhyxEntity();
-		String role = "";
 		try {
 			entity = lhyxService.findOne(id);
-			Date today = new Date();
 			List<TaskInfoEntity> list = taskInfoService.findByBusIdAndBusKeyAndRecordStatus(id, LhyxEntity.PROCESS_DEFINITION_KEY);
 			if (list != null & list.size() > 0) {
 				TaskInfoEntity taskinfo = list.get(0);

+ 3 - 8
gkjsjy/trunk/src/com/xt/jygl/gkjygl/gklhxkgl/gkjylhyx/service/impl/LhyxServiceImpl.java

@@ -48,15 +48,10 @@ public class LhyxServiceImpl extends BaseWorkFlowServiceImpl<LhyxEntity, String>
 		} else {
 			entity.setRecordStatus(BaseEntity.RECORD_STATE_SUBMIT);
 			entity = this.save(entity);
-			String gqid = "";
-			if (securityMgr.getCurrUser().getSfjyr().getText().equals("是")) {
-				gqid = entity.getSzgq().getId();
-			}
 			Map<String, Object> variables = new HashMap<String, Object>();
-			variables.put("role_clsc", Constants.ROLE_CLSC + ":" + gqid);
-			variables.put("role_hc", Constants.ROLE_HC + ":" + gqid);
-			variables.put("role_fh", Constants.ROLE_FH + ":" + gqid);
-			variables.put("role_sp", Constants.ROLE_SP + ":" + gqid);
+			variables.put("role_ks", Constants.ROLE_LD);
+			variables.put("role_fgld", Constants.ROLE_HC);
+			variables.put("role_ld", Constants.ROLE_FH);
 			WorkFlowParam param = new WorkFlowParam();
 			param.put(WorkFlowParam.DESCRIPTION, entity.getJyrmc() + "的理货延续");