Browse Source

修改列表参数

anderx 3 years ago
parent
commit
79cba3743f

+ 6 - 1
src/main/java/com/goafanti/common/dao/TaskStopLogMapper.java

@@ -1,6 +1,9 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.TaskStopLog;
+import com.goafanti.order.bo.TaskStopLogBo;
+
+import java.util.List;
 
 public interface TaskStopLogMapper {
     int deleteByPrimaryKey(Long id);
@@ -14,4 +17,6 @@ public interface TaskStopLogMapper {
     int updateByPrimaryKeySelective(TaskStopLog record);
 
     int updateByPrimaryKey(TaskStopLog record);
-}
+
+    List<TaskStopLogBo> selectListBySoptId(Integer taskStopId);
+}

+ 4 - 1
src/main/java/com/goafanti/common/dao/TaskStopMapper.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.common.model.TaskSopt;
 import com.goafanti.common.model.TaskStop;
 
 public interface TaskStopMapper {
@@ -14,4 +15,6 @@ public interface TaskStopMapper {
     int updateByPrimaryKeySelective(TaskStop record);
 
     int updateByPrimaryKey(TaskStop record);
-}
+
+    TaskStop selectByTid(Integer id);
+}

+ 2 - 2
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1978,7 +1978,7 @@
     select DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes,dg.name province,c.contract_no contractNo, a.type stopType,a.status stopStatus,
     c.order_no orderNo ,tom.buyer_name userName,b.cname ,b.commodity_name projectName,b.commodity_quantity commodityQuantity ,a.annex_url annexUrl,
     tom.service_type serviceType , b.receiver_name receiverName ,b.status ,b.commodity_price commodityPrice ,a.reason,a.id,b.id tid,ttm.stop_status projectStopStatus
-    from task_sopt a left join t_order_task b on a.tid=b.id
+    from task_stop a left join t_order_task b on a.tid=b.id
     left join t_order_new  c on b.order_no =c.order_no
     left join t_task_mid ttm on b.id=ttm.tid
     left join t_order_mid tom on c.order_no =tom.order_no
@@ -2043,7 +2043,7 @@
 
   <select id="selectProjectSotpCount" resultType="java.lang.Integer">
     select count(*)
-    from task_sopt a left join t_order_task b on a.tid=b.id
+    from task_stop a left join t_order_task b on a.tid=b.id
     left join t_order_new  c on b.order_no =c.order_no
     left join t_order_mid tom on c.order_no =tom.order_no
     where 1=1

+ 13 - 5
src/main/java/com/goafanti/common/mapper/TaskStopLogMapper.xml

@@ -13,19 +13,20 @@
     id, task_stop_id, `status`, reason, create_by, create_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from task_stop_log
     where id = #{id,jdbcType=BIGINT}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from task_stop_log
     where id = #{id,jdbcType=BIGINT}
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskStopLog" useGeneratedKeys="true">
-    insert into task_stop_log (task_stop_id, `status`, reason, 
+    insert into task_stop_log (task_stop_id, `status`, reason,
       create_by, create_time)
-    values (#{taskStopId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{reason,jdbcType=VARCHAR}, 
+    values (#{taskStopId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{reason,jdbcType=VARCHAR},
       #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskStopLog" useGeneratedKeys="true">
@@ -95,4 +96,11 @@
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
-</mapper>
+
+  <select id="selectListBySoptId" resultType="com.goafanti.order.bo.TaskStopLogBo">
+    select a.id ,a.task_stop_id taskSoptId,a.status ,a.reason ,a.create_by createBy ,a.create_time createTime,
+           b.name createName,DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes
+    from task_stop_log a left join admin b on a.create_by =b.id
+    where a.task_stop_id = #{taskStopId}
+  </select>
+</mapper>

+ 13 - 6
src/main/java/com/goafanti/common/mapper/TaskStopMapper.xml

@@ -15,7 +15,7 @@
     id, tid, `type`, `status`, reason, annex_url, create_by, create_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from task_stop
     where id = #{id,jdbcType=BIGINT}
@@ -25,11 +25,11 @@
     where id = #{id,jdbcType=BIGINT}
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskStop" useGeneratedKeys="true">
-    insert into task_stop (tid, `type`, `status`, 
-      reason, annex_url, create_by, 
+    insert into task_stop (tid, `type`, `status`,
+      reason, annex_url, create_by,
       create_time)
-    values (#{tid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
-      #{reason,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, 
+    values (#{tid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
+      #{reason,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
       #{createTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TaskStop" useGeneratedKeys="true">
@@ -119,4 +119,11 @@
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
-</mapper>
+
+  <select id="selectByTid"  resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from task_stop
+    where tid = #{tid} and status in (0,2)
+  </select>
+</mapper>

+ 2 - 2
src/main/java/com/goafanti/order/bo/TaskSoptLogBo.java

@@ -1,8 +1,8 @@
 package com.goafanti.order.bo;
 
-import com.goafanti.common.model.TaskSoptLog;
+import com.goafanti.common.model.TaskStopLog;
 
-public class TaskSoptLogBo extends TaskSoptLog {
+public class TaskStopLogBo extends TaskStopLog {
     private String createName;
     private String createTimes;
 

+ 1 - 1
src/main/java/com/goafanti/order/service/OrderProjectService.java

@@ -144,7 +144,7 @@ public interface OrderProjectService {
 	Pagination<?> selectProjectStop(String orderNo, String userName, String depId, String contractNo, String projectName,
 							 Integer status,String startTime,String endTime,String receiverId, Integer pageNo, Integer pageSize);
 
-	List<TaskSoptLogBo> projectStopList(Integer taskStopId);
+	List<TaskStopLogBo> projectStopList(Integer taskStopId);
 
 	Object pushExamineProjectStop(InputTaskStopLog in);
 

+ 38 - 38
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -117,9 +117,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@Autowired
 	private NewOrderChangeMapper newOrderChangeMapper;
 	@Autowired
-	private TaskSoptMapper taskSoptMapper;
+	private TaskStopMapper taskStopMapper;
 	@Autowired
-	private TaskSoptLogMapper taskSoptLogMapper;
+	private TaskStopLogMapper taskStopLogMapper;
 
 
 
@@ -1463,25 +1463,25 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		String adminId = TokenManager.getAdminId();
 		for (String s : split) {
 			Integer id=Integer.valueOf(s);
-			TaskSopt use = taskSoptMapper.selectByTid(id);
+			TaskStop use = taskStopMapper.selectByTid(id);
 			if (use!=null){
 				throw new BusinessException(String.format("项目[%s]暂停流程已存在,请先走完流程",id));
 			}
-			TaskSopt taskSopt = new TaskSopt();
-			taskSopt.setTid(id);
-			taskSopt.setType(in.getType());
-			taskSopt.setStatus(0);
-			taskSopt.setReason(in.getReason());
-			taskSopt.setAnnexUrl(in.getAnnexUrl());
-			taskSopt.setCreateBy(adminId);
-			taskSopt.setCreateTime(date);
-			taskSoptMapper.insertSelective(taskSopt);
-			TaskSoptLog log = new TaskSoptLog();
-			log.setTaskSoptId(taskSopt.getId());
+			TaskStop ts = new TaskStop();
+			ts.setTid(id);
+			ts.setType(in.getType());
+			ts.setStatus(0);
+			ts.setReason(in.getReason());
+			ts.setAnnexUrl(in.getAnnexUrl());
+			ts.setCreateBy(adminId);
+			ts.setCreateTime(date);
+			taskStopMapper.insertSelective(ts);
+			TaskStopLog log = new TaskStopLog();
+			log.setTaskStopId(ts.getId());
 			log.setReason(in.getReason());
 			log.setCreateBy(adminId);
 			log.setCreateTime(date);
-			taskSoptLogMapper.insertSelective(log);
+			taskStopLogMapper.insertSelective(log);
 			TTaskMid tt=new TTaskMid();
 			tt.setTid(id);
 			tt.setStopStatus(1);
@@ -1494,22 +1494,22 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 
 	@Override
 	public Integer updateProjectStop(InputProjectStop in) {
-		TaskSopt use = taskSoptMapper.selectByPrimaryKey(in.getStopId());
+		TaskStop use = taskStopMapper.selectByPrimaryKey(in.getStopId());
 		Date date = new Date();
 		String adminId = TokenManager.getAdminId();
-		TaskSopt taskSopt = new TaskSopt();
-		taskSopt.setId(in.getStopId());
-		taskSopt.setType(in.getType());
-		taskSopt.setStatus(0);
-		taskSopt.setReason(in.getReason());
-		taskSopt.setAnnexUrl(in.getAnnexUrl());
-		taskSoptMapper.updateByPrimaryKeySelective(taskSopt);
-		TaskSoptLog log = new TaskSoptLog();
-		log.setTaskSoptId(taskSopt.getId());
+		TaskStop ts = new TaskStop();
+		ts.setId(in.getStopId());
+		ts.setType(in.getType());
+		ts.setStatus(0);
+		ts.setReason(in.getReason());
+		ts.setAnnexUrl(in.getAnnexUrl());
+		taskStopMapper.updateByPrimaryKeySelective(ts);
+		TaskStopLog log = new TaskStopLog();
+		log.setTaskStopId(ts.getId());
 		log.setReason(in.getReason());
 		log.setCreateBy(adminId);
 		log.setCreateTime(date);
-		taskSoptLogMapper.insertSelective(log);
+		taskStopLogMapper.insertSelective(log);
 		asyncUtils.addProjectSotpNotic(0, in.getType(),use.getTid().toString(),null);
 		return 1;
 	}
@@ -1542,15 +1542,15 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	}
 
 	@Override
-	public List<TaskSoptLogBo> projectStopList(Integer taskStopId) {
-		List<TaskSoptLogBo> list =taskSoptLogMapper.selectListBySoptId(taskStopId);
+	public List<TaskStopLogBo> projectStopList(Integer taskStopId) {
+		List<TaskStopLogBo> list =taskStopLogMapper.selectListBySoptId(taskStopId);
 		return list;
 	}
 
 	@Override
 	public Object pushExamineProjectStop(InputTaskStopLog in) {
-		TaskSopt use = taskSoptMapper.selectByPrimaryKey(in.getTaskStopId());
-		TaskSopt t=new TaskSopt();
+		TaskStop use = taskStopMapper.selectByPrimaryKey(in.getTaskStopId());
+		TaskStop t=new TaskStop();
 		t.setId(use.getId());
 		if (in.getStatus()==1){
 			t.setStatus(1);
@@ -1583,14 +1583,14 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		}else if(in.getStatus()==2) {
 			t.setStatus(2);
 		}
-		TaskSoptLog taskSoptLog=new TaskSoptLog();
-		taskSoptLog.setTaskSoptId(in.getTaskStopId());
-		taskSoptLog.setReason(in.getReason());
-		taskSoptLog.setStatus(in.getStatus());
-		taskSoptLog.setCreateTime(new Date());
-		taskSoptLog.setCreateBy(TokenManager.getAdminId());
-		taskSoptLogMapper.insertSelective(taskSoptLog);
-		return taskSoptMapper.updateByPrimaryKeySelective(t);
+		TaskStopLog tsl=new TaskStopLog();
+		tsl.setTaskStopId(in.getTaskStopId());
+		tsl.setReason(in.getReason());
+		tsl.setStatus(in.getStatus());
+		tsl.setCreateTime(new Date());
+		tsl.setCreateBy(TokenManager.getAdminId());
+		taskStopLogMapper.insertSelective(tsl);
+		return taskStopMapper.updateByPrimaryKeySelective(t);
 	}
 
 	private void examineProjectSotpAddNotice(TOrderTask task,Integer status,Integer sotpType) {