Browse Source

项目暂停接口开发

anderx 3 years ago
parent
commit
16312c7236

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

@@ -1968,6 +1968,122 @@
     where split_super = #{tid}
   </select>
 
+  <select id="selectProjectSotpList" resultType="com.goafanti.order.bo.OutselectProjectSotp">
+    select DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes,dg.name province,c.contract_no contractNo,
+    c.order_no orderNo ,tom.buyer_name userName,b.cname ,b.commodity_name projectName,b.commodity_quantity commodityQuantity ,
+    tom.service_type serviceType , b.receiver_name receiverName ,b.status ,b.commodity_price commodityPrice ,a.reason
+    from task_sopt 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
+    left join department d  on c.order_dep =d.id
+    left join district_glossory dg on d.province =dg.id
+    where 1=1
+    <if test="shiro ==1">
+      and c.salesman_id =#{aid}
+    </if>
+    <if test="shiro ==2">
+    and c.order_dep  in
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
+      </foreach>
+    </if>
+    <if test="orderNo !=null">
+      and b.order_no = #{orderNo}
+    </if>
+    <if test="userName !=null">
+      and tom.buyer_name like CONCAT('%',#{userName},'%')
+    </if>
+    <if test="depId !=null">
+      and c.order_dep = #{depId}
+    </if>
+    <if test="contractNo !=null">
+      and c.contract_no like CONCAT('%',#{contractNo},'%')
+    </if>
+    <if test="projectName !=null">
+      and b.commodity_name like CONCAT('%',#{projectName},'%')
+    </if>
+    <if test="status !=null">
+      <if test="status==0">
+        and a.`type` =0 and a.status =0
+      </if>
+      <if test="status==1">
+        and a.`type` =1 and a.status =0
+      </if>
+      <if test="status==2">
+        and a.`type` =0 and a.status =1
+      </if>
+      <if test="status==3">
+        and a.`type` =1 and a.status =1
+      </if>
+      <if test="status==4">
+        and a.status=2
+      </if>
+    </if>
+    <if test="receiverId !=null">
+      and b.task_receiver  = #{receiverId}
+    </if>
+    <if test="startTime !=null and endTime !=null">
+      and a.create_time BETWEEN #{startTime} and #{endTime}
+    </if>
+    order by a.create_time desc
+    <if test="page_sql!=null">
+      ${page_sql}
+    </if>
+  </select>
 
+  <select id="selectProjectSotpCount" resultType="java.lang.Integer">
+    select count(*)
+    from task_sopt 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
+    <if test="shiro ==1">
+      and c.salesman_id =#{aid}
+    </if>
+    <if test="shiro ==2">
+        and c.order_dep  in
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
+      </foreach>
+    </if>
+    <if test="orderNo !=null">
+      and b.order_no = #{orderNo}
+    </if>
+    <if test="userName !=null">
+      and tom.buyer_name like CONCAT('%',#{userName},'%')
+    </if>
+    <if test="depId !=null">
+      and c.order_dep = #{depId}
+    </if>
+    <if test="contractNo !=null">
+      and c.contract_no like CONCAT('%',#{contractNo},'%')
+    </if>
+    <if test="projectName !=null">
+      and b.commodity_name like CONCAT('%',#{projectName},'%')
+    </if>
+    <if test="status !=null">
+      <if test="status==0">
+        and a.`type` =0 and a.status =0
+      </if>
+      <if test="status==1">
+        and a.`type` =1 and a.status =0
+      </if>
+      <if test="status==2">
+        and a.`type` =0 and a.status =1
+      </if>
+      <if test="status==3">
+        and a.`type` =1 and a.status =1
+      </if>
+      <if test="status==4">
+        and a.status=2
+      </if>
+    </if>
+    <if test="receiverId !=null">
+      and b.task_receiver  = #{receiverId}
+    </if>
+    <if test="startTime !=null and endTime !=null">
+      and a.create_time BETWEEN #{startTime} and #{endTime}
+    </if>
+  </select>
 
 </mapper>

+ 138 - 0
src/main/java/com/goafanti/order/bo/OutselectProjectSotp.java

@@ -0,0 +1,138 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.utils.Param;
+import com.goafanti.common.utils.excel.Excel;
+
+public class OutselectProjectSotp {
+
+    @Excel(name = "时间")
+    private String createTimes;
+    @Excel(name = "派单身份")
+    private String province;
+    @Excel(name = "合同编号")
+    private String contractNo;
+    @Excel(name = "订单编号")
+    private String orderNo;
+    @Excel(name = "签单客户")
+    private String userName;
+    @Excel(name = "项目类型")
+    private String cname;
+    @Excel(name = "项目名称")
+    private String projectName;
+    @Excel(name = "数量")
+    private Integer commodityQuantity;
+    @Excel(name = "服务类型")
+    private String serviceType;
+    @Excel(name = "咨询师/咨询师经理")
+    private String receiverName;
+    @Excel(name = "项目状态")
+    private Integer status;
+    @Excel(name = "项目金额")
+    private String commodityPrice;
+    @Excel(name = "原因")
+    private String reason;
+
+    public String getCreateTimes() {
+        return createTimes;
+    }
+
+    public void setCreateTimes(String createTimes) {
+        this.createTimes = createTimes;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getCname() {
+        return cname;
+    }
+
+    public void setCname(String cname) {
+        this.cname = cname;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public Integer getCommodityQuantity() {
+        return commodityQuantity;
+    }
+
+    public void setCommodityQuantity(Integer commodityQuantity) {
+        this.commodityQuantity = commodityQuantity;
+    }
+
+    public String getServiceType() {
+        return serviceType;
+    }
+
+    public void setServiceType(String serviceType) {
+        this.serviceType = serviceType;
+    }
+
+    public String getReceiverName() {
+        return receiverName;
+    }
+
+    public void setReceiverName(String receiverName) {
+        this.receiverName = receiverName;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getCommodityPrice() {
+        return commodityPrice;
+    }
+
+    public void setCommodityPrice(String commodityPrice) {
+        this.commodityPrice = commodityPrice;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+}

+ 12 - 0
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -645,4 +645,16 @@ public class OrderProjectApiController extends CertifyApiController {
 		}
 		return res.data(orderProjectService.addProjectSotp( in));
 	}
+	/**
+	 * 项目暂停
+	 *
+	 */
+	@RequestMapping(value = "/selectProjectSotp" ,method = RequestMethod.GET)
+	public Result selectProjectSotp(String orderNo,String userName,String depId,String contractNo, String projectName,Integer status,
+									String startTime, String endTime, String receiverId, Integer pageNo,Integer pageSize){
+		Result res = new Result();
+
+		return res.data(orderProjectService.selectProjectSotp(  orderNo, userName, depId, contractNo,
+				 projectName, status,startTime,endTime,receiverId, pageNo, pageSize));
+	}
 }

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

@@ -135,6 +135,8 @@ public interface OrderProjectService {
 
     void updateMidServiceProject(String orderNo);
 
-    Object addProjectSotp(InputProjectSotp in);
+	Integer addProjectSotp(InputProjectSotp in);
 
+    Object selectProjectSotp(String orderNo, String userName, String depId, String contractNo, String projectName,
+							 Integer status,String startTime,String endTime,String receiverId, Integer pageNo, Integer pageSize);
 }

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

@@ -9,18 +9,15 @@ import java.util.*;
 import javax.mail.MessagingException;
 
 import com.alibaba.fastjson.JSON;
-import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.bo.*;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.dao.*;
-import com.goafanti.common.enums.OrderState;
 import com.goafanti.common.model.*;
 import com.goafanti.common.utils.*;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.enums.*;
-import com.goafanti.report.bo.SalesValues;
 import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -46,8 +43,6 @@ import com.goafanti.order.service.OrderProjectService;
 import com.goafanti.organization.bo.OutPaymentNode;
 import com.goafanti.techproject.enums.TaskState;
 
-import static javafx.scene.input.KeyCode.L;
-
 @Service
 public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> implements OrderProjectService {
 	@Autowired
@@ -1458,7 +1453,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	}
 
 	@Override
-	public Object addProjectSotp(InputProjectSotp in) {
+	public Integer addProjectSotp(InputProjectSotp in) {
 		String[] split = in.getIds().split(",");
 		List<TaskSopt> list =new ArrayList<>();
 		Date date = new Date();
@@ -1483,5 +1478,32 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		return 1;
 	}
 
+	@Override
+	public Pagination<?> selectProjectSotp(String orderNo, String userName, String depId, String contractNo, String projectName,
+										   Integer status,String startTime,String endTime,String receiverId, Integer pageNo, Integer pageSize) {
+		Map<String,Object>params =new HashMap<>();
+		if (orderNo!=null)params.put("orderNo",orderNo);
+		if (userName!=null)params.put("userName",userName);
+		if (depId!=null)params.put("depId",depId);
+		if (contractNo!=null)params.put("contractNo",contractNo);
+		if (projectName!=null)params.put("projectName",projectName);
+		if (status!=null)params.put("status",status);
+		if (startTime!=null)params.put("startTime",startTime);
+		if (endTime!=null)params.put("endTime",endTime+" 23:59:59");
+		if (receiverId!=null)params.put("receiverId",receiverId);
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+			params.put("shiro",0);
+		}else if (TokenManager.hasRole(AFTConstants.SALESMAN)||TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
+			params.put("shiro",1);
+			params.put("aid",TokenManager.getAdminId());
+		}else if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
+			params.put("shiro",2);
+			params.put("deps",departmentService.selectMyDeps());
+		}else {
+			return new Pagination<>();
+		}
+		return findPage("selectProjectSotpList","selectProjectSotpCount",params,pageNo,pageSize);
+	}
+
 
 }