Browse Source

订单退单详情与修改更新

anderx 7 years ago
parent
commit
79acad3bb8
25 changed files with 648 additions and 212 deletions
  1. 1 1
      GeneratorConfig.xml
  2. 26 0
      src/main/java/com/goafanti/admin/bo/AdminContacts.java
  3. 21 0
      src/main/java/com/goafanti/admin/bo/AdminListBo.java
  4. 35 0
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  5. 6 0
      src/main/java/com/goafanti/admin/service/AdminService.java
  6. 42 2
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  7. 7 0
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  8. 14 27
      src/main/java/com/goafanti/common/dao/TOrderBonusMapper.java
  9. 4 0
      src/main/java/com/goafanti/common/dao/TOrderNewMapper.java
  10. 51 1
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  11. 2 2
      src/main/java/com/goafanti/common/mapper/TDunLogMapper.xml
  12. 96 78
      src/main/java/com/goafanti/common/mapper/TOrderBonusMapper.xml
  13. 4 4
      src/main/java/com/goafanti/common/mapper/TOrderDunMapper.xml
  14. 9 1
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  15. 3 3
      src/main/java/com/goafanti/common/mapper/TTaskHoursMapper.xml
  16. 47 24
      src/main/java/com/goafanti/common/model/TOrderBonus.java
  17. 96 56
      src/main/java/com/goafanti/common/model/TOrderBonusExample.java
  18. 71 0
      src/main/java/com/goafanti/order/bo/OrderRefundDetailBo.java
  19. 55 6
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  20. 1 1
      src/main/java/com/goafanti/order/controller/OrderProjectApiController.java
  21. 2 2
      src/main/java/com/goafanti/order/enums/ProjectNewStage.java
  22. 1 1
      src/main/java/com/goafanti/order/enums/TaskState.java
  23. 6 1
      src/main/java/com/goafanti/order/service/OrderNewService.java
  24. 31 2
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  25. 17 0
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

+ 1 - 1
GeneratorConfig.xml

@@ -9,6 +9,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="aft" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="aft" />
     <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="aft" type="XMLMAPPER" />
-    <table schema="aft" tableName="t_task_hours"/> 
+    <table schema="aft" tableName="t_order_bonus"/> 
   </context>
 </generatorConfiguration>

+ 26 - 0
src/main/java/com/goafanti/admin/bo/AdminContacts.java

@@ -0,0 +1,26 @@
+package com.goafanti.admin.bo;
+
+public class AdminContacts {
+	private String id;
+	private String aid;
+	private String contactsId;
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getAid() {
+		return aid;
+	}
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+	public String getContactsId() {
+		return contactsId;
+	}
+	public void setContactsId(String contactsId) {
+		this.contactsId = contactsId;
+	}
+	
+}

+ 21 - 0
src/main/java/com/goafanti/admin/bo/AdminListBo.java

@@ -91,6 +91,11 @@ public class AdminListBo {
 	/** 角色 id**/
 	private List<String> rolesId;
 	
+	
+	private String contactMobile;
+	
+	private String contactId;
+	
 	public List<String> getRolesId() {
 		return rolesId;
 	}
@@ -264,4 +269,20 @@ public class AdminListBo {
 		this.password = password;
 	}
 
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile;
+	}
+
+	public String getContactId() {
+		return contactId;
+	}
+
+	public void setContactId(String contactId) {
+		this.contactId = contactId;
+	}
+
 }

+ 35 - 0
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -3092,5 +3092,40 @@ public class AdminApiController extends CertifyApiController {
 		res.setData(adminService.updateLockAdmin());
 		return res;
 	}
+	/**
+	 * 新建常用联系人
+	 */
+	@RequestMapping(value = "/addFrequentContacts", method = RequestMethod.POST)
+	public Result addFrequentContacts(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "常用联系人"));
+			return res;
+		}
+		res.setData(adminService.addFrequentContacts(id));
+		return res;
+	}
+	/**
+	 * 常用联系人列表
+	 */
+	@RequestMapping(value = "/frequentContactsList", method = RequestMethod.GET)
+	public Result frequentContactsList(String departmentId,String name,Integer pageSize,Integer pageNo) {
+		Result res = new Result();
+		res.setData(adminService.frequentContactsList(departmentId, name, pageSize, pageNo));
+		return res;
+	}
+	/**
+	 * 删除常用联系人
+	 */
+	@RequestMapping(value = "/deleteFrequentContacts", method = RequestMethod.POST)
+	public Result deleteFrequentContacts(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "常用联系人"));
+			return res;
+		}
+		res.setData(adminService.deleteFrequentContacts(id));
+		return res;
+	}
 	
 }

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

@@ -70,4 +70,10 @@ public interface AdminService {
 	List<Admin> getListDefaultPassword(String id);
 
 	List<Admin> getAdminRoleList(String roleName);
+
+	int addFrequentContacts(String id);
+
+	Pagination<AdminListBo>  frequentContactsList(String depId, String name, Integer pageSize, Integer pageNo);
+
+	int deleteFrequentContacts(String id);
 }

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

@@ -5,6 +5,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.UUID;
 
 import javax.annotation.Resource;
 
@@ -12,6 +13,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.admin.bo.AdminContacts;
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.service.AdminService;
@@ -28,6 +30,7 @@ import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.LockingReleaseBo;
+import com.goafanti.order.bo.TOrderNewBo;
 
 @Service
 public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements AdminService {
@@ -321,10 +324,47 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@Override
 	public List<Admin> getAdminRoleList(String roleName) {
-		
 		return adminMapper.getAdminRoleList(roleName);
 	}
 
-	
+	@Override
+	public int addFrequentContacts(String id) {
+		String []ss=id.split(",");
+		List<String> list=adminMapper.getaidFrequentContacts(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+		for (String s : ss) {
+			boolean flag=true;
+			for (String s2 : list) {
+				if (s.equals(s2)) {
+					flag=false;
+				}
+			}
+			if (flag) {
+				AdminContacts a=new AdminContacts();
+				a.setId(UUID.randomUUID().toString());
+				a.setAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+				a.setContactsId(s);
+				adminMapper.addAdminContacts(a);
+			}
+		}
+		return 1;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AdminListBo> frequentContactsList(String depId, String name, 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(depId)) params.put("depId", depId);
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+		Pagination<AdminListBo> p = (Pagination<AdminListBo>)findPage("frequentContactsList", "frequentContactsCount", params, pageNo, pageSize);
+		return p;
+	}
+
+	@Override
+	public int deleteFrequentContacts(String id) {
+		return adminMapper.deleteFrequentContacts(id);
+	}
 
 }

+ 7 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 
+import com.goafanti.admin.bo.AdminContacts;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.app.bo.AppAdminListBo;
 import com.goafanti.common.model.Admin;
@@ -180,4 +181,10 @@ public interface AdminMapper {
 
 	List<Admin> getAdminRoleList(String roleName);
 
+	int addAdminContacts(AdminContacts a);
+
+	int deleteFrequentContacts(String id);
+
+	List<String> getaidFrequentContacts(String id);
+
 }

+ 14 - 27
src/main/java/com/goafanti/common/dao/TOrderBonusMapper.java

@@ -12,72 +12,59 @@ public interface TOrderBonusMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
-	int countByExample(TOrderBonusExample example);
-
+	long countByExample(TOrderBonusExample example);
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	int deleteByExample(TOrderBonusExample example);
-
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	int deleteByPrimaryKey(String id);
-
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	int insert(TOrderBonus record);
-
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	int insertSelective(TOrderBonus record);
-
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	List<TOrderBonus> selectByExample(TOrderBonusExample example);
-
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	TOrderBonus selectByPrimaryKey(String id);
-
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
-	int updateByExampleSelective(@Param("record") TOrderBonus record,
-			@Param("example") TOrderBonusExample example);
-
+	int updateByExampleSelective(@Param("record") TOrderBonus record, @Param("example") TOrderBonusExample example);
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
-	int updateByExample(@Param("record") TOrderBonus record,
-			@Param("example") TOrderBonusExample example);
-
+	int updateByExample(@Param("record") TOrderBonus record, @Param("example") TOrderBonusExample example);
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	int updateByPrimaryKeySelective(TOrderBonus record);
-
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	int updateByPrimaryKey(TOrderBonus record);
-	
 	List<TOrderBonusBo> getDeptBySome(TOrderBonusBo bonusBo);
 	List<TOrderBonusBo> getBonusData(TOrderBonusBo bonusBo);
 }

+ 4 - 0
src/main/java/com/goafanti/common/dao/TOrderNewMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderNewExample;
+import com.goafanti.order.bo.OrderRefundBo;
+import com.goafanti.order.bo.OrderRefundDetailBo;
 import com.goafanti.order.bo.TOrderNewBo;
 
 import java.util.List;
@@ -103,4 +105,6 @@ public interface TOrderNewMapper {
     TOrderNewBo getSaleIdByOno(String ono);
     TOrderNewBo agreeEmailData(Integer fid);
 
+    OrderRefundDetailBo orderRefundDetail(String id);
+
 }

+ 51 - 1
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -728,13 +728,14 @@
    		 a.superior_id as superiorId,
    		 a.department_id as departmentId,
    		 a.last_login_time as lastLoginTime,
+   		 a.contact_mobile as contactMobile,
    		 a.duty,a.status
     from admin a 
     left join admin_location al on a.id = al.admin_id
     left join admin aa on aa.id = a.superior_id
     left join user_role ur on a.id=ur.uid
     where a.id <![CDATA[ <> ]]> '1'
-    and (a.status !='注销' or a.status is null)
+    and a.status ='正常'
     <if test="name != null"> 
     	and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
     </if>
@@ -971,4 +972,53 @@
   		left join department d on a.department_id = d.id
   		where a.id = #{_parameter,jdbcType=VARCHAR}
   </select>
+  
+    <insert id="addAdminContacts" parameterType="com.goafanti.admin.bo.AdminContacts">
+    insert into admin_contacts (id,aid,contacts_id)values
+    (#{id,jdbcType=VARCHAR},#{aid,jdbcType=VARCHAR},#{contactsId,jdbcType=VARCHAR})
+  </insert>
+  
+   <select id="frequentContactsList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
+  	 select a.id,b.id as contactId,b.name,b.position,b.contact_mobile as contactMobile,c.name as departmentName
+    from admin_contacts a left join admin b 
+    on a.contacts_id=b.id left join department c 
+    on c.id=b.department_id
+    where b.status ='正常'
+    <if test="aid != null"> 
+    and a.aid= #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="name != null"> 
+    and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="depId != null"> 
+    and b.department_id= #{depId,jdbcType=VARCHAR}
+    </if>
+    <if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="frequentContactsCount" parameterType="java.lang.String" resultType="java.lang.Integer">
+   select count(*)
+    from admin_contacts a left join admin b 
+    on a.contacts_id=b.id where b.status ='正常'
+    <if test="aid != null"> 
+    and a.aid= #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="name != null"> 
+    and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="depId != null"> 
+    and b.department_id= #{depId,jdbcType=VARCHAR}
+    </if>
+  </select>
+  
+   <delete id="deleteFrequentContacts" parameterType="java.lang.String">
+   delete from admin_contacts
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <select id="getaidFrequentContacts" resultType="java.lang.String">
+  select b.id from admin_contacts a left join admin b on a.contacts_id = b.id 
+     where b.status = '正常' and a.aid= #{id,jdbcType=VARCHAR}
+  </select>
 </mapper>

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

@@ -285,8 +285,8 @@
   </update>
   <select id="selectByDunId" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TDunLogListBo">
    select 
-    id, dun_id as dunId, dum_by as dumBy, dum_time as dumTime, remarks
-    from t_dun_log
+    a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks
+    from t_dun_log a left join admin b on a.dum_by=b.id
     where dun_id = #{dunId,jdbcType=VARCHAR}
   </select>
 </mapper>

+ 96 - 78
src/main/java/com/goafanti/common/mapper/TOrderBonusMapper.xml

@@ -3,9 +3,9 @@
 <mapper namespace="com.goafanti.common.dao.TOrderBonusMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderBonus">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -15,12 +15,13 @@
     <result column="grant_target" jdbcType="VARCHAR" property="grantTarget" />
     <result column="grant_by" jdbcType="VARCHAR" property="grantBy" />
     <result column="grant_time" jdbcType="DATE" property="grantTime" />
+    <result column="grant_type" jdbcType="INTEGER" property="grantType" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -52,9 +53,9 @@
   </sql>
   <sql id="Update_By_Example_Where_Clause">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -86,17 +87,18 @@
   </sql>
   <sql id="Base_Column_List">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
-    id, create_time, order_no, bonus_subject, grant_status, grant_target, grant_by, grant_time
+    id, create_time, order_no, bonus_subject, grant_status, grant_target, grant_by, grant_time, 
+    grant_type
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderBonusExample" resultMap="BaseResultMap">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     select
     <if test="distinct">
@@ -113,9 +115,9 @@
   </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -124,18 +126,18 @@
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     delete from t_order_bonus
     where id = #{id,jdbcType=VARCHAR}
   </delete>
   <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderBonusExample">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     delete from t_order_bonus
     <if test="_parameter != null">
@@ -144,22 +146,24 @@
   </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.TOrderBonus">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     insert into t_order_bonus (id, create_time, order_no, 
       bonus_subject, grant_status, grant_target, 
-      grant_by, grant_time)
+      grant_by, grant_time, grant_type
+      )
     values (#{id,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{orderNo,jdbcType=VARCHAR}, 
       #{bonusSubject,jdbcType=INTEGER}, #{grantStatus,jdbcType=INTEGER}, #{grantTarget,jdbcType=VARCHAR}, 
-      #{grantBy,jdbcType=VARCHAR}, #{grantTime,jdbcType=DATE})
+      #{grantBy,jdbcType=VARCHAR}, #{grantTime,jdbcType=DATE}, #{grantType,jdbcType=INTEGER}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderBonus">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     insert into t_order_bonus
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -187,6 +191,9 @@
       <if test="grantTime != null">
         grant_time,
       </if>
+      <if test="grantType != null">
+        grant_type,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -213,13 +220,16 @@
       <if test="grantTime != null">
         #{grantTime,jdbcType=DATE},
       </if>
+      <if test="grantType != null">
+        #{grantType,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderBonusExample" resultType="java.lang.Integer">
+  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderBonusExample" resultType="java.lang.Long">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     select count(*) from t_order_bonus
     <if test="_parameter != null">
@@ -228,9 +238,9 @@
   </select>
   <update id="updateByExampleSelective" parameterType="map">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     update t_order_bonus
     <set>
@@ -258,6 +268,9 @@
       <if test="record.grantTime != null">
         grant_time = #{record.grantTime,jdbcType=DATE},
       </if>
+      <if test="record.grantType != null">
+        grant_type = #{record.grantType,jdbcType=INTEGER},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -265,9 +278,9 @@
   </update>
   <update id="updateByExample" parameterType="map">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     update t_order_bonus
     set id = #{record.id,jdbcType=VARCHAR},
@@ -277,16 +290,17 @@
       grant_status = #{record.grantStatus,jdbcType=INTEGER},
       grant_target = #{record.grantTarget,jdbcType=VARCHAR},
       grant_by = #{record.grantBy,jdbcType=VARCHAR},
-      grant_time = #{record.grantTime,jdbcType=DATE}
+      grant_time = #{record.grantTime,jdbcType=DATE},
+      grant_type = #{record.grantType,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderBonus">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     update t_order_bonus
     <set>
@@ -311,14 +325,17 @@
       <if test="grantTime != null">
         grant_time = #{grantTime,jdbcType=DATE},
       </if>
+      <if test="grantType != null">
+        grant_type = #{grantType,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderBonus">
     <!--
-      WARNING - @mbggenerated
+      WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 23 16:33:27 CST 2018.
+      This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
     update t_order_bonus
     set create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -327,7 +344,8 @@
       grant_status = #{grantStatus,jdbcType=INTEGER},
       grant_target = #{grantTarget,jdbcType=VARCHAR},
       grant_by = #{grantBy,jdbcType=VARCHAR},
-      grant_time = #{grantTime,jdbcType=DATE}
+      grant_time = #{grantTime,jdbcType=DATE},
+      grant_type = #{grantType,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <!-- 财务专员统计技术员的奖金 -->
@@ -347,20 +365,20 @@
   		<if test="b.grantBy != null">
   		and b.grant_by = #{b.grantBy,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.targetName != null and b.targetName != ""'>
-  		<bind name="tn" value="'%' + b.targetName + '%'"/>
+  		<if test="b.targetName != null and b.targetName != &quot;&quot;">
+  		<bind name="tn" value="'%' + b.targetName + '%'" />
   		and a.name like #{tn,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.salesName != null and b.salesName != ""'>
-  		<bind name="sn" value="'%' + b.salesName + '%'"/>
+  		<if test="b.salesName != null and b.salesName != &quot;&quot;">
+  		<bind name="sn" value="'%' + b.salesName + '%'" />
   		and oa.name like #{sn,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.departmentId != null and b.departmentId !=""'>
+  		<if test="b.departmentId != null and b.departmentId !=&quot;&quot;">
   		and a.department_id = #{b.departmentId,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
-  		<bind name="a" value="b.startTime + ' 00:00:00'"/>
-  		<bind name="e" value="b.endTime + ' 23:59:59'"/>
+  		<if test="b.startTime != null and b.startTime != &quot;&quot; and b.endTime != null and b.endTime != &quot;&quot;">
+  		<bind name="a" value="b.startTime + ' 00:00:00'" />
+  		<bind name="e" value="b.endTime + ' 23:59:59'" />
   		and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
   		</if>
   		order by b.grant_status ,b.create_time 
@@ -379,20 +397,20 @@
   		<if test="b.grantBy != null">
   		and b.grant_by = #{b.grantBy,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.targetName != null and b.targetName != ""'>
-  		<bind name="tn" value="'%' + b.targetName + '%'"/>
+  		<if test="b.targetName != null and b.targetName != &quot;&quot;">
+  		<bind name="tn" value="'%' + b.targetName + '%'" />
   		and a.name like #{tn,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.salesName != null and b.salesName != ""'>
-  		<bind name="sn" value="'%' + b.salesName + '%'"/>
+  		<if test="b.salesName != null and b.salesName != &quot;&quot;">
+  		<bind name="sn" value="'%' + b.salesName + '%'" />
   		and oa.name like #{sn,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.departmentId != null and b.departmentId !=""'>
+  		<if test="b.departmentId != null and b.departmentId !=&quot;&quot;">
   		and a.department_id = #{b.departmentId,jdbcType=VARCHAR}
   		</if>
-  		<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
-  		<bind name="a" value="b.startTime + ' 00:00:00'"/>
-  		<bind name="e" value="b.endTime + ' 23:59:59'"/>
+  		<if test="b.startTime != null and b.startTime != &quot;&quot; and b.endTime != null and b.endTime != &quot;&quot;">
+  		<bind name="a" value="b.startTime + ' 00:00:00'" />
+  		<bind name="e" value="b.endTime + ' 23:59:59'" />
   		and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
   		</if>
   </select>
@@ -413,16 +431,16 @@
 	<if test="b.grantBy != null">
 	and b.grant_by = #{b.grantBy,jdbcType=VARCHAR}
 	</if>
-	<if test='b.salesName != null and b.salesName != ""'>
-	<bind name="sn" value="'%' + b.salesName + '%'"/>
+	<if test="b.salesName != null and b.salesName != &quot;&quot;">
+	<bind name="sn" value="'%' + b.salesName + '%'" />
 	and a.name like #{sn,jdbcType=VARCHAR}
 	</if>
-	<if test='b.departmentId != null and b.departmentId !=""'>
+	<if test="b.departmentId != null and b.departmentId !=&quot;&quot;">
 	and a.department_id = #{b.departmentId,jdbcType=VARCHAR}
 	</if>
-	<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
-	<bind name="a" value="b.startTime + ' 00:00:00'"/>
-	<bind name="e" value="b.endTime + ' 23:59:59'"/>
+	<if test="b.startTime != null and b.startTime != &quot;&quot; and b.endTime != null and b.endTime != &quot;&quot;">
+	<bind name="a" value="b.startTime + ' 00:00:00'" />
+	<bind name="e" value="b.endTime + ' 23:59:59'" />
 	and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
 	</if>
 	order by b.grant_status , b.create_time
@@ -441,16 +459,16 @@
 	<if test="b.grantBy != null">
 	and b.grant_by = #{b.grantBy,jdbcType=VARCHAR}
 	</if>
-	<if test='b.salesName != null and b.salesName != ""'>
-	<bind name="sn" value="'%' + b.salesName + '%'"/>
+	<if test="b.salesName != null and b.salesName != &quot;&quot;">
+	<bind name="sn" value="'%' + b.salesName + '%'" />
 	and a.name like #{sn,jdbcType=VARCHAR}
 	</if>
-	<if test='b.departmentId != null and b.departmentId !=""'>
+	<if test="b.departmentId != null and b.departmentId !=&quot;&quot;">
 	and a.department_id = #{b.departmentId,jdbcType=VARCHAR}
 	</if>
-	<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
-	<bind name="a" value="b.startTime + ' 00:00:00'"/>
-	<bind name="e" value="b.endTime + ' 23:59:59'"/>
+	<if test="b.startTime != null and b.startTime != &quot;&quot; and b.endTime != null and b.endTime != &quot;&quot;">
+	<bind name="a" value="b.startTime + ' 00:00:00'" />
+	<bind name="e" value="b.endTime + ' 23:59:59'" />
 	and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
 	</if>
   </select>
@@ -467,16 +485,16 @@
 	<if test="grantBy != null">
 	and b.grant_by = #{grantBy,jdbcType=VARCHAR}
 	</if>
-	<if test='salesName != null and salesName != ""'>
-	<bind name="sn" value="'%' + salesName + '%'"/>
+	<if test="salesName != null and salesName != &quot;&quot;">
+	<bind name="sn" value="'%' + salesName + '%'" />
 	and a.name like #{sn,jdbcType=VARCHAR}
 	</if>
-	<if test='departmentId != null and departmentId !=""'>
+	<if test="departmentId != null and departmentId !=&quot;&quot;">
 	and a.department_id = #{departmentId,jdbcType=VARCHAR}
 	</if>
-	<if test='startTime != null and startTime != "" and endTime != null and endTime != ""'>
-	<bind name="a" value="startTime + ' 00:00:00'"/>
-	<bind name="e" value="endTime + ' 23:59:59'"/>
+	<if test="startTime != null and startTime != &quot;&quot; and endTime != null and endTime != &quot;&quot;">
+	<bind name="a" value="startTime + ' 00:00:00'" />
+	<bind name="e" value="endTime + ' 23:59:59'" />
 	and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
 	</if>
   </select>
@@ -497,20 +515,20 @@
   		<if test="grantBy != null">
   		and b.grant_by = #{grantBy,jdbcType=VARCHAR}
   		</if>
-  		<if test='targetName != null and targetName != ""'>
-  		<bind name="tn" value="'%' + targetName + '%'"/>
+  		<if test="targetName != null and targetName != &quot;&quot;">
+  		<bind name="tn" value="'%' + targetName + '%'" />
   		and a.name like #{tn,jdbcType=VARCHAR}
   		</if>
-  		<if test='salesName != null and salesName != ""'>
-  		<bind name="sn" value="'%' + salesName + '%'"/>
+  		<if test="salesName != null and salesName != &quot;&quot;">
+  		<bind name="sn" value="'%' + salesName + '%'" />
   		and oa.name like #{sn,jdbcType=VARCHAR}
   		</if>
-  		<if test='departmentId != null and departmentId !=""'>
+  		<if test="departmentId != null and departmentId !=&quot;&quot;">
   		and a.department_id = #{departmentId,jdbcType=VARCHAR}
   		</if>
-  		<if test='startTime != null and startTime != "" and endTime != null and endTime != ""'>
-  		<bind name="a" value="b.startTime + ' 00:00:00'"/>
-  		<bind name="e" value="b.endTime + ' 23:59:59'"/>
+  		<if test="startTime != null and startTime != &quot;&quot; and endTime != null and endTime != &quot;&quot;">
+  		<bind name="a" value="b.startTime + ' 00:00:00'" />
+  		<bind name="e" value="b.endTime + ' 23:59:59'" />
   		and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
   		</if>
   		order by b.grant_status ,b.create_time 

+ 4 - 4
src/main/java/com/goafanti/common/mapper/TOrderDunMapper.xml

@@ -376,15 +376,15 @@
     date_format(a.start_time, '%Y-%m-%d') as startDate
     from t_order_dun 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=c.id
+    left join admin d on b.salesman_id=d.id
     where a.start_time is not null and b.delete_sign = 0
-    <if test="name != null">
+    <if test="name != null and name != ''">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
-  	<if test="orderNo != null">
+  	<if test="orderNo != null and orderNo != ''">
   	and a.order_no = #{orderNo,jdbcType=VARCHAR}
   	</if>
-  	<if test="starTime !=null and endTime !=null">
+  	<if test="starTime !=null and endTime !=null and starTime !='' and endTime != '' ">
   	and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
   	order by b.sign_time desc

+ 9 - 1
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1092,7 +1092,7 @@
   	<if test="starTime !=null and endTime !=null">
   	and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
-  	order by a.sign_time desc
+  	order by a.order_status,a.create_time desc
   	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -1242,4 +1242,12 @@
   		left join `user` u on u.id = o.buyer_id
   		where r.id = #{id,jdbcType=INTEGER}
   </select>
+  <select id="orderRefundDetail" resultType="com.goafanti.order.bo.OrderRefundDetailBo">
+  	select a.id,date_format(a.create_time,'%Y-%m-%d') as createDate ,a.order_no as orderNo,
+     b.order_status as orderStatus,a.refund_status as refundStatus, a.application_url as applicationUrl,
+     a.contract_url as contractUrl,a.reason,b.liquidation_status as liquidationStatus
+     from t_order_refund a 
+     left join t_order_new b  on a.order_no=b.order_no
+     where a.id= #{id,jdbcType=INTEGER}
+  </select>
 </mapper>

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

@@ -330,13 +330,13 @@
     left join user f on e.buyer_id=f.id
     left join (select task_id,sum(hours) as hours from t_task_hours group by task_id) g on a.id=g.task_id
     where e.delete_sign=0 and a.super_id is null
-    <if test="name != null">
+    <if test="name != null and name != ''">
   	and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
-  	<if test="taskId != null">
+  	<if test="taskId != null and taskId != ''">
   	and a.id= #{taskId,jdbcType=VARCHAR}
   	</if>
-  	<if test="starTime !=null and endTime !=null">
+  	<if test="starTime !=null and endTime !=null starTime !='' and endTime !=''">
   	and a.task_start_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
   	order by  a.task_start_time desc

+ 47 - 24
src/main/java/com/goafanti/common/model/TOrderBonus.java

@@ -6,49 +6,54 @@ public class TOrderBonus {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.id
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private String id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.create_time
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private Date createTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.order_no
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private String orderNo;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.bonus_subject
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private Integer bonusSubject;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.grant_status
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private Integer grantStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.grant_target
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private String grantTarget;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.grant_by
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private String grantBy;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.grant_time
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	private Date grantTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bonus.grant_type
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
+	 */
+	private Integer grantType;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.id
 	 * @return  the value of t_order_bonus.id
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public String getId() {
 		return id;
@@ -57,7 +62,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.id
 	 * @param id  the value for t_order_bonus.id
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setId(String id) {
 		this.id = id;
@@ -66,7 +71,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.create_time
 	 * @return  the value of t_order_bonus.create_time
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -75,7 +80,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.create_time
 	 * @param createTime  the value for t_order_bonus.create_time
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
@@ -84,7 +89,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.order_no
 	 * @return  the value of t_order_bonus.order_no
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public String getOrderNo() {
 		return orderNo;
@@ -93,7 +98,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.order_no
 	 * @param orderNo  the value for t_order_bonus.order_no
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setOrderNo(String orderNo) {
 		this.orderNo = orderNo;
@@ -102,7 +107,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.bonus_subject
 	 * @return  the value of t_order_bonus.bonus_subject
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public Integer getBonusSubject() {
 		return bonusSubject;
@@ -111,7 +116,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.bonus_subject
 	 * @param bonusSubject  the value for t_order_bonus.bonus_subject
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setBonusSubject(Integer bonusSubject) {
 		this.bonusSubject = bonusSubject;
@@ -120,7 +125,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.grant_status
 	 * @return  the value of t_order_bonus.grant_status
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public Integer getGrantStatus() {
 		return grantStatus;
@@ -129,7 +134,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.grant_status
 	 * @param grantStatus  the value for t_order_bonus.grant_status
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setGrantStatus(Integer grantStatus) {
 		this.grantStatus = grantStatus;
@@ -138,7 +143,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.grant_target
 	 * @return  the value of t_order_bonus.grant_target
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public String getGrantTarget() {
 		return grantTarget;
@@ -147,7 +152,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.grant_target
 	 * @param grantTarget  the value for t_order_bonus.grant_target
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setGrantTarget(String grantTarget) {
 		this.grantTarget = grantTarget;
@@ -156,7 +161,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.grant_by
 	 * @return  the value of t_order_bonus.grant_by
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public String getGrantBy() {
 		return grantBy;
@@ -165,7 +170,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.grant_by
 	 * @param grantBy  the value for t_order_bonus.grant_by
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setGrantBy(String grantBy) {
 		this.grantBy = grantBy;
@@ -174,7 +179,7 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.grant_time
 	 * @return  the value of t_order_bonus.grant_time
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public Date getGrantTime() {
 		return grantTime;
@@ -183,9 +188,27 @@ public class TOrderBonus {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.grant_time
 	 * @param grantTime  the value for t_order_bonus.grant_time
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setGrantTime(Date grantTime) {
 		this.grantTime = grantTime;
 	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_bonus.grant_type
+	 * @return  the value of t_order_bonus.grant_type
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
+	 */
+	public Integer getGrantType() {
+		return grantType;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_bonus.grant_type
+	 * @param grantType  the value for t_order_bonus.grant_type
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
+	 */
+	public void setGrantType(Integer grantType) {
+		this.grantType = grantType;
+	}
 }

+ 96 - 56
src/main/java/com/goafanti/common/model/TOrderBonusExample.java

@@ -8,23 +8,23 @@ import java.util.Iterator;
 public class TOrderBonusExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public TOrderBonusExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -32,7 +32,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -40,7 +40,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -48,7 +48,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -56,7 +56,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -64,7 +64,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -72,7 +72,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -80,7 +80,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -90,7 +90,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -102,7 +102,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -111,7 +111,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -121,7 +121,7 @@ public class TOrderBonusExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -150,39 +150,30 @@ public class TOrderBonusExample {
 			criteria.add(new Criterion(condition));
 		}
 
-		protected void addCriterion(String condition, Object value,
-				String property) {
+		protected void addCriterion(String condition, Object value, String property) {
 			if (value == null) {
-				throw new RuntimeException("Value for " + property
-						+ " cannot be null");
+				throw new RuntimeException("Value for " + property + " cannot be null");
 			}
 			criteria.add(new Criterion(condition, value));
 		}
 
-		protected void addCriterion(String condition, Object value1,
-				Object value2, String property) {
+		protected void addCriterion(String condition, Object value1, Object value2, String property) {
 			if (value1 == null || value2 == null) {
-				throw new RuntimeException("Between values for " + property
-						+ " cannot be null");
+				throw new RuntimeException("Between values for " + property + " cannot be null");
 			}
 			criteria.add(new Criterion(condition, value1, value2));
 		}
 
-		protected void addCriterionForJDBCDate(String condition, Date value,
-				String property) {
+		protected void addCriterionForJDBCDate(String condition, Date value, String property) {
 			if (value == null) {
-				throw new RuntimeException("Value for " + property
-						+ " cannot be null");
+				throw new RuntimeException("Value for " + property + " cannot be null");
 			}
-			addCriterion(condition, new java.sql.Date(value.getTime()),
-					property);
+			addCriterion(condition, new java.sql.Date(value.getTime()), property);
 		}
 
-		protected void addCriterionForJDBCDate(String condition,
-				List<Date> values, String property) {
+		protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
 			if (values == null || values.size() == 0) {
-				throw new RuntimeException("Value list for " + property
-						+ " cannot be null or empty");
+				throw new RuntimeException("Value list for " + property + " cannot be null or empty");
 			}
 			List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
 			Iterator<Date> iter = values.iterator();
@@ -192,14 +183,11 @@ public class TOrderBonusExample {
 			addCriterion(condition, dateList, property);
 		}
 
-		protected void addCriterionForJDBCDate(String condition, Date value1,
-				Date value2, String property) {
+		protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
 			if (value1 == null || value2 == null) {
-				throw new RuntimeException("Between values for " + property
-						+ " cannot be null");
+				throw new RuntimeException("Between values for " + property + " cannot be null");
 			}
-			addCriterion(condition, new java.sql.Date(value1.getTime()),
-					new java.sql.Date(value2.getTime()), property);
+			addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
 		}
 
 		public Criteria andIdIsNull() {
@@ -328,8 +316,7 @@ public class TOrderBonusExample {
 		}
 
 		public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
-			addCriterion("create_time not between", value1, value2,
-					"createTime");
+			addCriterion("create_time not between", value1, value2, "createTime");
 			return (Criteria) this;
 		}
 
@@ -454,14 +441,12 @@ public class TOrderBonusExample {
 		}
 
 		public Criteria andBonusSubjectBetween(Integer value1, Integer value2) {
-			addCriterion("bonus_subject between", value1, value2,
-					"bonusSubject");
+			addCriterion("bonus_subject between", value1, value2, "bonusSubject");
 			return (Criteria) this;
 		}
 
 		public Criteria andBonusSubjectNotBetween(Integer value1, Integer value2) {
-			addCriterion("bonus_subject not between", value1, value2,
-					"bonusSubject");
+			addCriterion("bonus_subject not between", value1, value2, "bonusSubject");
 			return (Criteria) this;
 		}
 
@@ -521,8 +506,7 @@ public class TOrderBonusExample {
 		}
 
 		public Criteria andGrantStatusNotBetween(Integer value1, Integer value2) {
-			addCriterion("grant_status not between", value1, value2,
-					"grantStatus");
+			addCriterion("grant_status not between", value1, value2, "grantStatus");
 			return (Criteria) this;
 		}
 
@@ -592,8 +576,7 @@ public class TOrderBonusExample {
 		}
 
 		public Criteria andGrantTargetNotBetween(String value1, String value2) {
-			addCriterion("grant_target not between", value1, value2,
-					"grantTarget");
+			addCriterion("grant_target not between", value1, value2, "grantTarget");
 			return (Criteria) this;
 		}
 
@@ -718,21 +701,79 @@ public class TOrderBonusExample {
 		}
 
 		public Criteria andGrantTimeBetween(Date value1, Date value2) {
-			addCriterionForJDBCDate("grant_time between", value1, value2,
-					"grantTime");
+			addCriterionForJDBCDate("grant_time between", value1, value2, "grantTime");
 			return (Criteria) this;
 		}
 
 		public Criteria andGrantTimeNotBetween(Date value1, Date value2) {
-			addCriterionForJDBCDate("grant_time not between", value1, value2,
-					"grantTime");
+			addCriterionForJDBCDate("grant_time not between", value1, value2, "grantTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeIsNull() {
+			addCriterion("grant_type is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeIsNotNull() {
+			addCriterion("grant_type is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeEqualTo(Integer value) {
+			addCriterion("grant_type =", value, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeNotEqualTo(Integer value) {
+			addCriterion("grant_type <>", value, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeGreaterThan(Integer value) {
+			addCriterion("grant_type >", value, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeGreaterThanOrEqualTo(Integer value) {
+			addCriterion("grant_type >=", value, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeLessThan(Integer value) {
+			addCriterion("grant_type <", value, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeLessThanOrEqualTo(Integer value) {
+			addCriterion("grant_type <=", value, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeIn(List<Integer> values) {
+			addCriterion("grant_type in", values, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeNotIn(List<Integer> values) {
+			addCriterion("grant_type not in", values, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeBetween(Integer value1, Integer value2) {
+			addCriterion("grant_type between", value1, value2, "grantType");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantTypeNotBetween(Integer value1, Integer value2) {
+			addCriterion("grant_type not between", value1, value2, "grantType");
 			return (Criteria) this;
 		}
 	}
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table t_order_bonus
-	 * @mbggenerated  Fri Nov 23 16:33:27 CST 2018
+	 * @mbg.generated  Tue Nov 27 11:15:28 CST 2018
 	 */
 	public static class Criterion {
 		private String condition;
@@ -799,8 +840,7 @@ public class TOrderBonusExample {
 			this(condition, value, null);
 		}
 
-		protected Criterion(String condition, Object value, Object secondValue,
-				String typeHandler) {
+		protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
 			super();
 			this.condition = condition;
 			this.value = value;

+ 71 - 0
src/main/java/com/goafanti/order/bo/OrderRefundDetailBo.java

@@ -0,0 +1,71 @@
+package com.goafanti.order.bo;
+
+
+public class OrderRefundDetailBo  {
+	private String id;
+	private String createDate;
+	private String orderNo;
+	private Integer orderStatus;
+	private Integer refundStatus;
+	private String applicationUrl;
+	private String contractUrl;
+	private String reason;
+	private Integer liquidationStatus;
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getCreateDate() {
+		return createDate;
+	}
+	public void setCreateDate(String createDate) {
+		this.createDate = createDate;
+	}
+	public String getOrderNo() {
+		return orderNo;
+	}
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+	public Integer getOrderStatus() {
+		return orderStatus;
+	}
+	public void setOrderStatus(Integer orderStatus) {
+		this.orderStatus = orderStatus;
+	}
+	public Integer getRefundStatus() {
+		return refundStatus;
+	}
+	public void setRefundStatus(Integer refundStatus) {
+		this.refundStatus = refundStatus;
+	}
+	public String getApplicationUrl() {
+		return applicationUrl;
+	}
+	public void setApplicationUrl(String applicationUrl) {
+		this.applicationUrl = applicationUrl;
+	}
+	public String getContractUrl() {
+		return contractUrl;
+	}
+	public void setContractUrl(String contractUrl) {
+		this.contractUrl = contractUrl;
+	}
+	public String getReason() {
+		return reason;
+	}
+	public void setReason(String reason) {
+		this.reason = reason;
+	}
+	public Integer getLiquidationStatus() {
+		return liquidationStatus;
+	}
+	public void setLiquidationStatus(Integer liquidationStatus) {
+		this.liquidationStatus = liquidationStatus;
+	}
+	
+	
+	
+	}

+ 55 - 6
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -316,6 +316,40 @@ public class AdminNewOrderApiController extends CertifyApiController {
 			return res;
 	}
 	/**
+	 * 退单详情
+	 */
+	@RequestMapping(value="/orderRefundDetail", method = RequestMethod.GET)
+	public Result OrderRefund(String id){
+			Result res=new Result();
+			if (StringUtils.isBlank(id)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "退单编号","退单编号"));
+				return res;
+			}
+			res.data(orderNewService.orderRefundDetail(id));
+			return res;
+	}
+	/**
+	 * 订单退单
+	 */
+	@RequestMapping(value="/updateOrderRefund", method = RequestMethod.POST)
+	public Result updateOrderRefund(TOrderRefundWithBLOBs t){
+			Result res=new Result();
+			if (null==t.getId()) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "退单编号","退单编号"));
+				return res;
+			}
+			if(StringUtils.isBlank(t.getContractUrl())||StringUtils.isBlank(t.getApplicationUrl())){
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "合同与申请表","合同与申请表"));
+				return res;
+			}
+			if (StringUtils.isBlank(t.getReason())) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "退单原因","退单原因"));
+				return res;
+			}
+			res.data(orderNewService.updateOrderRefund(t));
+			return res;
+	}
+	/**
 	 * 审批特批订单
 	 * @param orderNo
 	 * @return
@@ -350,16 +384,31 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	/**
 	 * 订单结单
 	 */
-	@RequestMapping(value="/asdas", method = RequestMethod.GET)
-	public Result asdas(String orderNo){
+	@RequestMapping(value="/OrderOver", method = RequestMethod.GET)
+	public Result updateOrderOver(String orderNo){
 		Result res=new Result();
 		if (StringUtils.isBlank(orderNo)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "订单编号","订单编号"));
 			return res;
 		}
-		res.data(orderNewService.checkOrderOver(orderNo));
-		if ((int)res.getData()==-1) {
-			
+		int i=orderNewService.updateOrderOver(orderNo);
+		if (i==-1) {
+			res.getError().add(buildError("不符合结单条件","不符合结单条件"));
+			return res;
+		}
+		res.setData(i);
+		return res;
+	}
+	/**
+	 * 咨询师驳回
+	 */
+	@RequestMapping(value = "/technicianBackOrder", method = RequestMethod.POST)
+	public Result technicianBackOrder(String orderNo){
+		Result res = new Result();
+		int i=orderNewService.technicianBackOrder(orderNo);
+		if (i==-1) {
+			res.getError().add(buildError("不符合驳回条件","不符合驳回条件"));
+			return res;
 		}
 		return res;
 	}
@@ -376,7 +425,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 * 催款列表下载
 	 * @throws IOException 
 	 */
-	@RequestMapping(value = "/exportOrderDunData", method = RequestMethod.POST)
+	@RequestMapping(value = "/exportOrderDunData", method = RequestMethod.GET)
 	public Result exportOrderDunData(String name,String orderNo,String starTime,String endTime,HttpServletResponse response) throws IOException{
 		 Result res = new Result();
 		 HSSFWorkbook wb = orderNewService.exportOrderDunData( name, orderNo, starTime, endTime);

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

@@ -124,7 +124,7 @@ public class OrderProjectApiController extends CertifyApiController {
 	 * 任务工时表
 	 * @throws IOException 
 	 */
-	@RequestMapping(value = "/exportTaskHoursListData", method = RequestMethod.POST)
+	@RequestMapping(value = "/exportTaskHoursListData", method = RequestMethod.GET)
 	public Result exportTaskHoursListData(String name, String taskId ,String starTime,String endTime ,HttpServletResponse response) throws IOException{
 		 Result res = new Result();
 		 HSSFWorkbook wb = orderProjectService.exportTaskHoursListData( name, taskId, starTime, endTime);

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

@@ -15,8 +15,8 @@ public enum ProjectNewStage {
 	YTJ(1,"项目已提交"),
 	/** 项目评审 **/
 	PS(2,"项目评审"),
-	/** 项目待公示 **/
-	DGS(3,"项目待公示"),
+	/** 项目立项 **/
+	LS(3,"项目立项"),
 	/** 项目公示 **/
 	GS(4,"项目公示"),
 	/** 项目抽查 **/

+ 1 - 1
src/main/java/com/goafanti/order/enums/TaskState.java

@@ -10,7 +10,7 @@ public enum TaskState {
 	 YFP(1,"已分派"),
 	 /** 材料已启动 **/
 	 CLYQD(2,"材料已启动"),
-	 /** 无效 **/
+	 /** 材料已完成 **/
 	 CLYWC(2,"材料已完成"),
 	/** 无效 **/
 	INVALID(10, "无效");

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

@@ -13,6 +13,8 @@ import com.goafanti.common.model.TOrderTask;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.order.bo.BackOrderListBo;
 import com.goafanti.order.bo.BillListBo;
+import com.goafanti.order.bo.OrderRefundBo;
+import com.goafanti.order.bo.OrderRefundDetailBo;
 import com.goafanti.order.bo.TDunLogListBo;
 import com.goafanti.order.bo.TOrderNewBo;
 import com.goafanti.order.bo.TOrderRefundBo;
@@ -152,7 +154,10 @@ public interface OrderNewService {
 	boolean checkOderSettlementAmount(String orderNo);
 	boolean checkORderTask(String orderNo);
 	HSSFWorkbook exportOrderDunData(String name, String orderNo, String starTime, String endTime);
-	int checkOrderOver(String orderNo);
+	int updateOrderOver(String orderNo);
+	OrderRefundDetailBo orderRefundDetail(String id);
+	int updateOrderRefund(TOrderRefundWithBLOBs t);
+	int technicianBackOrder(String orderNo);
 	
 
 	

+ 31 - 2
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -41,6 +41,8 @@ import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.LockingReleaseBo;
+import com.goafanti.order.bo.OrderRefundBo;
+import com.goafanti.order.bo.OrderRefundDetailBo;
 import com.goafanti.order.bo.TDunLogListBo;
 import com.goafanti.order.bo.TOrderNewBo;
 import com.goafanti.order.bo.TOrderRefundBo;
@@ -469,6 +471,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	/**
 	 * 获取催款数据
 	 */
+	@SuppressWarnings("null")
 	@Override
 	public HSSFWorkbook exportOrderDunData(String name, String orderNo, String starTime, String endTime) {
 		if(endTime!=null) endTime=endTime+" 23:59:59";
@@ -485,7 +488,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 	@Override
-	public int checkOrderOver(String orderNo) {
+	public int updateOrderOver(String orderNo) {
 		TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
 		if (t.getLiquidationStatus()!=LiquidationNewState.ALREADY_PAY.getCode()||
 				t.getProcessStatus()!=ProcessStatus.YQBFPZXSGLY.getCode()) {
@@ -497,7 +500,33 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				return -1;
 			}
 		}
-		return 1;
+		t.setOrderStatus(OrderNewState.YJX.getCode());
+		t.setSettlementTime(new Date());
+		return tOrderNewMapper.updateByPrimaryKeySelective(t);
+	}
+	
+	@Override
+	public OrderRefundDetailBo orderRefundDetail(String id) {
+		return tOrderNewMapper.orderRefundDetail(id);
+	}
+
+
+
+	@Override
+	public int updateOrderRefund(TOrderRefundWithBLOBs t) {
+		return tOrderRefundMapper.updateByPrimaryKeySelective(t);
+	}
+
+
+
+	@Override
+	public int technicianBackOrder(String orderNo) {
+		TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
+		if (t.getSettlementAmount().compareTo(new BigDecimal(0))==0) {
+			return -1;
+		}
+		t.setOrderStatus(OrderNewState.YBH.getCode());
+		return tOrderNewMapper.updateByPrimaryKey(t);
 	}
 	
 	

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

@@ -19,9 +19,11 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.goafanti.common.dao.TOrderBonusMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.TTaskHoursMapper;
+import com.goafanti.common.model.TOrderBonus;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.TTaskHours;
@@ -34,6 +36,8 @@ import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;
 import com.goafanti.order.enums.ProcessStatus;
+import com.goafanti.order.enums.ProjectNewStage;
+import com.goafanti.order.service.OrderBillService;
 import com.goafanti.order.service.OrderProjectService;
 import com.goafanti.techproject.enums.TaskState;
 @Service
@@ -44,6 +48,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	private TOrderNewMapper	tOrderNewMapper;
 	@Autowired
 	private TTaskHoursMapper	tTaskHoursMapper;
+	@Autowired
+	private TOrderBonusMapper 	tOrderBonusMapper;
 	@Value(value = "${upload.path}")
 	private String 					uploadPath 			= null;
 	
@@ -152,10 +158,21 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 
 	private void meanwhileUpdateOrder(TOrderTask task) {
 		if (task.getMain()==1) {//是否是主要项目
+			//更改订单项目状态
 			TOrderNew tNew=new TOrderNew();
 			tNew.setProjectStatus(task.getProjectStatus());
 			tNew.setOrderNo(task.getOrderNo());
 			tOrderNewMapper.updateByPrimaryKeySelective(tNew);
+			//新增奖金信息
+			TOrderBonus tb=new TOrderBonus();
+			tb.setId(UUID.randomUUID().toString());
+			tb.setOrderNo(task.getOrderNo());
+			if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode())tb.setBonusSubject(21);//项目已提交
+			if (task.getProjectStatus()==ProjectNewStage.LS.getCode())tb.setBonusSubject(23);//项目立项
+			if (task.getProjectStatus()==ProjectNewStage.GS.getCode())tb.setBonusSubject(24);//项目公示
+			tb.setGrantTarget(task.getTaskReceiver());
+			tb.setGrantType(1);//技术员
+			tOrderBonusMapper.insertSelective(tb);
 		}
 	}