Browse Source

项目管理-项目详情页面中信息调整(新增营销员)
项目管理-项目任务管理处,增加锁定、未锁定的筛选项。已废除订单请不要再出现在项目管理列表里。
项目管理-项目任务表新增公示状态并增加在需求显示位置
项目管理-我的项目任务与项目任务管理,在查询表格中增加一列【公示状态】展示。并增加一个筛选项。

anderx 7 years ago
parent
commit
e520053e64

+ 3 - 0
src/main/java/com/goafanti/common/mapper/ContractTaskMapper.xml

@@ -489,6 +489,9 @@
       <if test="deletedSign != null">
         deleted_sign = #{deletedSign,jdbcType=INTEGER},
       </if>
+      <if test="publishStatus != null">
+        publish_Status = #{publishStatus,jdbcType=INTEGER},
+      </if>
       <if test="serialNumber != null">
         serial_number = #{serialNumber,jdbcType=INTEGER},
       </if>

+ 17 - 6
src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml

@@ -687,7 +687,7 @@
   <select id="selectTechProjectDetail" resultType="com.goafanti.techproject.bo.ProjectDetailBo">
 	  <choose>
 	  	<when test="buyerType == 0">
-	  		  select
+	  	  		  select
 	a.id,
 	a.serial_number as serialNumber,
 	date_format( a.sign_date, '%Y-%m-%d %H:%i:%S' ) as signDate,
@@ -702,7 +702,8 @@
 	d.name as principalName,
 	f.name as buyerProvince,
 	g.cname as projectType,
-	t.contract_no as contractNo
+	t.contract_no as contractNo,
+	h.name as salesmanName
 from
 	contract a left join user b on
 	a.uid = b.id left join admin d on
@@ -710,11 +711,12 @@ from
 	a.uid = e.uid left join district_glossory f on
 	e.province = f.id left join business_varieties g on
 	a.type = g.id left join t_order t on
-	a.order_no=t.order_no
+	a.order_no=t.order_no left join admin h on 
+	t.salesman_id=h.id
 			where a.id = #{contractId,jdbcType=VARCHAR}
 	  	</when>
 	  		<when test="buyerType == 1">
-	  		select
+	  			select
 				a.id,
 				a.serial_number as serialNumber,
 				date_format(a.sign_date,'%Y-%m-%d %H:%i:%S') as signDate,
@@ -729,7 +731,8 @@ from
 				d.name as principalName,
 				f.name as buyerProvince,
 				g.cname as projectType,
-				t.contract_no as contractNo
+				t.contract_no as contractNo,
+				h.name as salesmanName
 			from
 				contract a left join user b on
 				a.uid = b.id left join admin d on
@@ -737,7 +740,8 @@ from
 				a.uid = e.uid left join district_glossory f on
 				e.location_province  = f.id left join business_varieties g on
 				a.type = g.id  left join t_order t on
-				a.order_no=t.order_no
+				a.order_no=t.order_no left join admin h on 
+				t.salesman_id=h.id
 			where a.id = #{contractId,jdbcType=VARCHAR}
 	  	</when>
 	  </choose>
@@ -751,6 +755,7 @@ from
 		a.task_status as taskStatus,
 		a.deleted_sign as deletedSign,
 		a.task_comment as taskComment,
+		a.publish_status as publishStatus,
 		b.name as technicianName
 	from
 		contract_task a left join admin b on
@@ -788,6 +793,9 @@ from
 		<if test="deletedSign != null">
 			and d.deleted_sign = #{deletedSign,jdbcType=VARCHAR}
 		</if>
+		<if test="publishStatus != null">
+			and a.publish_status = #{publishStatus,jdbcType=VARCHAR}
+		</if>
 		<if test="taskStatus != null">
 			and a.task_status = #{taskStatus,jdbcType=VARCHAR}
 		</if>
@@ -832,6 +840,9 @@ from
 		<if test="deletedSign != null">
 			and d.deleted_sign = #{deletedSign,jdbcType=VARCHAR}
 		</if>
+		<if test="publishStatus != null">
+			and a.publish_status = #{publishStatus,jdbcType=VARCHAR}
+		</if>
 		<if test="taskStatus != null">
 			and a.task_status = #{taskStatus,jdbcType=VARCHAR}
 		</if>

+ 13 - 0
src/main/java/com/goafanti/common/model/Contract.java

@@ -99,6 +99,11 @@ public class Contract {
 	 * @mbg.generated  Wed Apr 11 14:31:13 CST 2018
 	 */
 	private Integer taskDistribution;
+	
+	/**
+	 * 公示状态
+	 */
+	private Integer publicStatus;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract.id
@@ -441,4 +446,12 @@ public class Contract {
 	public void setTaskDistribution(Integer taskDistribution) {
 		this.taskDistribution = taskDistribution;
 	}
+
+	public Integer getPublicStatus() {
+		return publicStatus;
+	}
+
+	public void setPublicStatus(Integer publicStatus) {
+		this.publicStatus = publicStatus;
+	}
 }

+ 12 - 0
src/main/java/com/goafanti/common/model/ContractTask.java

@@ -84,6 +84,10 @@ public class ContractTask {
 	 * @mbg.generated  Fri Mar 02 15:45:51 CST 2018
 	 */
 	private String attachmentUrl;
+	/**
+	 * 公示状态
+	 */
+	private Integer publishStatus;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_task.id
@@ -372,4 +376,12 @@ public class ContractTask {
 	public void setAttachmentUrl(String attachmentUrl) {
 		this.attachmentUrl = attachmentUrl;
 	}
+
+	public Integer getPublishStatus() {
+		return publishStatus;
+	}
+
+	public void setPublishStatus(Integer publishStatus) {
+		this.publishStatus = publishStatus;
+	}
 }

+ 46 - 0
src/main/java/com/goafanti/order/enums/PublicStatus.java

@@ -0,0 +1,46 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PublicStatus {
+	YGS(0,"已公示"),
+	WGS(1,"未公示"),
+	DGS(2,"待公示"),
+	CCZ(3, "抽查中");
+	private PublicStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PublicStatus> status = new HashMap<Integer, PublicStatus>();
+
+	static {
+		for (PublicStatus value : PublicStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static PublicStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return WGS;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 2 - 0
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -73,6 +73,7 @@ import com.goafanti.order.enums.OrderStage;
 import com.goafanti.order.enums.OrderState;
 import com.goafanti.order.enums.PayChannel;
 import com.goafanti.order.enums.ProjectStage;
+import com.goafanti.order.enums.PublicStatus;
 import com.goafanti.order.enums.TaskDistributionState;
 import com.goafanti.order.enums.TransactionMode;
 import com.goafanti.order.enums.TransactionSubject;
@@ -1481,6 +1482,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		contract.setCreater(TokenManager.getAdminId());
 		contract.setPrincipal(tOrder.getTechnicianId()); //暂不确定
 		contract.setSignComment(signComment);
+		contract.setPublicStatus(PublicStatus.WGS.getCode());
 		contract.setTaskDistribution(TaskDistributionState.NOT_DISTRIBUTION.getCode());
 		contractMapper.insert(contract);
 		for(TOrderDetail orderDetail: detailList){

+ 14 - 0
src/main/java/com/goafanti/techproject/bo/TaskListBo.java

@@ -18,6 +18,8 @@ public class TaskListBo{
 	private Integer deletedSign;
 	private String buyerName;
 	private String taskReceiverName;
+	private Integer publishStatus;
+	private String salesmanName;
 	public String getTaskId() {
 		return taskId;
 	}
@@ -114,4 +116,16 @@ public class TaskListBo{
 	public void setTaskReceiverName(String taskReceiverName) {
 		this.taskReceiverName = taskReceiverName;
 	}
+	public Integer getPublishStatus() {
+		return publishStatus;
+	}
+	public void setPublishStatus(Integer publishStatus) {
+		this.publishStatus = publishStatus;
+	}
+	public String getSalesmanName() {
+		return salesmanName;
+	}
+	public void setSalesmanName(String salesmanName) {
+		this.salesmanName = salesmanName;
+	}
 }

+ 34 - 4
src/main/java/com/goafanti/techproject/controller/AdminTechProjectApiController.java

@@ -776,11 +776,11 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/listMyTask",method = RequestMethod.POST)
-	public Result listMyTask(String projectNo,String buyerName,String startDate,String endDate, Integer taskStatus,String categoryId,
+	public Result listMyTask(String projectNo,String buyerName,String startDate,String endDate,String publishStatus, Integer taskStatus,String categoryId,
 			Integer pageNo, Integer pageSize){
 		Result res = new Result();
 		res.setData(techProjectService.selectProjectTask(projectNo, buyerName, TokenManager.getAdminId(), "", 
-				startDate, endDate, taskStatus, categoryId,null, pageNo, pageSize));
+				startDate, endDate, taskStatus, categoryId,null,publishStatus, pageNo, pageSize));
 		return res;
 	}
 	
@@ -799,10 +799,10 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/listTask",method = RequestMethod.POST)
 	public Result listTask(String projectNo,String buyerName,String taskReceiverName, String startDate,String endDate, 
-			Integer taskStatus,String categoryId,String deletedSign,Integer pageNo, Integer pageSize){
+			Integer taskStatus,String categoryId,String deletedSign,String publishStatus, Integer pageNo, Integer pageSize){
 		Result res = new Result();
 		res.setData(techProjectService.selectProjectTask(projectNo, buyerName, "", taskReceiverName, startDate, endDate, 
-				taskStatus, categoryId,deletedSign, pageNo, pageSize));
+				taskStatus, categoryId,deletedSign,publishStatus, pageNo, pageSize));
 		return res;
 	}
 	
@@ -962,4 +962,34 @@ public class AdminTechProjectApiController extends CertifyApiController {
 		techProjectService.updateProjectTask(contractId,signDate,signComment,completeDate,completeComment);
 		return res;
 	}
+	
+	/**
+	 * 项目任务公示修改
+	 * @param taskId
+	 * @param commodityId
+	 * @param commodityMode
+	 * @param taskComment
+	 * @return
+	 */
+	@RequestMapping(value = "/updatePublishStatus",method = RequestMethod.POST)
+	public Result updateProjectTask(String taskId,String publishStatus){
+		Result res = new Result();
+		if(StringUtils.isBlank(taskId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务编号"));
+			return res;
+		}
+		ContractTask task = techProjectService.selectTaskById(taskId);
+		if (task.getTaskStatus()!=3) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "任务状态"));
+			return res;
+		}
+		if(task != null){
+			if(task.getTaskStatus() != TaskState.UN_DISTRIBUTION.getCode())
+				res.getError().add(buildError(ErrorConstants.NOT_ACCORD_WITH_NEXT, ""));
+		}
+		task.setPublishStatus(Integer.valueOf(publishStatus));
+		techProjectService.updateProjectTask(task);
+		return res;
+	}
+	
 }

+ 1 - 1
src/main/java/com/goafanti/techproject/service/TechProjectService.java

@@ -121,7 +121,7 @@ public interface TechProjectService {
 	 * @return
 	 */
 	Pagination<TaskListBo> selectProjectTask(String projectNo,String buyerName,String taskReceiverId, String taskReceiverName,
-			String startDate,String endDate, Integer taskStatus,String categoryId,String deletedSign, Integer pageNo, Integer pageSize);
+			String startDate,String endDate, Integer taskStatus,String categoryId,String deletedSign,String publishStatus, Integer pageNo, Integer pageSize);
 	
 	/**
 	 * 根据任务id查询任务

+ 2 - 1
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -396,7 +396,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TaskListBo> selectProjectTask(String projectNo, String buyerName, String taskReceiverId, String taskReceiverName,
-			String startDate,String endDate, Integer taskStatus, String categoryId,String deletedSign, Integer pageNo, Integer pageSize) {
+			String startDate,String endDate, Integer taskStatus, String categoryId,String deletedSign,String publishStatus, Integer pageNo, Integer pageSize) {
 		Map<String,Object> params = new HashMap<String,Object>();
 		if(StringUtils.isNotBlank(projectNo)) params.put("projectNo", projectNo);
 		if(StringUtils.isNotBlank(buyerName)) params.put("buyerName", buyerName);
@@ -411,6 +411,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 		}
 		if(StringUtils.isNotBlank(categoryId)) params.put("categoryId", categoryId);
 		if(StringUtils.isNotBlank(deletedSign)) params.put("deletedSign", deletedSign);
+		if(StringUtils.isNotBlank(publishStatus)) params.put("publishStatus", publishStatus);
 		if(taskStatus != null) params.put("taskStatus", taskStatus);
 		return (Pagination<TaskListBo>)findPage("selectProjectTaskByPage", "selectProjectTaskCount", params, pageNo, pageSize);
 	}