Selaa lähdekoodia

Merge branch 'test' of jishutao/kede-server into prod

anderx 6 vuotta sitten
vanhempi
commit
d1a41290e0
25 muutettua tiedostoa jossa 1694 lisäystä ja 1494 poistoa
  1. 12 5
      src/main/java/com/goafanti/admin/bo/AdminCustomerBo.java
  2. 1 1
      src/main/java/com/goafanti/admin/service/AdminService.java
  3. 2 1
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  4. 3 3
      src/main/java/com/goafanti/common/controller/BaseApiController.java
  5. 55 77
      src/main/java/com/goafanti/common/dao/TOrderOutsourceMapper.java
  6. 12 6
      src/main/java/com/goafanti/common/enums/OrderLogProcess.java
  7. 38 24
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  8. 34 47
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  9. 133 25
      src/main/java/com/goafanti/common/mapper/TOrderOutsourceMapper.xml
  10. 230 295
      src/main/java/com/goafanti/common/model/TOrderOutsource.java
  11. 892 873
      src/main/java/com/goafanti/common/model/TOrderOutsourceExample.java
  12. 28 0
      src/main/java/com/goafanti/common/utils/FileUtils.java
  13. 2 2
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  14. 15 0
      src/main/java/com/goafanti/order/bo/OrderOutsourceDtails.java
  15. 4 28
      src/main/java/com/goafanti/order/bo/TOrderLogBo.java
  16. 3 57
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  17. 98 0
      src/main/java/com/goafanti/order/controller/OutsourceOrgApiController.java
  18. 2 0
      src/main/java/com/goafanti/order/enums/ProcessStatus.java
  19. 1 4
      src/main/java/com/goafanti/order/service/OrderNewService.java
  20. 13 0
      src/main/java/com/goafanti/order/service/OutsourceOrgService.java
  21. 1 1
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  22. 16 38
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  23. 94 1
      src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java
  24. 4 5
      src/main/resources/props/config_local.properties
  25. 1 1
      src/main/resources/props/config_test.properties

+ 12 - 5
src/main/java/com/goafanti/admin/bo/AdminCustomerBo.java

@@ -5,7 +5,8 @@ public class AdminCustomerBo {
 	private String aName;
 	private String depName;
 	private String userCount;
-	private String timeCount;
+	private String inputCount;
+	private String receiveCount;
 	public String getAid() {
 		return aid;
 	}
@@ -30,11 +31,17 @@ public class AdminCustomerBo {
 	public void setUserCount(String userCount) {
 		this.userCount = userCount;
 	}
-	public String getTimeCount() {
-		return timeCount;
+	public String getInputCount() {
+		return inputCount;
 	}
-	public void setTimeCount(String timeCount) {
-		this.timeCount = timeCount;
+	public void setInputCount(String inputCount) {
+		this.inputCount = inputCount;
+	}
+	public String getReceiveCount() {
+		return receiveCount;
+	}
+	public void setReceiveCount(String receiveCount) {
+		this.receiveCount = receiveCount;
 	}
 	
 }

+ 1 - 1
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -82,5 +82,5 @@ public interface AdminService {
 
 	Pagination<AdminCustomerBo> selectAdminCustomerStatistics(String depId, String startTime, String endTime, Integer pageSize, Integer pageNo);
 
-	Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime, Integer pageSize, Integer pageNo);
+	Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime,Integer type, Integer pageSize, Integer pageNo);
 }

+ 2 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -372,12 +372,13 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime,
+	public Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime,Integer type,
 			Integer pageSize, Integer pageNo) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
 		if (StringUtils.isNotBlank(aid)) params.put("aid", aid);
+		if (type!=null) params.put("type", type);
 		if (StringUtils.isNotBlank(startTime)) params.put("startTime", startTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
 		return (Pagination<AdminCustomerDetailBo>)findPage("selectAdminCustomerDetailList", "selectAdminCustomerDetailCount", params, pageNo, pageSize);

+ 3 - 3
src/main/java/com/goafanti/common/controller/BaseApiController.java

@@ -63,7 +63,7 @@ public class BaseApiController extends BaseController {
 		if (!files.isEmpty()) {
 			try {
 				MultipartFile mf = files.get(0);
-				fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path, TokenManager.getUserId());
+				fileName = FileUtils.splicingFileName(mf, isPrivate, sign, path, TokenManager.getUserId());
 				mf.transferTo(isPrivate ? toPrivateFile(fileName) : toFile(fileName));
 				LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
 			} catch (Exception e) {
@@ -113,11 +113,11 @@ public class BaseApiController extends BaseController {
 	 * @param filePath
 	 */
 	protected void downloadFile(HttpServletResponse res, String fileName, String filePath) {
-		FileUtils.downloadFile(res, fileName, uploadPrivatePath + filePath);
+		FileUtils.downloadFile(res, fileName,  uploadPath+ filePath);
 	}
 
 	protected void downloadUnPrivateFile(HttpServletResponse res, String fileName, String filePath) {
-		FileUtils.downloadFile(res, fileName, uploadPath + filePath);
+		FileUtils.downloadFile(res, fileName, uploadPrivatePath + filePath);
 	}
 
 	private File buildFile(String filePath) {

+ 55 - 77
src/main/java/com/goafanti/common/dao/TOrderOutsourceMapper.java

@@ -9,93 +9,71 @@ import org.apache.ibatis.annotations.Param;
 
 public interface TOrderOutsourceMapper {
     /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    long countByExample(TOrderOutsourceExample example);
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	long countByExample(TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int deleteByExample(TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int deleteByExample(TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int deleteByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int deleteByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int insert(TOrderOutsource record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int insert(TOrderOutsource record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int insertSelective(TOrderOutsource record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int insertSelective(TOrderOutsource record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    List<TOrderOutsource> selectByExample(TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	List<TOrderOutsource> selectByExample(TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    TOrderOutsource selectByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	TOrderOutsource selectByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByExampleSelective(@Param("record") TOrderOutsource record, @Param("example") TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByExampleSelective(@Param("record") TOrderOutsource record,
+			@Param("example") TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByExample(@Param("record") TOrderOutsource record, @Param("example") TOrderOutsourceExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByExample(@Param("record") TOrderOutsource record, @Param("example") TOrderOutsourceExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByPrimaryKeySelective(TOrderOutsource record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_order_outsource
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    int updateByPrimaryKey(TOrderOutsource record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByPrimaryKeySelective(TOrderOutsource record);
 
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_outsource
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	int updateByPrimaryKey(TOrderOutsource record);
 
 	OrderOutsourceDtails selectByOrderNo(String orderNo);
 }

+ 12 - 6
src/main/java/com/goafanti/common/enums/OrderLogProcess.java

@@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils;
 import com.goafanti.order.enums.OrderNewState;
 
 public enum OrderLogProcess {
-//	流程 0单 1提交 2审核 3驳回  4特批 5财务派单 6财务首付 7项目订单派单 8项目派单 9项目完成
-	TJ(1, "提交"),
-	SH(2, "审核"),
+//	流程 0发起退单 1提交 2审核 3驳回  4特批 5财务派单 6财务首付 7项目订单派单 8项目派单 9项目完成 10 退单完成 11财务全款 12发起外包 13外包通过 14外包拒绝
+	TJ(1, "营销员提交"),
+	SH(2, "管理员审核"),
 	BH(3, "驳回"),
-	TP(4, "特批"),
+	TP(4, "特批通过"),
 	CWPD(5, "财务派单"),
 	CWSF(6, "财务首付"),
 	XMDDPD(7, "项目订单派单"),
@@ -20,7 +20,12 @@ public enum OrderLogProcess {
 	XMWC(9, "项目完成"),
 	FQTD(0,"发起退单"),
 	WCTD(10,"退单完成"),
-	CWQK(11,"财务全款");
+	CWQK(11,"财务全款"),
+	FQWB(12,"发起外包"),
+	WBSH(13,"外包审核通过"),
+	WBBH(14,"外包审核驳回"),
+	NOT(99,"未知"),
+	;
 	
 	private OrderLogProcess(Integer code, String desc) {
 		this.code = code;
@@ -40,9 +45,10 @@ public enum OrderLogProcess {
                 return orderLogProcess.getDesc();
             }
         }
-        return  null;
+        return  NOT.getDesc();
     }
 	
+	
 	public static OrderLogProcess getStatus(Integer code) {
 		if (containsType(code)) {
 			return status.get(code);

+ 38 - 24
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1051,17 +1051,24 @@
   </select>
   
   
-   <select id="selectAdminCustomerList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerBo">
-  	select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as timeCount from admin a 
+   <select id="selectAdminCustomerList"  resultType="com.goafanti.admin.bo.AdminCustomerBo">
+  	select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as inputCount,
+  	ifnull(c.timeCount,0) as receiveCount from admin a 
 	left join (select aid,count(aid) as userCount from user where aid is not null  
 	and  share_type=0 and source !=0 and type=1
 	group by aid) b on a.id=b.aid
-	left join (select aid,count(aid) as timeCount from user where aid is not null  
-	and  share_type=0 and source !=0 and type=1
-	 <if test="startTime != null and endTime != null"> 
+	left join (select aid,count(aid) as timeCount from `user` where aid is not null  
+	and  share_type=0 and source =1 and type=1
+     <if test="startTime != null and endTime != null"> 
     and  create_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
     </if>
 	group by aid) c on a.id=c.aid
+	left join (select aid,count(aid) as timeCount from `user` where aid is not null  
+	and  share_type=0 and source =2 and type=1
+	 <if test="startTime != null and endTime != null"> 
+    and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+    </if>
+	group by aid) d on a.id=c.aid
 	left join department d on a.department_id=d.id
 	left join user_role e on a.id=e.uid
 	left join `role` f on e.rid=f.id
@@ -1076,39 +1083,40 @@
   </select>
   
   <select id="selectAdminCustomerCount" parameterType="java.lang.String" resultType="java.lang.Integer">
-  select count(*) from admin a 
-	left join (select aid,count(aid) as userCount from user where aid is not null  
-	and  share_type=0 and source !=0 and type=1
-	group by aid) b on a.id=b.aid
-	left join (select aid,count(aid) as timeCount from user where aid is not null  
-	and  share_type=0 and source !=0 and type=1
-	 <if test="startTime != null and endTime != null"> 
-    and  create_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-    </if>
-	group by aid) c on a.id=c.aid
+ select count(*) from admin a 
+	left join department d on a.department_id=d.id
 	left join user_role e on a.id=e.uid
 	left join `role` f on e.rid=f.id
 	where f.role_name in ('营销员','营销经理')	
-	and  a.status='正常'
+	and	 a.status='正常'
 	<if test="depId != null"> 
     and a.department_id =  #{depId,jdbcType=VARCHAR}
     </if>
   </select>
   
-   <select id="selectAdminCustomerDetailList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
+   <select id="selectAdminCustomerDetailList"  resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
   	select a.id,a.nickname as name,a.source,c.contacts,c.contact_mobile as contactMobile,
 	a.create_time as createTime,b.time_stamp as followTime
 	from user a 
 	left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b  on a.id=b.uid
 	left join organization_identity c on a.id=c.uid
-	where a.aid is not null
+	where a.aid is not null and  a.share_type=0 and a.type=1
 	<if test="aid != null"> 
 	and a.aid=  #{aid,jdbcType=VARCHAR}
     </if>
-	and  a.share_type=0 
-	and a.type=1
+    <if test="type==null">
+    and a.source !=4
+    </if>
+    <if test="type!=null and type == 0">
+    and a.source =1
+    and  a.create_time 
+    </if>
+    <if test="type!=null and type == 1">
+    and a.source =2
+    and  a.transfer_time 
+    </if>
 	<if test="startTime != null and endTime != null">
-	 and  a.create_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} 
+	  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} 
     </if>
    <if test="page_sql!=null">
 			${page_sql}
@@ -1119,12 +1127,18 @@
   	select count(*) from user a 
 	left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b  on a.id=b.uid
 	left join organization_identity c on a.id=c.uid
-	where a.aid is not null
+	where a.aid is not null and  a.share_type=0 and a.type=1
 	<if test="aid != null"> 
 	and a.aid=  #{aid,jdbcType=VARCHAR}
     </if>
-	and  a.share_type=0 
-	and a.type=1
+	<if test="type == null or type != 1">
+    and a.source !=0
+    and  a.create_time 
+    </if>
+    <if test="type!=null and type == 1">
+    and a.source =2
+    and  a.transfer_time 
+    </if>
 	<if test="startTime != null and endTime != null">
 	 and  a.create_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR} 
     </if>

+ 34 - 47
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -891,8 +891,11 @@
   	,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName,e.name as outsourceName
   	from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
   	left join department d on o.order_dep=d.id left join (select order_no,max(name)as name from outsource_organization group by order_no) e
-  	 on o.order_no=e.order_no where delete_sign = 0 and order_status = 2
-  	and approval in (0,2) and outsource=#{o.outsource,jdbcType=INTEGER}
+  	 on o.order_no=e.order_no where delete_sign = 0 
+  	and approval in (0,2) 
+  	<if test="o.outsource != null">
+  	and outsource=#{o.outsource,jdbcType=INTEGER}
+  	</if>
   	and process_status &gt;= 2
   	<if test="o.processStatus == 2">
   	and (o.finance_id is null or o.finance_id='') 
@@ -901,12 +904,19 @@
   	and o.finance_id is not null 
   	and o.finance_id != ''    
   	</if>
+  	<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
+  	and o.order_dep= #{o.departmentId,jdbcType=VARCHAR}
+  	</if>
   	<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
   	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
   	</if>
   	<if test="o.financeId != null and o.financeId != &quot;&quot;">
   	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
   	</if>
+  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  	</if>
+  	
   	<if test="o.buyerName != null and o.buyerName != &quot;&quot;">
   	<bind name="n" value="'%' + o.buyerName + '%'" />
   	and u.nickname  like #{n,jdbcType=VARCHAR}
@@ -923,7 +933,10 @@
   </select>
   <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
   select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
-  	where delete_sign = 0 and order_status = 2 and approval in (0,2) and outsource=#{o.outsource,jdbcType=INTEGER}
+  	where delete_sign = 0  and approval in (0,2) 
+	<if test="o.outsource != null">
+  	and outsource=#{o.outsource,jdbcType=INTEGER}
+  	</if>
   	and process_status &gt;= 2
   	<if test="o.processStatus == 2">
   	and (o.finance_id is null or o.finance_id='')
@@ -931,12 +944,18 @@
   	<if test="o.processStatus == 3">
   	and o.finance_id is not null and o.finance_id != ''    
   	</if>
+  	<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
+  	and o.order_dep= #{o.departmentId,jdbcType=VARCHAR}
+  	</if>
   	<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
   	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
   	</if>
   	<if test="o.financeId != null and o.financeId != &quot;&quot;">
   	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
   	</if>
+  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  	</if>
   	<if test="o.buyerName != null and o.buyerName != &quot;&quot;">
   	<bind name="n" value="'%' + o.buyerName + '%'" />
   	and u.nickname  like #{n,jdbcType=VARCHAR}
@@ -1044,6 +1063,9 @@
   		<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
 	  	and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
 	  	</if>
+	  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  	</if>
   		<if test="o.liquidationStatus != null and o.liquidationStatus != &quot;&quot;">
 	  	and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1087,6 +1109,9 @@
 	  	<if test="o.departmentId != null and o.departmentId != &quot;&quot;">
 	  	and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
 	  	</if>
+	  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
+  		and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
+  		</if>
 	  	<if test="o.liquidationStatus != null and o.liquidationStatus != &quot;&quot;">
 	  	and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
 	  	</if>
@@ -1135,14 +1160,16 @@
 where super_id is null )  e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
-  	where a.delete_sign = 0 
+  	where a.delete_sign = 0
+  	<if test="outsource != null">
   	and a.outsource= #{outsource,jdbcType=INTEGER}
+  	</if>
   	<if test="specially == 0">
   	and a.order_status not in(3,5,6,7) and a.approval !=3
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 1">
-  	and a.process_status =1  and a.order_status=1
+  	and a.process_status = 1  and a.order_status = 1
   	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
   	and c.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
@@ -1221,7 +1248,9 @@ where super_id is null ) e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
   	where a.delete_sign = 0 
+  	<if test="outsource != null">
   	and a.outsource= #{outsource,jdbcType=INTEGER}
+  	</if>
   	<if test="specially == 0">
   	and a.order_status not in(3,5,6,7) and a.approval !=3
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
@@ -1427,46 +1456,4 @@ where super_id is null ) e on e.order_no=a.order_no
   	select count(contract_no) from t_order_new
 	where contract_no= #{0}
   </select>										
-  <select id="orderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
-  select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
-	date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
-	b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
-	from t_order_outsource a
-	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
-	left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
-	left join admin f on b.finance_id=f.id
-	where 1=1
-	<if test="refundStatus != null">
-	and a.refund_status= #{refundStatus}
-	</if>
-	<if test="contractNo != null">
-	and b.contract_no like concat('%',#{contractNo},'%')
-	</if>
-	<if test="name != null">
-	and c.nickname like concat('%',#{name},'%')
-	</if>
-	<if test="startTime != null and endTime != null">
-	and b.create_time between #{startTime} and  #{endTime}
-	</if>
-	order by b.create_time desc
-  	<if test="page_sql!=null">
-			${page_sql}
-	</if>
-  </select>
-  <select id="orderOutsourceCount" resultType="java.lang.Integer">
-  select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
-  left join `user` c on b.buyer_id=c.id where 1=1
-  <if test="refundStatus != null">
-	and a.refund_status= #{refundStatus}
-	</if>
-	<if test="contractNo != null">
-	and b.contract_no like concat('%',#{contractNo},'%')
-	</if>
-	<if test="name != null">
-	and c.nickname like concat('%',#{name},'%')
-	</if>
-	<if test="starTime != null and endTime != null">
-	and b.create_time between #{starTime} and  #{endTime}
-	</if>
-  </select>
 </mapper>

+ 133 - 25
src/main/java/com/goafanti/common/mapper/TOrderOutsourceMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
@@ -16,12 +16,13 @@
     <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
     <result column="amount" jdbcType="DECIMAL" property="amount" />
     <result column="company_name" jdbcType="VARCHAR" property="companyName" />
+    <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -55,7 +56,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -89,16 +90,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     id, order_no, refund_status, create_time, remarks, attachment_url, picture_url, amount, 
-    company_name
+    company_name, audit_time
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderOutsourceExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     select
     <if test="distinct">
@@ -117,7 +118,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -128,7 +129,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     delete from t_order_outsource
     where id = #{id,jdbcType=INTEGER}
@@ -137,7 +138,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     delete from t_order_outsource
     <if test="_parameter != null">
@@ -148,22 +149,22 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     insert into t_order_outsource (id, order_no, refund_status, 
       create_time, remarks, attachment_url, 
-      picture_url, amount, company_name
-      )
+      picture_url, amount, company_name, 
+      audit_time)
     values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{refundStatus,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR}, 
-      #{pictureUrl,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{companyName,jdbcType=VARCHAR}
-      )
+      #{pictureUrl,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{companyName,jdbcType=VARCHAR}, 
+      #{auditTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderOutsource">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     insert into t_order_outsource
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -194,6 +195,9 @@
       <if test="companyName != null">
         company_name,
       </if>
+      <if test="auditTime != null">
+        audit_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -223,13 +227,16 @@
       <if test="companyName != null">
         #{companyName,jdbcType=VARCHAR},
       </if>
+      <if test="auditTime != null">
+        #{auditTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.TOrderOutsourceExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     select count(*) from t_order_outsource
     <if test="_parameter != null">
@@ -240,7 +247,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     <set>
@@ -271,6 +278,9 @@
       <if test="record.companyName != null">
         company_name = #{record.companyName,jdbcType=VARCHAR},
       </if>
+      <if test="record.auditTime != null">
+        audit_time = #{record.auditTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -280,7 +290,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     set id = #{record.id,jdbcType=INTEGER},
@@ -291,7 +301,8 @@
       attachment_url = #{record.attachmentUrl,jdbcType=VARCHAR},
       picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
       amount = #{record.amount,jdbcType=DECIMAL},
-      company_name = #{record.companyName,jdbcType=VARCHAR}
+      company_name = #{record.companyName,jdbcType=VARCHAR},
+      audit_time = #{record.auditTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -300,7 +311,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     <set>
@@ -328,6 +339,9 @@
       <if test="companyName != null">
         company_name = #{companyName,jdbcType=VARCHAR},
       </if>
+      <if test="auditTime != null">
+        audit_time = #{auditTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -335,7 +349,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jul 30 09:27:41 CST 2019.
+      This element was generated on Tue Jul 30 16:33:59 CST 2019.
     -->
     update t_order_outsource
     set order_no = #{orderNo,jdbcType=VARCHAR},
@@ -345,12 +359,106 @@
       attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
       picture_url = #{pictureUrl,jdbcType=VARCHAR},
       amount = #{amount,jdbcType=DECIMAL},
-      company_name = #{companyName,jdbcType=VARCHAR}
+      company_name = #{companyName,jdbcType=VARCHAR},
+      audit_time = #{auditTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectByOrderNo" resultType="com.goafanti.order.bo.OrderOutsourceDtails">
-   select id, order_no orderNo, refund_status refundStatus, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes , remarks, 
-   attachment_url attachmentUrl, picture_url pictureUrl, amount,company_name companyName from t_order_outsource
-    where order_no =  #{orderNo}
+  select id, order_no orderNo, refund_status refundStatus, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes , remarks,
+	 date_format(audit_time,'%Y-%m-%d %H:%i:%S') auditTimes,attachment_url attachmentUrl, picture_url pictureUrl, amount,
+	 company_name companyName from t_order_outsource where order_no =  #{orderNo}
+  </select>
+  <select id="orderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
+  select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
+	date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
+	b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
+	from t_order_outsource a
+	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
+	left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
+	left join admin f on b.finance_id=f.id
+	where b.approval in (0,2)
+	<if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="starTime != null and endTime != null">
+	and b.create_time between #{starTime} and  #{endTime}
+	</if>
+	order by b.create_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  <select id="orderOutsourceCount" resultType="java.lang.Integer">
+  select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
+  left join `user` c on b.buyer_id=c.id where b.approval in (0,2)
+  <if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="starTime != null and endTime != null">
+	and b.create_time between #{starTime} and  #{endTime}
+	</if>
+  </select>
+    <select id="salesmanOrderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
+    select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,
+	date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
+	b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,f.name financeName
+	from t_order_outsource a
+	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
+	left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
+	left join admin f on b.finance_id=f.id
+	where 1=1 and b.outsource=1
+		and d.department_id in
+  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
+	 #{deps.id}
+  	</foreach>
+	<if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="starTime != null and endTime != null">
+	and b.create_time between #{starTime} and  #{endTime}
+	</if>
+	order by b.create_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  <select id="salesmanOrderOutsourceCount" resultType="java.lang.Integer">
+  select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
+  left join `user` c on b.buyer_id=c.id  left join admin d on b.salesman_id=d.id
+  where 1=1 and b.outsource=1
+  	and d.department_id in
+  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
+	 #{deps.id}
+  	</foreach>
+  <if test="refundStatus != null">
+	and a.refund_status= #{refundStatus}
+	</if>
+	<if test="contractNo != null">
+	and b.contract_no like concat('%',#{contractNo},'%')
+	</if>
+	<if test="name != null">
+	and c.nickname like concat('%',#{name},'%')
+	</if>
+	<if test="starTime != null and endTime != null">
+	and b.create_time between #{starTime} and  #{endTime}
+	</if>
   </select>
 </mapper>

+ 230 - 295
src/main/java/com/goafanti/common/model/TOrderOutsource.java

@@ -4,300 +4,235 @@ import java.math.BigDecimal;
 import java.util.Date;
 
 public class TOrderOutsource {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.id
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private Integer id;
 
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.order_no
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String orderNo;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.refund_status
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private Integer refundStatus;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.create_time
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private Date createTime;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.remarks
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String remarks;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.attachment_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String attachmentUrl;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.picture_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String pictureUrl;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.amount
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private BigDecimal amount;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column t_order_outsource.company_name
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    private String companyName;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.id
-     *
-     * @return the value of t_order_outsource.id
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public Integer getId() {
-        return id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.id
-     *
-     * @param id the value for t_order_outsource.id
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.order_no
-     *
-     * @return the value of t_order_outsource.order_no
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.order_no
-     *
-     * @param orderNo the value for t_order_outsource.order_no
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.refund_status
-     *
-     * @return the value of t_order_outsource.refund_status
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public Integer getRefundStatus() {
-        return refundStatus;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.refund_status
-     *
-     * @param refundStatus the value for t_order_outsource.refund_status
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setRefundStatus(Integer refundStatus) {
-        this.refundStatus = refundStatus;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.create_time
-     *
-     * @return the value of t_order_outsource.create_time
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.create_time
-     *
-     * @param createTime the value for t_order_outsource.create_time
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.remarks
-     *
-     * @return the value of t_order_outsource.remarks
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getRemarks() {
-        return remarks;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.remarks
-     *
-     * @param remarks the value for t_order_outsource.remarks
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setRemarks(String remarks) {
-        this.remarks = remarks;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.attachment_url
-     *
-     * @return the value of t_order_outsource.attachment_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getAttachmentUrl() {
-        return attachmentUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.attachment_url
-     *
-     * @param attachmentUrl the value for t_order_outsource.attachment_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setAttachmentUrl(String attachmentUrl) {
-        this.attachmentUrl = attachmentUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.picture_url
-     *
-     * @return the value of t_order_outsource.picture_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getPictureUrl() {
-        return pictureUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.picture_url
-     *
-     * @param pictureUrl the value for t_order_outsource.picture_url
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setPictureUrl(String pictureUrl) {
-        this.pictureUrl = pictureUrl;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.amount
-     *
-     * @return the value of t_order_outsource.amount
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public BigDecimal getAmount() {
-        return amount;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.amount
-     *
-     * @param amount the value for t_order_outsource.amount
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setAmount(BigDecimal amount) {
-        this.amount = amount;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column t_order_outsource.company_name
-     *
-     * @return the value of t_order_outsource.company_name
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public String getCompanyName() {
-        return companyName;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column t_order_outsource.company_name
-     *
-     * @param companyName the value for t_order_outsource.company_name
-     *
-     * @mbg.generated Tue Jul 30 09:27:41 CST 2019
-     */
-    public void setCompanyName(String companyName) {
-        this.companyName = companyName;
-    }
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.id
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.order_no
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String orderNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.refund_status
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Integer refundStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.create_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.remarks
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String remarks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.attachment_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String attachmentUrl;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.picture_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String pictureUrl;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.amount
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private BigDecimal amount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.company_name
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private String companyName;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.audit_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	private Date auditTime;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.id
+	 * @return  the value of t_order_outsource.id
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.id
+	 * @param id  the value for t_order_outsource.id
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.order_no
+	 * @return  the value of t_order_outsource.order_no
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getOrderNo() {
+		return orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.order_no
+	 * @param orderNo  the value for t_order_outsource.order_no
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.refund_status
+	 * @return  the value of t_order_outsource.refund_status
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Integer getRefundStatus() {
+		return refundStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.refund_status
+	 * @param refundStatus  the value for t_order_outsource.refund_status
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setRefundStatus(Integer refundStatus) {
+		this.refundStatus = refundStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.create_time
+	 * @return  the value of t_order_outsource.create_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.create_time
+	 * @param createTime  the value for t_order_outsource.create_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.remarks
+	 * @return  the value of t_order_outsource.remarks
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getRemarks() {
+		return remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.remarks
+	 * @param remarks  the value for t_order_outsource.remarks
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.attachment_url
+	 * @return  the value of t_order_outsource.attachment_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getAttachmentUrl() {
+		return attachmentUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.attachment_url
+	 * @param attachmentUrl  the value for t_order_outsource.attachment_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setAttachmentUrl(String attachmentUrl) {
+		this.attachmentUrl = attachmentUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.picture_url
+	 * @return  the value of t_order_outsource.picture_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getPictureUrl() {
+		return pictureUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.picture_url
+	 * @param pictureUrl  the value for t_order_outsource.picture_url
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setPictureUrl(String pictureUrl) {
+		this.pictureUrl = pictureUrl;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.amount
+	 * @return  the value of t_order_outsource.amount
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public BigDecimal getAmount() {
+		return amount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.amount
+	 * @param amount  the value for t_order_outsource.amount
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setAmount(BigDecimal amount) {
+		this.amount = amount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.company_name
+	 * @return  the value of t_order_outsource.company_name
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public String getCompanyName() {
+		return companyName;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.company_name
+	 * @param companyName  the value for t_order_outsource.company_name
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.audit_time
+	 * @return  the value of t_order_outsource.audit_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public Date getAuditTime() {
+		return auditTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.audit_time
+	 * @param auditTime  the value for t_order_outsource.audit_time
+	 * @mbg.generated  Tue Jul 30 16:33:59 CST 2019
+	 */
+	public void setAuditTime(Date auditTime) {
+		this.auditTime = auditTime;
+	}
 }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 892 - 873
src/main/java/com/goafanti/common/model/TOrderOutsourceExample.java


+ 28 - 0
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -125,6 +125,34 @@ public class FileUtils {
 		}
 		return fileName;
 	}
+	
+	/**
+	 * 根据上传文件 拼接fileName
+	 * 
+	 * @param mf
+	 * @param isPrivate
+	 * @param sign
+	 * @param path
+	 * @return
+	 */
+	public static String splicingFileName(MultipartFile mf, boolean isPrivate, String sign, String path, String uid) {
+		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
+		boolean uniq = false;
+		if (sign!= null ){
+			uniq = true;
+		}
+		String fileName = "";
+		if (isPrivate || StringUtils.isNotBlank(sign)) {
+			if (uniq) {
+				fileName = path + uid + "/" + System.nanoTime() + "_" + sign + suffix;
+			} else {
+				fileName = path + uid + "/" +  sign + suffix;
+			}
+		} else {
+			fileName = path + uid + "/" + System.nanoTime() + suffix;
+		}
+		return fileName;
+	}
 
 	/**
 	 * 获取下载文件名称

+ 2 - 2
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -1133,9 +1133,9 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/selectAdminCustomerList", method = RequestMethod.GET)
-	public Result selectAdminCustomerList(String aid, String startTime,String endTime, Integer pageSize, Integer pageNo) {
+	public Result selectAdminCustomerList(String aid, String startTime,String endTime,Integer type, Integer pageSize, Integer pageNo) {
 		Result res = new Result();
-		res.data(adminService.selectAdminCustomerList( aid,  startTime, endTime,  pageSize,  pageNo));
+		res.data(adminService.selectAdminCustomerList( aid,  startTime, endTime,  type, pageSize,  pageNo));
 		return res;
 	}
 	

+ 15 - 0
src/main/java/com/goafanti/order/bo/OrderOutsourceDtails.java

@@ -3,5 +3,20 @@ package com.goafanti.order.bo;
 import com.goafanti.common.model.TOrderOutsource;
 
 public class OrderOutsourceDtails extends TOrderOutsource {
+	private String createTimes;
+	private String auditTimes;
+	public String getCreateTimes() {
+		return createTimes;
+	}
+	public void setCreateTimes(String createTimes) {
+		this.createTimes = createTimes;
+	}
+	public String getAuditTimes() {
+		return auditTimes;
+	}
+	public void setAuditTimes(String auditTimes) {
+		this.auditTimes = auditTimes;
+	}
+	
 		
 }

+ 4 - 28
src/main/java/com/goafanti/order/bo/TOrderLogBo.java

@@ -3,45 +3,21 @@ package com.goafanti.order.bo;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.model.TOrderLog;
 
 //@SuppressWarnings("unused")
 public class TOrderLogBo extends TOrderLog{
+	@SuppressWarnings("unused")
 	private String processName;
 	private String adminName;
+	@SuppressWarnings("unused")
 	private String createDate;
 	
 	
 
 	public String getProcessName() {
-		switch (super.getProcess()) {
-		case 1:
-			return "提交";
-		case 2:
-			return "审核";
-		case 3:
-			return "驳回";
-		case 4:
-			return "特批";
-		case 5:
-			return "财务派单";
-		case 6:
-			return "财务首付";
-		case 7:
-			return "订单派单";
-		case 8:
-			return "项目派单";
-		case 9:
-			return "项目完成";
-		case 0:
-			return "发起退单";
-		case 10:
-		return "退单完成";
-		case 11:
-			return "财务全款";
-		default:
-			return "未知";
-		}
+		return OrderLogProcess.getValueByCode(super.getProcess());
 	}
 
 	public void setProcessName(String processName) {

+ 3 - 57
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -268,24 +268,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		}
 		return res.data(orderNewService.updateOrderNew(orderNo,orderStatus,reason,0,null));
 	}
-	/**
-	 * 审核并外包
-	 */
-	@RequestMapping(value="/auditOutsource", method = RequestMethod.POST)
-	public Result auditOutsource(TOrderOutsource o,Integer orderStatus){
-		Result res=new Result();
-		if(StringUtils.isBlank(o.getOrderNo())||StringUtils.isBlank(o.getCompanyName())||
-				o.getAmount()==null){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
-			return res;
-		}
-		if(orderStatus==null||(orderStatus!=OrderNewState.QDSHTG.getCode()&&orderStatus!=OrderNewState.QDSHJJ.getCode())||
-				orderNewService.chekeOrderStatus(o.getOrderNo())){
-			res.getError().add(buildError( "审核状态错误","审核状态错误"));
-			return res;
-		}
-		return res.data(orderNewService.updateOrderNew(o.getOrderNo(),orderStatus,null,1,o));
-	}
+	
 	
 	/**
 	 * 催款统计列表
@@ -417,37 +400,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
-	/**
-	 * 外包审核列表
-	 */
-	@RequestMapping(value="/orderOutsourceList", method = RequestMethod.GET)
-	public Result orderOutsourceList(String name,String contractNo,String starTime,String endTime,Integer refundStatus,Integer pageNo,Integer pageSize){
-		Result res=new Result();
-		res.data(orderNewService.orderOutsourceList(name, contractNo, starTime, endTime,refundStatus, pageNo, pageSize));
-		return res;
-	}
-	/**
-	 * 外包审核详情
-	 */
-	@RequestMapping(value="/orderOutsourceDtails", method = RequestMethod.GET)
-	public Result orderOutsourceDtails(String orderNo){
-		Result res=new Result();
-		res.data(orderNewService.orderOutsourceDtails(orderNo));
-		return res;
-	}
-	/**
-	 * 外包审核
-	 */
-	@RequestMapping(value="/auditOutsource", method = RequestMethod.GET)
-	public Result auditOutsource(OrderOutsourceDtails o){
-		Result res=new Result();
-		if (o.getId()==null||o.getRefundStatus()==null||o.getRemarks()==null) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
-			return res;
-		}
-		res.data(orderNewService.updateAuditOutsource(o));
-		return res;
-	}
+	
 	
 	
 	
@@ -514,14 +467,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
-	/** 外包文件上传 **/
-	@RequestMapping(value = "/uploadOutsourceFile", method = RequestMethod.POST)
-	public Result uploadOutsourceFile(HttpServletRequest req,String sign){
-		Result res = new Result();
-		//order_refund_file
-		res.setData(handleFile(res, "/order_outsource/", false, req, sign));
-		return res;
-	}
+	
 	
 	
 

+ 98 - 0
src/main/java/com/goafanti/order/controller/OutsourceOrgApiController.java

@@ -3,7 +3,10 @@ package com.goafanti.order.controller;
 
 
 
+
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -11,8 +14,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.OutsourceOrganization;
+import com.goafanti.common.model.TOrderOutsource;
+import com.goafanti.order.bo.OrderOutsourceDtails;
+import com.goafanti.order.enums.OrderNewState;
+import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OutsourceOrgService;
 
 @RestController
@@ -21,6 +29,8 @@ public class OutsourceOrgApiController extends CertifyApiController {
 	
 	@Resource
 	private OutsourceOrgService	outsourceOrgService;
+	@Resource
+	private OrderNewService	orderNewService;
 	
 	@RequestMapping(value = "/addOutsourceOrg", method=RequestMethod.POST)
 	public Result addOutsourceOrg(OutsourceOrganization o) {
@@ -67,6 +77,14 @@ public class OutsourceOrgApiController extends CertifyApiController {
 		res.data(outsourceOrgService.selectOutsourceOrg(orderNo,tid));
 		return res;
 	}
+	/** 外包文件上传 **/
+	@RequestMapping(value = "/uploadOutsourceFile", method = RequestMethod.POST)
+	public Result uploadOutsourceFile(HttpServletRequest req,String sign){
+		Result res = new Result();
+		//order_refund_file
+		res.setData(handleFile(res, "/order_outsource/", false, req, sign));
+		return res;
+	}
 	/**
 	 * 订单外包列表
 	 * @param orderNo
@@ -82,4 +100,84 @@ public class OutsourceOrgApiController extends CertifyApiController {
 		res.data(outsourceOrgService.selectOrderOutsourceOrg(orderNo));
 		return res;
 	}
+	
+	/**
+	 * 审核并外包
+	 */
+	@RequestMapping(value="/auditOutsource", method = RequestMethod.POST)
+	public Result auditOutsource(TOrderOutsource o,Integer orderStatus){
+		Result res=new Result();
+		if(StringUtils.isBlank(o.getOrderNo())||StringUtils.isBlank(o.getCompanyName())||
+				o.getAmount()==null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
+			return res;
+		}
+		if(orderStatus==null||(orderStatus!=OrderNewState.QDSHTG.getCode()&&orderStatus!=OrderNewState.QDSHJJ.getCode())||
+				orderNewService.chekeOrderStatus(o.getOrderNo())){
+			res.getError().add(buildError( "审核状态错误","审核状态错误"));
+			return res;
+		}
+		return res.data(orderNewService.updateOrderNew(o.getOrderNo(),orderStatus,null,1,o));
+	}
+	/**
+	 * 外包审核列表
+	 */
+	@RequestMapping(value="/orderOutsourceList", method = RequestMethod.GET)
+	public Result orderOutsourceList(String name,String contractNo,String starTime,String endTime,Integer refundStatus,Integer pageNo,Integer pageSize){
+		Result res=new Result();
+		res.data(outsourceOrgService.orderOutsourceList(name, contractNo, starTime, endTime,refundStatus, pageNo, pageSize));
+		return res;
+	}
+	
+	/**
+	 * 外包审核列表(营销管理员列表)
+	 */
+	@RequestMapping(value="/salesmanOrderOutsourceList", method = RequestMethod.GET)
+	public Result salesmanOrderOutsourceList(String name,String contractNo,String starTime,String endTime,Integer refundStatus,Integer pageNo,Integer pageSize){
+		Result res=new Result();
+		res.data(outsourceOrgService.salesmanOrderOutsourceList(name, contractNo, starTime, endTime,refundStatus, pageNo, pageSize));
+		return res;
+	}
+	/**
+	 * 外包审核详情
+	 */
+	@RequestMapping(value="/orderOutsourceDtails", method = RequestMethod.GET)
+	public Result orderOutsourceDtails(String orderNo){
+		Result res=new Result();
+		res.data(outsourceOrgService.orderOutsourceDtails(orderNo));
+		return res;
+	}
+	/**
+	 * 外包审核
+	 */
+	@RequestMapping(value="/auditOutsourceNew", method = RequestMethod.POST)
+	public Result auditOutsourceNew(OrderOutsourceDtails o){
+		Result res=new Result();
+		if (o.getId()==null||null==o.getRefundStatus()||StringUtils.isBlank(o.getRemarks())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包信息","外包信息"));
+			return res;
+		}
+		res.data(outsourceOrgService.updateAuditOutsource(o));
+		return res;
+	}
+	 /**
+     *	 下载文档
+     * 
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/downloadFile", method = RequestMethod.GET)
+    public Result downloadTemplateFile(HttpServletResponse response, String path) {
+        Result res = new Result();
+            if (null == path) {
+                res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "", "找不到文件!"));
+            } else {
+               String suffix = path.substring(path.lastIndexOf("."));
+               String name=path.substring(path.lastIndexOf("_")+1, path.lastIndexOf("."));
+                String fileName = name + suffix;
+                downloadFile(response, fileName, path);
+        } 
+        return res;
+    } 
+    
 }

+ 2 - 0
src/main/java/com/goafanti/order/enums/ProcessStatus.java

@@ -23,6 +23,8 @@ public enum ProcessStatus {
 	YBFPZXSGLY(5,"已部分分派咨询师经理"),
 	/** 已全部分派咨询师经理 **/
 	YQBFPZXSGLY(6,"已全部分派咨询师经理"),
+	/** 已派特批审核 **/
+	YPTPSH(7,"已派特批审核"),
 	/** 无效 **/
 	INVALID(10, "INVALID");
 	

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

@@ -169,10 +169,7 @@ public interface OrderNewService {
 	
 	int updateFinance(String orderNo, String newFinance);
 	List<TOrderLogBo> selectOrderLog(String orderNo);
-	Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime, String endTime,Integer refundStatus, Integer pageNo,
-			Integer pageSize);
-	OrderOutsourceDtails orderOutsourceDtails(String orderNo);
-	int updateAuditOutsource(OrderOutsourceDtails o);
+
 	
 	
 }

+ 13 - 0
src/main/java/com/goafanti/order/service/OutsourceOrgService.java

@@ -3,6 +3,9 @@ package com.goafanti.order.service;
 import java.util.List;
 
 import com.goafanti.common.model.OutsourceOrganization;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.OrderOutsourceBo;
+import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.bo.OutsourceOrganizationBo;
 
 public interface OutsourceOrgService {
@@ -16,6 +19,16 @@ public interface OutsourceOrgService {
 	List<OutsourceOrganizationBo> selectOutsourceOrg(String orderNo,String tid);
 
 	List<OutsourceOrganizationBo> selectOrderOutsourceOrg(String orderNo);
+	
+	Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime, String endTime,Integer refundStatus, Integer pageNo,
+			Integer pageSize);
+	
+	OrderOutsourceDtails orderOutsourceDtails(String orderNo);
+	
+	int updateAuditOutsource(OrderOutsourceDtails o);
+
+	Pagination<OrderOutsourceBo> salesmanOrderOutsourceList(String name, String contractNo, String starTime, String endTime,
+			Integer refundStatus, Integer pageNo, Integer pageSize);
 
 	
 }

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

@@ -88,7 +88,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 	public Pagination<OrderListBo> allUnassignedOrder(OrderListBo order, Integer pageNo,
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
-		if (order.getOutsource()==null)order.setOutsource(0);//默认非外包 
+		//if (order.getOutsource()==null)order.setOutsource(0);//默认非外包 
 		params.put("o", order);
 		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("getAllUnassignedListOrder", "getAllUnassignedCountOrder", params, pageNo, pageSize);
 		return data;

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

@@ -408,7 +408,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
-		params.put("outsource", outsource==null?0:outsource);
+		params.put("outsource", outsource);
 		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, pageNo, pageSize);
 		return p;
 	}
@@ -423,11 +423,15 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (orderStatus==OrderNewState.QDSHTG.getCode()) {
 			if (t2.getApproval()==ApprovalNewState.FTP.getCode()) {//如果通过分配给财务管理员
 				t.setProcessStatus(ProcessStatus.YPCWGLY.getCode());
-				addOrderLog(orderNo, OrderLogProcess.SH.getCode());
-			}else if (t2.getApproval()==ApprovalNewState.DSH.getCode()) {
+			}else {
+				t.setProcessStatus(ProcessStatus.YPTPSH.getCode());
+			}
+			if(outsource!=null&&outsource==1) {
+				t.setOutsource(outsource);
+				addOrderLog(orderNo, OrderLogProcess.FQWB.getCode());
+			}else {
 				addOrderLog(orderNo, OrderLogProcess.SH.getCode());
 			}
-			if(outsource!=null&&outsource==1)t.setOutsource(outsource);
 		}
 		if (outsource==0) {//非外包
 			if (orderStatus==OrderNewState.QDSHJJ.getCode()) {//如果不通过新增驳回
@@ -435,9 +439,10 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				addBackOrder(orderNo, reason);
 				addOrderLog(orderNo, OrderLogProcess.BH.getCode());
 			}
-			t.setOrderStatus(orderStatus);
+			
 		}else if (outsource==1) {//外包
 			o.setRefundStatus(0);
+			
 			if(o.getId()==null) {
 				o.setCreateTime(new Date());
 				tOrderOutsourceMapper.insertSelective(o);
@@ -445,7 +450,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
 			}
 		}
-		
+		t.setOrderStatus(orderStatus);
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
 	}
 
@@ -541,10 +546,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Override
 	public int updateApprovalOrder(String orderNo,Integer confirm,String reason) {
 		TOrderNew t=new TOrderNew();
+		TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(orderNo);
 		t.setOrderNo(orderNo);
 		if (confirm==2) {
 			t.setApproval(2);
-			t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
+			if(t2.getOutsource()==0)t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
 			addOrderLog(orderNo, OrderLogProcess.TP.getCode());
 		} else {
 			t.setApproval(3);
@@ -588,10 +594,10 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Override
 	public boolean chekeOrderStatus(String orderNo) {
 		TOrderNew tOrder= tOrderNewMapper.selectByPrimaryKey(orderNo);
-		if (tOrder.getOrderStatus()!=OrderNewState.QDDS.getCode()) {
-			return true;
+		if (tOrder.getOrderStatus()==OrderNewState.QDDS.getCode()||tOrder.getOrderStatus()==OrderNewState.QDSHTG.getCode()) {
+			return false;
 		}
-		return false;
+		return true;
 	}
 
 
@@ -817,34 +823,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
-	@Override
-	@SuppressWarnings("unchecked")
-	public Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime,
-			String endTime,Integer refundStatus, Integer pageNo, Integer pageSize) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		if(pageSize==null||pageSize<0)pageSize=10;
-		if(pageNo==null||pageNo<0)pageNo=1;
-		if (StringUtils.isNotBlank(name)) params.put("name", name);
-		if(refundStatus != null) params.put("refundStatus", refundStatus);
-		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
-		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
-		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
-		Pagination<OrderOutsourceBo> p = (Pagination<OrderOutsourceBo>)findPage("orderOutsourceList", "orderOutsourceCount", params, pageNo, pageSize);
-		return p;
-	}
-
-
-
-	@Override
-	public OrderOutsourceDtails orderOutsourceDtails(String orderNo) {
-		return tOrderOutsourceMapper.selectByOrderNo(orderNo);
-	}
-
 
-
-	@Override
-	public int updateAuditOutsource(OrderOutsourceDtails o) {
-		return tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
-	}
 	
 }

+ 94 - 1
src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java

@@ -1,18 +1,44 @@
 package com.goafanti.order.service.impl;
 
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
+import org.apache.commons.lang3.StringUtils;
+import org.hibernate.validator.constraints.Mod11Check.ProcessingDirection;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.dao.OutsourceOrganizationMapper;
+import com.goafanti.common.dao.TOrderLogMapper;
+import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.dao.TOrderOutsourceMapper;
+import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.model.OutsourceOrganization;
+import com.goafanti.common.model.TOrderLog;
+import com.goafanti.common.model.TOrderNew;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.OrderOutsourceBo;
+import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.bo.OutsourceOrganizationBo;
+import com.goafanti.order.enums.ProcessStatus;
+import com.goafanti.order.service.OrderService;
 import com.goafanti.order.service.OutsourceOrgService;
 @Service
-public class OutsourceOrgServiceImpl implements OutsourceOrgService {
+public class OutsourceOrgServiceImpl  extends BaseMybatisDao<TOrderOutsourceMapper> implements OutsourceOrgService {
 	@Autowired
 	private OutsourceOrganizationMapper  outsourceOrganizationMapper;
+	@Autowired
+	private TOrderOutsourceMapper	tOrderOutsourceMapper;
+	@Autowired
+	private TOrderNewMapper	tOrderNewMapper;
+	@Autowired
+	private OrderService	orderService;
+	@Autowired
+	private TOrderLogMapper	tOrderLogMapper;
 	@Override
 	public int addOutsourceOrg(OutsourceOrganization o) {
 		return outsourceOrganizationMapper.insertSelective(o);
@@ -35,5 +61,72 @@ public class OutsourceOrgServiceImpl implements OutsourceOrgService {
 		
 		return outsourceOrganizationMapper.selectOrderOutsourceOrg(orderNo);
 	}
+	
+	@Override
+	@SuppressWarnings("unchecked")
+	public Pagination<OrderOutsourceBo> orderOutsourceList(String name, String contractNo, String starTime,
+			String endTime,Integer refundStatus, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if(refundStatus != null) params.put("refundStatus", refundStatus);
+		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
+		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
+		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
+		Pagination<OrderOutsourceBo> p = (Pagination<OrderOutsourceBo>)findPage("orderOutsourceList", "orderOutsourceCount", params, pageNo, pageSize);
+		return p;
+	}
+
+
+
+	@Override
+	public OrderOutsourceDtails orderOutsourceDtails(String orderNo) {
+		return tOrderOutsourceMapper.selectByOrderNo(orderNo);
+	}
+
+
+
+	@Override
+	public int updateAuditOutsource(OrderOutsourceDtails o) {
+		o.setAuditTime(new Date());
+		TOrderNew t=new TOrderNew();
+		TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(o.getOrderNo());
+		if (o.getRefundStatus()==1) {
+			t.setOrderStatus(2);//订单审核标记通过
+			t.setProcessStatus(t2.getApproval()==0?ProcessStatus.YPCWGLY.getCode():ProcessStatus.YPZXSGLY.getCode());
+			addOrderLog(o.getOrderNo(),OrderLogProcess.WBSH.getCode());
+			tOrderNewMapper.updateByPrimaryKeySelective(t);
+		}else {
+			t.setOrderStatus(3);
+			addOrderLog(o.getOrderNo(),OrderLogProcess.WBBH.getCode());
+		}
+		return tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
+	}
+	
+	public void addOrderLog(String orderNo, Integer code) {
+		TOrderLog tl=new TOrderLog();
+		tl.setOrderNo(orderNo);
+		tl.setProcess(code);
+		tl.setAid(TokenManager.getAdminId());
+		tOrderLogMapper.insertSelective(tl);
+		
+	}
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderOutsourceBo> salesmanOrderOutsourceList(String name, String contractNo, String starTime,
+			String endTime, Integer refundStatus, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		params.put("deps", orderService.selectMyDeps());
+		if(refundStatus != null) params.put("refundStatus", refundStatus);
+		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
+		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
+		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
+		Pagination<OrderOutsourceBo> p = (Pagination<OrderOutsourceBo>)findPage("salesmanOrderOutsourceList", "salesmanOrderOutsourceCount", params, pageNo, pageSize);
+		return p;
+	}
 
 }

+ 4 - 5
src/main/resources/props/config_local.properties

@@ -60,13 +60,12 @@ template.cacheable=false
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-#static.host=//sb.jishutao.com/1.1.12
-#avatar.host=//sb.jishutao.com
+static.host=//sb.jishutao.com/1.1.13
+avatar.host=//sb.jishutao.com
 
 #连测试
-avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.12
-
+#avatar.host=//static.jishutao.com
+#static.host=//static.jishutao.com/1.1.13
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload
 

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -54,7 +54,7 @@ session.validate.timespan=18000000
 app.name=AFT
 template.cacheable=false
 
-static.host=//static.jishutao.com/1.1.12
+static.host=//static.jishutao.com/1.1.13
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload