Browse Source

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

anderx 2 years ago
parent
commit
88e215df95
43 changed files with 682 additions and 282 deletions
  1. 38 55
      src/main/java/com/goafanti/common/controller/PublicController.java
  2. 5 0
      src/main/java/com/goafanti/common/dao/ExpenseAccountMapper.java
  3. 13 1
      src/main/java/com/goafanti/common/dao/PublicExamineMapper.java
  4. 3 1
      src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java
  5. 9 13
      src/main/java/com/goafanti/common/dao/UserMapper.java
  6. 53 7
      src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml
  7. 39 1
      src/main/java/com/goafanti/common/mapper/PublicExamineMapper.xml
  8. 30 3
      src/main/java/com/goafanti/common/mapper/TOrderInvoiceMapper.xml
  9. 5 1
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  10. 4 0
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  11. 15 2
      src/main/java/com/goafanti/common/model/ExpenseAccount.java
  12. 40 0
      src/main/java/com/goafanti/common/utils/AsyncUtils.java
  13. 1 1
      src/main/java/com/goafanti/common/utils/excel/Excel.java
  14. 0 8
      src/main/java/com/goafanti/common/utils/excel/ExcelConstant.java
  15. 10 0
      src/main/java/com/goafanti/core/mybatis/BaseMybatisDao.java
  16. 10 5
      src/main/java/com/goafanti/core/mybatis/JDBCIdGenerator.java
  17. 41 0
      src/main/java/com/goafanti/customer/bo/PublicReleaseTransferUserBo.java
  18. 7 2
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  19. 3 0
      src/main/java/com/goafanti/customer/service/CustomerService.java
  20. 66 0
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  21. 3 0
      src/main/java/com/goafanti/expenseAccount/bo/InputPageListBo.java
  22. 9 0
      src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountBo.java
  23. 12 0
      src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java
  24. 4 0
      src/main/java/com/goafanti/expenseAccount/service/ExpenseAccountService.java
  25. 29 1
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java
  26. 50 2
      src/main/java/com/goafanti/order/bo/InputOrderInvoiceBo.java
  27. 38 16
      src/main/java/com/goafanti/order/bo/TOrderInvoiceBo.java
  28. 5 9
      src/main/java/com/goafanti/order/bo/TOrderTaskListBo.java
  29. 26 11
      src/main/java/com/goafanti/order/controller/OrderInvoiceApiController.java
  30. 7 9
      src/main/java/com/goafanti/order/controller/StatisticsApiController.java
  31. 2 1
      src/main/java/com/goafanti/order/enums/NewProjectStatus.java
  32. 1 0
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  33. 6 0
      src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java
  34. 4 3
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  35. 15 40
      src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java
  36. 6 2
      src/main/java/com/goafanti/order/service/impl/PushOrderService.java
  37. 10 10
      src/main/java/com/goafanti/organization/bo/outPaymentList.java
  38. 9 11
      src/main/java/com/goafanti/permission/controller/NewRoleApiController.java
  39. 20 30
      src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java
  40. 12 14
      src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java
  41. 19 20
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  42. 2 2
      src/main/resources/props/config_local.properties
  43. 1 1
      src/main/resources/props/config_test.properties

+ 38 - 55
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -1,36 +1,31 @@
 package com.goafanti.common.controller;
 
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import com.goafanti.admin.service.AdminService;
+import com.goafanti.admin.service.AttachmentService;
+import com.goafanti.common.bo.Error;
+import com.goafanti.common.bo.OutUser;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.dao.TOrderMidMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
-import com.goafanti.common.model.TOrderMid;
-import com.goafanti.common.model.TOrderTask;
-import com.goafanti.common.utils.excel.Excel;
-import com.goafanti.common.utils.pdf.PDFUtils;
-import com.goafanti.common.utils.word.WordUtils;
-import com.goafanti.order.bo.TOrderTaskBo;
-import com.goafanti.order.enums.NewProjectStatus;
+import com.goafanti.common.enums.UserType;
+import com.goafanti.common.model.User;
+import com.goafanti.common.service.DistrictGlossoryService;
+import com.goafanti.common.service.IndustryCategoryService;
+import com.goafanti.common.utils.*;
+import com.goafanti.common.utils.excel.FileUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.core.websocket.SystemWebSocketHandler;
+import com.goafanti.expenseAccount.service.ExpenseAccountService;
 import com.goafanti.order.enums.OrderImgEnums;
-import com.goafanti.order.enums.ProjectStage;
-import com.goafanti.order.enums.ProjectType;
-import com.goafanti.order.service.OrderProjectService;
+import com.goafanti.user.service.UserService;
 import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -44,31 +39,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.socket.TextMessage;
 
-import com.goafanti.admin.service.AdminService;
-import com.goafanti.admin.service.AttachmentService;
-import com.goafanti.common.bo.Error;
-import com.goafanti.common.bo.OutUser;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.enums.UserType;
-import com.goafanti.common.model.User;
-import com.goafanti.common.service.DistrictGlossoryService;
-import com.goafanti.common.service.FieldGlossoryService;
-import com.goafanti.common.service.IndustryCategoryService;
-import com.goafanti.common.utils.DateUtils;
-import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.common.utils.MobileMessageUtils;
-import com.goafanti.common.utils.PasswordUtil;
-import com.goafanti.common.utils.PictureUtils;
-import com.goafanti.common.utils.TimeUtils;
-import com.goafanti.common.utils.VerifyCodeUtils;
-import com.goafanti.common.utils.excel.FileUtils;
-import com.goafanti.common.utils.excel.NewExcelUtil;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.core.websocket.SystemWebSocketHandler;
-import com.goafanti.patent.bo.PatentNewBo;
-import com.goafanti.user.service.UserService;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.util.*;
 
 @Controller
 @Scope(value = "prototype")
@@ -115,7 +90,7 @@ public class PublicController extends CertifyApiController {
 	private DistrictGlossoryService	districtGlossoryService;
 
 	@Autowired
-	private OrderProjectService	orderProjectService;
+	private ExpenseAccountService	expenseAccountService;
 
 	@Value(value = "${patentTemplate}")
 	private String					patentTemplate		= null;
@@ -780,10 +755,18 @@ public class PublicController extends CertifyApiController {
 			return res;
           }
 
-          @RequestMapping("/getUser")
-          public Result getUser() {
-        	  List<OutUser> list=userService.getuser();
-        	  NewExcelUtil<OutUser> excel=new NewExcelUtil<OutUser>(OutUser.class);
-      		return excel.exportExcel(list, "客户列表",uploadPath);
-          }
+	@RequestMapping("/getUser")
+	public Result getUser() {
+		List<OutUser> list=userService.getuser();
+		NewExcelUtil<OutUser> excel=new NewExcelUtil<OutUser>(OutUser.class);
+		return excel.exportExcel(list, "客户列表",uploadPath);
+	}
+
+
+	@RequestMapping("/supplementCheckNo")
+	public Result supplementCheckNo() {
+		Result res=new Result();
+		res.data(expenseAccountService.pushSupplementCheckNo());
+		return res;
+	}
 }

+ 5 - 0
src/main/java/com/goafanti/common/dao/ExpenseAccountMapper.java

@@ -25,6 +25,8 @@ public interface ExpenseAccountMapper {
 
     OutExpenseAccount selectByaidAndPrid(InputExpenseAccount in);
 
+    OutExpenseAccount selectByCheckNo(String checkNo);
+
     List<OutExpenseAccount> selectByaidAndType(@Param("aid") String aid,@Param("depId")String depId, @Param("type")Integer type,
                                                @Param("id")Integer id);
 
@@ -34,4 +36,7 @@ public interface ExpenseAccountMapper {
     List<ExpenseAccount> selectByDebitId(Integer debitId);
 
 
+    List<ExpenseAccount> selectByCheckNoNot();
+
+
 }

+ 13 - 1
src/main/java/com/goafanti/common/dao/PublicExamineMapper.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PublicExamine;
+import com.goafanti.customer.bo.PublicReleaseTransferUserBo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -20,10 +21,21 @@ public interface PublicExamineMapper {
 
     List<PublicExamine> selectByPrid(Integer id);
 
-    void updatePrid(PublicExamine pe);
+    void updateStatusByPrid(PublicExamine pe);
 
 
     List<PublicExamine> selectByIds(@Param("ids") List<Integer> ids);
 
     void deletePrid(Integer id);
+
+    /**
+     *
+     * @param oldAid 原aid
+     * @param aid
+     */
+    void updateAidByAid(@Param("oldAid")String oldAid, @Param("aid")String aid);
+
+    List<PublicReleaseTransferUserBo> selectByuList(@Param("list") List<String> list);
+
+    void updateByPridSelective(PublicExamine pe);
 }

+ 3 - 1
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -6,10 +6,10 @@ import com.goafanti.common.model.TChangeTask;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.order.bo.*;
 import com.goafanti.organization.bo.ProjectTypePuls;
+import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
 import java.util.List;
-import org.apache.ibatis.annotations.Param;
 
 public interface TOrderTaskMapper {
     int deleteByPrimaryKey(Integer id);
@@ -87,4 +87,6 @@ public interface TOrderTaskMapper {
     void deleteBySplitId(Integer id);
 
     void updateDimissionTransferManager(@Param("aid")String aid, @Param("transferId")String transferId);
+
+    List<String> selectOrderNoAllByaid(String aid);
 }

+ 9 - 13
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -1,28 +1,22 @@
 package com.goafanti.common.dao;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
 import com.goafanti.admin.bo.AdminCustomerBo;
-import com.goafanti.customer.bo.*;
-import org.apache.ibatis.annotations.Param;
-
 import com.goafanti.app.bo.UserBasicInfo;
 import com.goafanti.common.bo.OutUser;
 import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
-import com.goafanti.user.bo.InputUserChannel;
-import com.goafanti.user.bo.OrgPartnerDetailBo;
-import com.goafanti.user.bo.UserDownLoadBo;
-import com.goafanti.user.bo.UserInterestBo;
-import com.goafanti.user.bo.UserPageHomeBo;
-import com.goafanti.user.bo.UserPartnerDetailBo;
+import com.goafanti.customer.bo.*;
 import com.goafanti.report.bo.CountMarketingStatisticsBo;
 import com.goafanti.report.bo.marketingESBo;
 import com.goafanti.report.bo.userDataListBo;
+import com.goafanti.user.bo.*;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 public interface UserMapper {
     int deleteByPrimaryKey(String id);
@@ -241,4 +235,6 @@ public interface UserMapper {
 
     List<AdminCustomerBo> selectNoChannelByaids(@Param("admins")List<AdminCustomerBo> admins,@Param("startTime") String startTime,@Param("endTime") String endTime);
     List<AdminCustomerBo> selectChannelByaids(@Param("admins")List<AdminCustomerBo> admins,@Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    List<String> selectBelongByaid(String aid);
 }

+ 53 - 7
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -28,12 +28,13 @@
     <result column="target_type" jdbcType="INTEGER" property="targetType" />
     <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="check_no" jdbcType="VARCHAR" property="checkNo" />
   </resultMap>
   <sql id="Base_Column_List">
     id, prid, order_no, aid, aname, `type`, type_other, `status`, process_status, total_amount,
     attachment_url, apply_dep, pay_dep, eaaid, create_time, district_name, user_names,
     release_start, release_end, duration, examine_name, settlement_amount, debit_id,
-    target_type, liquidation_status, remarks
+    target_type, liquidation_status, remarks, check_no
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -54,7 +55,7 @@
       user_names, release_start, release_end,
       duration, examine_name, settlement_amount,
       debit_id, target_type, liquidation_status,
-      remarks)
+      remarks, check_no)
     values (#{prid,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
       #{aname,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{typeOther,jdbcType=VARCHAR},
       #{status,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL},
@@ -63,7 +64,7 @@
       #{userNames,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP},
       #{duration,jdbcType=DOUBLE}, #{examineName,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
       #{debitId,jdbcType=INTEGER}, #{targetType,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER},
-      #{remarks,jdbcType=VARCHAR})
+      #{remarks,jdbcType=VARCHAR}, #{checkNo,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccount" useGeneratedKeys="true">
     insert into expense_account
@@ -143,6 +144,9 @@
       <if test="remarks != null">
         remarks,
       </if>
+      <if test="checkNo != null">
+        check_no,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="prid != null">
@@ -220,6 +224,9 @@
       <if test="remarks != null">
         #{remarks,jdbcType=VARCHAR},
       </if>
+      <if test="checkNo != null">
+        #{checkNo,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ExpenseAccount">
@@ -300,6 +307,9 @@
       <if test="remarks != null">
         remarks = #{remarks,jdbcType=VARCHAR},
       </if>
+      <if test="checkNo != null">
+        check_no = #{checkNo,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -329,7 +339,8 @@
       debit_id = #{debitId,jdbcType=INTEGER},
       target_type = #{targetType,jdbcType=INTEGER},
       liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
-      remarks = #{remarks,jdbcType=VARCHAR}
+      remarks = #{remarks,jdbcType=VARCHAR},
+      check_no = #{checkNo,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -339,7 +350,7 @@
         a.attachment_url attachmentUrl,a.apply_dep applyDep, a.pay_dep payDep, a.eaaid,a.district_name districtName,
         a.user_names userNames,a.create_time, a.release_start,a.release_end, a.duration,b.name appDepName,
         c.name payDepName,d.name ,d.bank ,d.accounts ,a.settlement_amount settlementAmount,
-        a.liquidation_status liquidationStatus, a.remarks,
+        a.liquidation_status liquidationStatus, a.remarks,a.check_no checkNo,
            date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,
             date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStartStr,
             date_format(a.release_end,'%Y-%m-%d %H:%i:%S')releaseEndStr
@@ -353,10 +364,19 @@
     WHERE a.id= #{id}
   </select>
 
+  <select id="selectByCheckNo" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccount">
+    SELECT
+    <include refid="selectDtailsSql"/>
+    FROM expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
+    left join expense_account_private d on a.eaaid=d.id left join t_order_new o on a.order_no =o.order_no
+    left join t_order_mid tm on a.order_no =tm.order_no
+    WHERE a.check_no= #{checkNo}
+  </select>
+
 
   <select id="selectExpenseAccountList" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountBo">
     select a.id,a.total_amount totalAmount,a.`type`,a.process_status processStatus,a.status,a.examine_name examineName,a.type_other typeOther,
-    a.attachment_url attachmentUrl,a.target_type targetType , e.contract_no contractNo,tm.buyer_name buyerName ,
+    a.attachment_url attachmentUrl,a.target_type targetType , e.contract_no contractNo,tm.buyer_name buyerName ,a.check_no checkNo,
     <if test="processStatus ==1">
       eae.type eaeType,
     </if>
@@ -373,6 +393,12 @@
     where 1=1
       <if test="processStatus ==2">
         and a.process_status>0
+        <if test="examineStatus ==0">
+          and a.status=1
+        </if>
+        <if test="examineStatus ==1">
+          and a.status=2
+        </if>
       </if>
     <if test=" aid !=null">
     and a.aid= #{aid}
@@ -428,6 +454,12 @@
     where 1=1
     <if test="processStatus ==2">
       and a.process_status>0
+      <if test="examineStatus ==0">
+        and a.status=1
+      </if>
+      <if test="examineStatus ==1">
+        and a.status=2
+      </if>
     </if>
     <if test=" aid !=null">
       and a.aid= #{aid}
@@ -479,6 +511,12 @@
     where 1=1
     <if test="processStatus ==2">
       and a.process_status>0
+      <if test="examineStatus ==0">
+        and a.status=1
+      </if>
+      <if test="examineStatus ==1">
+        and a.status=2
+      </if>
     </if>
     <if test=" aid !=null">
       and a.aid= #{aid}
@@ -528,13 +566,15 @@
     WHERE a.status= #{status}
     and a.prid= #{prid} and a.aid = #{aid}
   </select>
+
+
     <select id="selectByaidAndType" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccount">
       SELECT
         a.id, a.prid, a.order_no orderNo, o.contract_no contractNo ,tm.buyer_name buyerName, a.aid, a.aname, a.`type`,
         a.type_other typeOther , a.status,a.process_status processStatus,a.total_amount totalAmount,a.debit_id debitId,
         a.attachment_url attachmentUrl,a.apply_dep applyDep, a.pay_dep payDep, a.eaaid,a.district_name districtName,
         a.user_names userNames,a.create_time, a.release_start,a.release_end, a.duration,b.name appDepName,
-        c.name payDepName,d.name ,d.bank ,d.accounts ,t0.amount settlementAmount,
+        c.name payDepName,d.name ,d.bank ,d.accounts ,t0.amount settlementAmount,a.check_no checkNo,
         a.liquidation_status liquidationStatus, a.remarks,
         date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,
         date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStartStr,
@@ -570,5 +610,11 @@
     from expense_account
     where debit_id = #{debitId}
   </select>
+  <select id="selectByCheckNoNot" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+  select
+  <include refid="Base_Column_List" />
+  from expense_account
+    where check_no =''
+  </select>
 
 </mapper>

+ 39 - 1
src/main/java/com/goafanti/common/mapper/PublicExamineMapper.xml

@@ -96,6 +96,9 @@
       aname = #{aname,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
+
+
   <update id="updatePrid">
     update public_examine
     set  `status` = #{status,jdbcType=INTEGER}
@@ -104,6 +107,29 @@
       and aid = #{aid,jdbcType=VARCHAR}
       </if>
   </update>
+  <update id="updateAidByAid">
+    update public_examine a ,(select id,name from admin where id=#{aid})b
+    set a.aid=b.id ,a.aname =b.name
+    where a.aid = #{oldAid} and a.status=0
+  </update>
+  <update id="updateByPridSelective">
+    update public_examine
+    <set>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="aname != null">
+        aname = #{aname,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where prid = #{prid}
+  </update>
 
 
   <select id="selectByPrid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
@@ -121,8 +147,20 @@
       #{id}
     </foreach>
   </select>
-  <delete id="deletePrid">
+
+    <delete id="deletePrid">
     delete from public_examine
     where prid = #{id,jdbcType=INTEGER}
   </delete>
+
+  <select id="selectByuList" resultType="com.goafanti.customer.bo.PublicReleaseTransferUserBo">
+    SELECT a.id ,a.user_names userNames,b.uid ,a.aid ,c.aid examineId
+    from public_release a left join public_release_details b on a.id=b.prid
+                          left join public_examine c on a.id=c.prid
+    where a.public_type in (1,3)
+      and b.uid in
+    <foreach close=")" collection="list" item="uid" open="(" separator=",">
+      #{uid,jdbcType=VARCHAR}
+    </foreach>
+  </select>
 </mapper>

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

@@ -366,12 +366,14 @@
 	</if>
   </select>
   <select id="financeOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
-    select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,a.approval,
+    select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,a.approval,b.contract_no contractNo,
     ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,a.status,b.process_status processStatus,
-    b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
+    b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount,tm.buyer_name userName
+    from t_order_invoice a
     left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
     left join (select order_no,sum(amount)as  sumAmount from t_order_invoice where status =2 group by order_no) d
     on a.order_no=d.order_no left join department e on b.order_dep=e.id
+    left join t_order_mid tm on a.order_no =tm.order_no
     where b.delete_sign in (0,2)
     <if test="all ==0">
       and a.status in (1,2)
@@ -390,7 +392,19 @@
 	<if test="orderNo !=null">
 	and a.order_no = #{orderNo,jdbcType=VARCHAR}
 	</if>
-	<if test="name !=null">
+    <if test="contractNo != null">
+      and b.contract_no like concat('%',#{contractNo},'%')
+    </if>
+    <if test="userName != null">
+      and tm.buyer_name like concat('%',#{userName},'%')
+    </if>
+    <if test="invoiceType != null">
+      and a.status =#{invoiceType}
+    </if>
+    <if test="startTime != null and endTime != null">
+      and a.create_time BETWEEN #{startTime} and #{endTime}
+    </if>
+    <if test="name !=null">
 	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
 	<if test="deps !=null">
@@ -422,6 +436,7 @@
 	left join t_order_new b on a.order_no=b.order_no
 	left join admin c on b.salesman_id=c.id
 	 left join department e on b.order_dep=e.id
+    left join t_order_mid tm on a.order_no =tm.order_no
     where b.delete_sign in (0,2)
     <if test="all ==0">
       and a.status in (1,2)
@@ -439,6 +454,18 @@
 	<if test="orderNo !=null">
 	and a.order_no = #{orderNo,jdbcType=VARCHAR}
 	</if>
+    <if test="contractNo != null">
+      and b.contract_no like concat('%',#{contractNo},'%')
+    </if>
+    <if test="userName != null">
+      and tm.buyer_name like concat('%',#{userName},'%')
+    </if>
+    <if test="invoiceType != null">
+      and a.status =#{invoiceType}
+    </if>
+    <if test="startTime != null and endTime != null">
+      and a.create_time BETWEEN #{startTime} and #{endTime}
+    </if>
 	<if test="name !=null">
 	and c.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>

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

@@ -2372,7 +2372,11 @@
       and a.create_time BETWEEN #{startTime} and #{endTime}
     </if>
   </select>
-
+  <select id="selectOrderNoAllByaid" resultType="java.lang.String">
+    select order_no
+    from t_order_task
+    where task_receiver = #{aid} group by order_no
+  </select>
 
 
   <delete id="deleteBySplitId" parameterType="java.lang.Integer">

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

@@ -2339,4 +2339,8 @@ inner join(
 		</if>
 		group by a.aid
 	</select>
+	<select id="selectBelongByaid" resultType="java.lang.String">
+		SELECT id     from user
+		where aid= #{aid} and share_type in (0,2)
+	</select>
 </mapper>

+ 15 - 2
src/main/java/com/goafanti/common/model/ExpenseAccount.java

@@ -32,7 +32,7 @@ public class ExpenseAccount implements Serializable {
     private String aname;
 
     /**
-     * 分类 0=其他,1=差旅费,2=非业务报销, 3=第三方付款,4=申请借支
+     * 分类 0=其他,1=差旅费,2=非业务报销, 3=第三方付款,4=申请借支,5=抵扣
      */
     private Integer type;
 
@@ -127,7 +127,7 @@ public class ExpenseAccount implements Serializable {
     private Integer targetType;
 
     /**
-     * 清算状态 0-未抵扣,1=已抵扣,未全款,2=已全款
+     * 清算状态 0-未抵扣,1=已抵扣,未全款,2=已全款,未审核,3已全款,已审核
      */
     private Integer liquidationStatus;
 
@@ -136,6 +136,11 @@ public class ExpenseAccount implements Serializable {
      */
     private String remarks;
 
+    /**
+     * 报销查询编号
+     */
+    private String checkNo;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -345,4 +350,12 @@ public class ExpenseAccount implements Serializable {
     public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
+
+    public String getCheckNo() {
+        return checkNo;
+    }
+
+    public void setCheckNo(String checkNo) {
+        this.checkNo = checkNo;
+    }
 }

+ 40 - 0
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -12,6 +12,8 @@ import com.goafanti.common.model.*;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.NewOrderChangeBo;
 import com.goafanti.order.bo.TOrderNewBo;
+import com.goafanti.order.bo.TOrderTaskBo;
+import com.goafanti.order.enums.NewProjectStatus;
 import com.goafanti.order.enums.OrderChangeProcess;
 import com.goafanti.order.enums.OrderChangeType;
 import com.goafanti.order.enums.ProcessStatus;
@@ -278,6 +280,7 @@ public class AsyncUtils {
 		//获取旧人员与新人员的角色
 		List<String>  useType=adminMapper.getAdminRoleListByAid(admin.getId());
 		List<String>  newType=adminMapper.getAdminRoleListByAid(tadmin.getId());
+		List<String>  useOrderNo=tOrderTaskMapper.selectOrderNoAllByaid(admin.getId());
 		String aid=admin.getId();
 		String transferId=tadmin.getId();
 		if (useType.contains(AFTConstants.TECH)&&newType.contains(AFTConstants.TECH)){
@@ -316,8 +319,45 @@ public class AsyncUtils {
 		}
 		taskAttributionLogMapper.insertList(aid, transferId, date);
 		tTaskLogMapper.updateDimissionTransfer(aid, transferId);
+		updateOrderMidServiceProject(useOrderNo);
 	}
 
+	private void updateOrderMidServiceProject(List<String> useOrderNo) {
+		for (String orderNo : useOrderNo) {
+			updateOrderMidServiceProject(orderNo);
+		}
+	}
+
+	private void updateOrderMidServiceProject(String orderNo) {
+		{
+			List<TOrderTaskBo> taskBos = tOrderTaskMapper.selectOrderTaskAll(orderNo, null);
+			if (!taskBos.isEmpty()){
+				List<String > cp=new ArrayList<>();
+				List<String > cc=new ArrayList<>();
+				StringBuffer ps=new StringBuffer();
+				StringBuffer cs=new StringBuffer();
+				for (TOrderTaskBo taskBo : taskBos) {
+					if (!cp.contains(taskBo.getCommodityName())){
+						cp.add(taskBo.getCommodityName());
+						ps=ps.append(taskBo.getCommodityName());
+						String str= NewProjectStatus.getValueByCode(taskBo.getProjectStatus());
+						ps=ps.append("-").append(str).append("-").append(taskBo.getContacts()).append(",");
+					}
+					if (!cc.contains(taskBo.getCname())){
+						cc.add(taskBo.getCname());
+						cs=cs.append(taskBo.getCname()).append(",");
+					}
+				}
+				TOrderMid tOrderMid = new TOrderMid();
+				tOrderMid.setOrderNo(orderNo);
+				if (ps.length()>1)tOrderMid.setServiceProject(ps.substring(0,ps.length()-1));
+				if (ps.length()>1)tOrderMid.setServiceType(cs.substring(0,cs.length()-1));
+				tOrderMidMapper.updateByOrderNo(tOrderMid);
+			}
+		}
+	}
+
+
 	private void pushChangeProcessZXSJL(List<Integer> list) {
 		if(!list.isEmpty()){
 			Date date =new Date();

+ 1 - 1
src/main/java/com/goafanti/common/utils/excel/Excel.java

@@ -37,7 +37,7 @@ public @interface Excel
     public String dictType() default "";
 
     /**
-     * 	枚举名称
+     * 	枚举名称, 需要枚举中有getValueByCode字段来处理
      */
     public String enumsName() default "";
 

+ 0 - 8
src/main/java/com/goafanti/common/utils/excel/ExcelConstant.java

@@ -1,22 +1,14 @@
 package com.goafanti.common.utils.excel;
 
-import com.goafanti.order.enums.LiquidationNewState;
 
 public class ExcelConstant {
 
-	public static final String TaskStateStr="0=未分配,1=已分配,2=材料已启动,3=材料已完成,10=未定义";
 
-	public static final String NewProjectStatusStr="0=未启动,1=进行中,2=暂停(客户通知暂停),3=暂停(业务线通知暂停),"
-			+ "4=已提交,5=未推荐,6=已推荐,7=未拟公示,8=已拟公示,28=抽查未备案,9=已备案,10=已下证 ,11=退单(已申报),"
-			+ "12=退单(未申报),13=已答辩,14=未立项,15=已立项,16=前补助,17=后补助,18=立项已拨款,19=已完成/下证,20=已驳回,"
-			+ "21=第1年进行中,22=第1年服务完成,23=第2年进行中,24=第2年服务完成,25=第3年进行中,26=第3年服务完成,27=所有会员服务全部完成,99=未知";
 
 	public static final String chooseTypeStr = "0=第三方成本,1=催款节点,2=官费";
 
 	public static final String paymentStatusStr = "0=审核,1=待支付,2=驳回,3=已支付,4=已取消";
 
-	public static final String orderStatusStr = "0=待签单 ,1=签单待审,2=签单审核通过,3=签单审核拒绝,4=已结项,5=已驳回,6=退单中,7=已退单";
 
-	public static final String liquidationStatusStr = "0=首付待付清,1=尾款待付清,2=已付清,3=退款待确认,3=全部退款,10=INVALID";
 
 }

+ 10 - 0
src/main/java/com/goafanti/core/mybatis/BaseMybatisDao.java

@@ -203,6 +203,16 @@ public class BaseMybatisDao<T> extends SqlSessionDaoSupport {
 
 	}
 
+	/**
+	 * 分页并统计总金额
+	 * @param sqlId   字段sql名称
+	 * @param countId count sql名称
+	 * @param coutnAoumt 统计金额sql名称
+	 * @param params 参数
+	 * @param pageNo 页码
+	 * @param pageSize 页面显示数
+	 * @return
+	 */
 	public Pagination<?> findPagePlus(String sqlId, String countId,String coutnAoumt, Map<String, Object> params, Integer pageNo,
 								  Integer pageSize) {
 		Pagination<?> page = findPage(sqlId, countId, params, pageNo, pageSize);

+ 10 - 5
src/main/java/com/goafanti/core/mybatis/JDBCIdGenerator.java

@@ -1,14 +1,13 @@
 package com.goafanti.core.mybatis;
 
-import java.text.MessageFormat;
-import java.util.Calendar;
-
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.Assert;
 
-import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.common.utils.StringUtils;
+import java.text.MessageFormat;
+import java.util.Calendar;
 
 /**
  *
@@ -107,4 +106,10 @@ public class JDBCIdGenerator {
 		}
 		return time;
 	}
+
+	public String getNOgenerateId(){
+		StringBuffer str=new StringBuffer("NO");
+		str=str.append(generateId());
+		return str.toString();
+	}
 }

+ 41 - 0
src/main/java/com/goafanti/customer/bo/PublicReleaseTransferUserBo.java

@@ -0,0 +1,41 @@
+package com.goafanti.customer.bo;
+
+public class PublicReleaseTransferUserBo {
+
+    private Integer id;
+    private String uid;
+    private String aid;
+    private String userNames;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getUserNames() {
+        return userNames;
+    }
+
+    public void setUserNames(String userNames) {
+        this.userNames = userNames;
+    }
+}

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

@@ -758,7 +758,12 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 
-	/** 转为公共客户 **/
+	/**
+	 * 转为公共客户 释放客户
+	 * @param uid
+	 * @param aid
+	 * @return
+	 */
 	@RequestMapping(value = "/transferToPublic", method = RequestMethod.GET)
 	public Result transferToPublic(String uid,String aid){
 		Result res = new Result();
@@ -905,7 +910,7 @@ public class AdminCustomerApiController extends BaseApiController{
 	}
 
 	/**
-	 * 客户转交
+	 * 客户转交 私有客户转交,签单客户转交
 	 * @param uid 用户编号
 	 * @param aid
 	 * @param operatorType 3私有 4签单

+ 3 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -568,4 +568,7 @@ public interface CustomerService {
 	 * @return
 	 */
 	boolean checkAid(String aid, Integer roleType);
+
+
+	void transferUser(List<String> uList, String aid, String uid);
 }

+ 66 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -15,6 +15,7 @@ import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.core.websocket.SystemWebSocketHandler;
 import com.goafanti.customer.bo.*;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.order.bo.TOrderNewBo;
@@ -27,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.socket.TextMessage;
 
 import javax.annotation.Resource;
 import java.lang.reflect.InvocationTargetException;
@@ -96,6 +98,17 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	private TOrderMidMapper	tOrderMidMapper;
 	@Resource
 	private TOrderLogMapper	tOrderLogMapper;
+	@Resource
+	private PublicExamineMapper publicExamineMapper;
+	@Resource
+	private PublicReleaseLogMapper publicReleaseLogMapper;
+	@Resource
+	private PublicReleaseMapper publicReleaseMapper;
+	@Autowired
+	private SystemWebSocketHandler systemWebSocketHandler;
+
+	@Autowired
+	private	AsyncUtils asyncUtils;
 
 
 
@@ -1284,6 +1297,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			if (AFTConstants.SIGN_USER_TRANSFER_TO_OTHER == operatorType)type = 7;
 
 			addUserTransferLog(uid, aid,oldAid, type, null, now, uList);
+			//转交客户后公出审核人也切换
+			transferUser(uList,aid,uid);
 		}
 		if (isUs) {
 			if (AFTConstants.USER_RECEIVE == operatorType) {
@@ -1297,6 +1312,57 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return errors;
 	}
 
+	@Override
+	public void transferUser(List<String> uList, String aid, String uid) {
+		if(uList.isEmpty())uList.add(uid);
+		//先查出所有在其他审核的公出
+		List<PublicReleaseTransferUserBo> list=publicExamineMapper.selectByuList(uList);
+		Admin admin = adminMapper.selectByPrimaryKey(aid);
+		Integer logStatus=null;
+		String logMsg=null;
+		StringBuffer content=null;
+		String noticeAid=null;
+		for (PublicReleaseTransferUserBo e : list) {
+			PublicExamine pe=new PublicExamine();
+			pe.setPrid(e.getId());
+			if (e.getAid().equals(aid)){
+				content=new StringBuffer().append("[").append(e.getUserNames()).append("]公司的外出申请已发起,请尽快审核。");
+				//再查比对和发起者一致的全部走入下一个审核流程
+				PublicRelease pr=new PublicRelease();
+				pr.setId(e.getId());
+				pr.setPublicType(0);
+				publicReleaseMapper.updateByPrimaryKeySelective(pr);
+				Admin sendAdmin=adminMapper.selectByPrimaryKey(admin.getReviewer());
+				noticeAid=sendAdmin.getId();
+				logStatus=2;
+				logMsg="转交客户到发起公出审核人,自动审核通过。";
+				pe.setAid(sendAdmin.getId());
+				pe.setAname(sendAdmin.getName());
+				pe.setCreateTime(new Date());
+			}else {
+				//与发起者不一致的就需要修改审核人员
+				pe.setAid(aid);
+				pe.setAname(admin.getName());
+				//给新的审核人发送消息
+				logStatus=5;
+				logMsg="转交客户归属人到["+admin.getName()+"]。";
+				content=new StringBuffer().append("[").append(e.getUserNames()).append("]公司已转交给您,相关公出请尽快审核。");
+				noticeAid=aid;
+			}
+			PublicReleaseLog log = new PublicReleaseLog(e.getId(), TokenManager.getAdminId(), logStatus, logMsg, new Date());
+			publicReleaseLogMapper.insertSelective(log);
+			systemWebSocketHandler.sendMessageToUser(noticeAid, new TextMessage("unread"));
+			Notice n =new Notice();
+			n.setId(UUID.randomUUID().toString());
+			n.setAid(noticeAid);
+			n.setNoticeType(NoticeStatus.PUBLIC_RELEASE_START.getCode());
+			n.setContent(content.toString());
+			n.setReaded(0);//未读
+			asyncUtils.addNotice(n);
+			publicExamineMapper.updateByPridSelective(pe);
+		}
+	}
+
 	private void updateOrderHandOver(String uid, String aid, String oldAid) {
 		List<TOrderNewBo> list = tOrderNewMapper.selectByuidandAid(uid, oldAid);
 		for (TOrderNewBo bo : list) {

+ 3 - 0
src/main/java/com/goafanti/expenseAccount/bo/InputPageListBo.java

@@ -3,8 +3,11 @@ package com.goafanti.expenseAccount.bo;
 public class InputPageListBo {
     private String startTime;
     private String endTime;
+//    状态 0=草稿,1=审核中,2=完成,3=驳回
     private Integer status;
+//    审核状态 0审核中  1已审核
     private Integer examineStatus;
+//    查询人员 0自己 1审核 2查看
     private Integer processStatus;
 
     //同编号搜索、按客户名称搜索 、按部门/公司搜索 、按报销类型搜索、按报销公司部门/公司、按支付部门/公司搜索、按审核状态(财务审核中-不同人员针对的审核状态不一样、已完成)、报销时间(按报销的时间段进行搜索)

+ 9 - 0
src/main/java/com/goafanti/expenseAccount/bo/OutExpenseAccountBo.java

@@ -18,12 +18,21 @@ public class OutExpenseAccountBo {
     private Integer targetType;
 
     private String contractNo;
+    private String checkNo;
     private String buyerName;
     private String depName;
     private String financeName;
     private String attachmentUrl;
     private Integer examine;
 
+    public String getCheckNo() {
+        return checkNo;
+    }
+
+    public void setCheckNo(String checkNo) {
+        this.checkNo = checkNo;
+    }
+
     public Integer getExamine() {
         return examine;
     }

+ 12 - 0
src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java

@@ -118,6 +118,18 @@ public class ExpenseAccountController extends CertifyApiController {
         return res;
     }
 
+    /**
+     * 报销列表
+     * @param checkNo
+     * @return
+     */
+    @RequestMapping(value = "/selectByCheckNo",method = RequestMethod.GET)
+    public Result selectByCheckNo(String checkNo ){
+        Result res =new Result();
+        res.setData(expenseAccountService.selectByCheckNo(checkNo));
+        return res;
+    }
+
 
 
 

+ 4 - 0
src/main/java/com/goafanti/expenseAccount/service/ExpenseAccountService.java

@@ -35,4 +35,8 @@ public interface ExpenseAccountService {
 
 
     void statisticsEvict(String name, String depId, String startTime, String endTime);
+
+    Object pushSupplementCheckNo();
+
+    Object selectByCheckNo(String checkNo);
 }

+ 29 - 1
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -9,8 +9,12 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.NoticeTypes;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.*;
-import com.goafanti.common.utils.*;
+import com.goafanti.common.utils.AsyncUtils;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.WeChatUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.expenseAccount.Enums.EAProcessStatus;
@@ -45,6 +49,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     private ExpenseAccountPrivateMapper expenseAccountPrivateMapper;
     @Autowired
     private ExpenseAccountExamineMapper expenseAccountExamineMapper;
+    @Autowired
+    private JDBCIdGenerator idGenerator;
 
 
 
@@ -53,6 +59,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     @Override
     public Integer add(InputExpenseAccount in) {
         //设置付款部门和支付部门
+        in.setCheckNo(idGenerator.getNOgenerateId());
         if (in.getAid()!=null){
             Admin admin = adminMapper.selectByPrimaryKey(in.getAid());
             in.setAname(admin.getName());
@@ -553,6 +560,13 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         return useEa;
     }
 
+
+    @Override
+    public Object selectByCheckNo(String checkNo) {
+        OutExpenseAccount useEa = expenseAccountMapper.selectByCheckNo(checkNo);
+        return useEa;
+    }
+
     /**
      * 计算当前报销显示抵扣金额
      * @param useEa
@@ -760,6 +774,20 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         LoggerUtils.debug(getClass(), "报销统计清楚缓存。");
     }
 
+    @Override
+    public Object pushSupplementCheckNo() {
+        List<ExpenseAccount> list = expenseAccountMapper.selectByCheckNoNot();
+        if (!list.isEmpty()){
+            list.forEach(e ->{
+                ExpenseAccount ea=new ExpenseAccount();
+                ea.setId(e.getId());
+                ea.setCheckNo(idGenerator.getNOgenerateId());
+                expenseAccountMapper.updateByPrimaryKeySelective(ea);
+            });
+            return 1;
+        }
+        return 0;
+    }
 
 
 

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

@@ -1,7 +1,5 @@
 package com.goafanti.order.bo;
 
-import java.util.List;
-
 public class InputOrderInvoiceBo {
 	private String deps;
 	private String orderNo;
@@ -10,6 +8,56 @@ public class InputOrderInvoiceBo {
 	private Integer approval;
 	private Integer status;
 	private Integer all;
+//合同编号,客户名称,开票状态,审核状态,按申请时间
+	private String contractNo;
+
+	private String userName;
+
+	private Integer invoiceType;
+
+	private String startTime;
+	private String endTime;
+
+
+	public String getContractNo() {
+		return contractNo;
+	}
+
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public Integer getInvoiceType() {
+		return invoiceType;
+	}
+
+	public void setInvoiceType(Integer invoiceType) {
+		this.invoiceType = invoiceType;
+	}
+
+	public String getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
 
 	public Integer getAll() {
 		return all;

+ 38 - 16
src/main/java/com/goafanti/order/bo/TOrderInvoiceBo.java

@@ -1,32 +1,51 @@
 package com.goafanti.order.bo;
 
-import java.math.BigDecimal;
-
 import com.goafanti.common.utils.excel.Excel;
 
+import java.math.BigDecimal;
+
 
 public class TOrderInvoiceBo {
-	@Excel(name = "编号")
+	@Excel(name = "编号",width =6)
 	private Integer id;
+	@Excel(name = "客户名称")
+	private String userName;
+	@Excel(name = "开票单位名称")
 	private String unitName;
+	@Excel(name = "跟单人/签单人")
+	private String name;
 	@Excel(name = "订单编号")
-	private String orderno;
+	private String orderNo;
+	@Excel(name = "合同编号")
 	private String contractNo;
-	private String name;
+	@Excel(name = "项目状态",enumsName = "com.goafanti.order.enums.NewProjectStatus")
 	private Integer projectStatus;
 	private Integer processStatus;
-	private BigDecimal sumAmount;
-	@Excel(name = "开票金额(万元)")
+
+	@Excel(name = "开票金额(万元)",scale = 6)
 	private BigDecimal amount;
-	@Excel(name = "申请时间")
-	private String createTime;
-	@Excel(name = "开票状态",readConverterExp = "1=处理中,2通过")
+	@Excel(name = "开票状态",readConverterExp = "1=处理中,2=已完成,3=驳回")
 	private Integer status;
-	private BigDecimal notAmount;
+	@Excel(name = "特批状态",readConverterExp = "0=非特批,1=待审核,2=审核通过")
+	private Integer approval;
+	@Excel(name = "已开票(万元)",scale = 6)
+	private BigDecimal sumAmount;
+	@Excel(name = "已收款(万元)",scale = 6)
 	private BigDecimal settlementAmount;
+	@Excel(name = "未收款(万元)",scale = 6)
+	private BigDecimal notAmount;
+	@Excel(name = "申请时间")
+	private String createTime;
 	private String rejectReason;
 	private String examineName;
-	private Integer approval;
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
 
 	public String getExamineName() {
 		return examineName;
@@ -48,12 +67,15 @@ public class TOrderInvoiceBo {
 	public void setUnitName(String unitName) {
 		this.unitName = unitName;
 	}
-	public String getOrderno() {
-		return orderno;
+
+	public String getOrderNo() {
+		return orderNo;
 	}
-	public void setOrderno(String orderno) {
-		this.orderno = orderno;
+
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
 	}
+
 	public String getName() {
 		return name;
 	}

+ 5 - 9
src/main/java/com/goafanti/order/bo/TOrderTaskListBo.java

@@ -1,16 +1,12 @@
 package com.goafanti.order.bo;
 
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-
 import com.goafanti.common.enums.OfficialPatentType;
 import com.goafanti.common.utils.excel.Excel;
 import com.goafanti.common.utils.excel.Excel.ColumnType;
-import com.goafanti.common.utils.excel.ExcelConstant;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.patent.enums.PatentType;
+
+import java.math.BigDecimal;
+import java.util.List;
 
 public class TOrderTaskListBo {
 	@Excel(name = "项目编号")
@@ -39,9 +35,9 @@ public class TOrderTaskListBo {
 	private String taskDate;
 	@Excel(name = "数量(个)")
 	private Integer commodityQuantity;
-	@Excel(name = "任务状态",readConverterExp = ExcelConstant.TaskStateStr)
+	@Excel(name = "任务状态",enumsName = "com.goafanti.order.enums.TaskState")
 	private Integer taskStatus;
-	@Excel(name = "项目状态",readConverterExp = ExcelConstant.NewProjectStatusStr)
+	@Excel(name = "项目状态",enumsName = "com.goafanti.order.enums.NewProjectStatus")
 	private Integer projectStatus;
 	@Excel(name = "工时",cellType = ColumnType.NUMERIC)
 	private Double hours;

+ 26 - 11
src/main/java/com/goafanti/order/controller/OrderInvoiceApiController.java

@@ -1,22 +1,23 @@
 package com.goafanti.order.controller;
 
 
-
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-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.TOrderInvoice;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.InputOrderInvoiceBo;
+import com.goafanti.order.bo.TOrderInvoiceBo;
 import com.goafanti.order.service.OrderInvoiceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 @RestController
 @RequestMapping(value = "/api/admin/orderInvoice")
@@ -24,6 +25,8 @@ public class OrderInvoiceApiController extends CertifyApiController {
 
 	@Autowired
 	private OrderInvoiceService		orderInvoiceService;
+	@Value(value = "${upload.path}")
+	private final String	uploadPath			= null;
 
 	/**
 	 * 创建发票申请
@@ -116,6 +119,18 @@ public class OrderInvoiceApiController extends CertifyApiController {
 		return res;
 	}
 
+	/**
+	 *  财务开票列表
+	 * @return
+	 */
+	@RequestMapping(value = "/financeOrderInvoiceList/export",method = RequestMethod.GET)
+	public Result financeOrderInvoiceListExport(InputOrderInvoiceBo o,Integer pageNo,Integer pageSize){
+		NewExcelUtil<TOrderInvoiceBo> excelUtil=new NewExcelUtil<>(TOrderInvoiceBo.class);
+		List<TOrderInvoiceBo> list = (List<TOrderInvoiceBo>) orderInvoiceService.financeOrderInvoiceList(o, pageNo, 99999).getList();
+		String exportName=o.getType()==0?"省内开票查询列表":"省外开票查询列表";
+		return excelUtil.exportExcel(list,exportName,uploadPath);
+	}
+
 
 
 	/**
@@ -123,9 +138,9 @@ public class OrderInvoiceApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/approvalOrderInvoiceList",method = RequestMethod.GET)
-	public Result approvalOrderInvoiceList(Integer status,Integer approval,Integer type,String orderDep,String orderNo ,String name,String userName,Integer pageNo,Integer pageSize){
+	public Result approvalOrderInvoiceList(Integer status,Integer approval,Integer type,String orderDep,String orderNo ,
+										   String name,String userName,Integer pageNo,Integer pageSize){
 		Result res = new Result();
-
 		res.data(orderInvoiceService.approvalOrderInvoiceList( status,approval,type, orderDep, orderNo, name,userName,pageNo,pageSize));
 		return res;
 	}

+ 7 - 9
src/main/java/com/goafanti/order/controller/StatisticsApiController.java

@@ -2,16 +2,13 @@ package com.goafanti.order.controller;
 
 
 
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.http.HttpServletResponse;
-
-import com.alibaba.fastjson.JSONObject;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.bo.outStatistics.OutOrderSalesSourceAmount;
 import com.goafanti.order.service.OrderStatisticsService;
+import com.goafanti.order.service.ProjectStatisticsService;
 import com.goafanti.order.service.UserStaticticsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -19,9 +16,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.order.service.ProjectStatisticsService;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
 
 @RestController
 @RequestMapping(value = "/api/admin/statistis")
@@ -40,6 +37,7 @@ public class StatisticsApiController extends CertifyApiController {
 
 	/**
 	 * 	项目汇总列表
+	 * 	项目统计表点击弹出得详情列表
 	 */
 	@RequestMapping(value="/selectTaskList" ,method = RequestMethod.GET)
 	public Result selectTaskList(InputProjectStatistics ps){

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

@@ -29,7 +29,8 @@ public enum NewProjectStatus {
 	YNGS(8,"已拟公示"), YBA(9,"已备案"), YXZ(10,"已下证 "), TDYSB(11,"退单(已申报/已下证)"),
 	TDWSB(12,"退单(未申报/未下证)"),CCWBA(28,"抽查未备案"),
 
-	YDB(13,"已答辩"),WLX(14,"未立项"),YLX(15,"已立项"),QBZ(16,"前补助"),HBZ(17,"后补助"),LXYBK(18,"立项已拨款"),
+	YDB(13,"已答辩"),WLX(14,"未立项"),YLX(15,"已立项"),QBZ(16,"前补助"),HBZ(17,"后补助"),
+	LXYBK(18,"立项已拨款"),
 
 	YWCXZ(19,"已完成(下证)"),YBH(20,"已驳回"),
 

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

@@ -855,6 +855,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	}
 
 	@Override
+	@Transactional
 	public int pushCompleteOrderChange(NewOrderChangeBo nb) {
 		//变更完成
 		changeAdopt(nb);

+ 6 - 0
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -212,6 +212,12 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		if(StringUtils.isNotBlank(o.getName()))params.put("name", o.getName());
 		if(null!=o.getApproval())params.put("approval", o.getApproval());
 		if(null!=o.getStatus())params.put("status", o.getStatus());
+		if(null!=o.getContractNo())params.put("contractNo", o.getContractNo());
+		//这里不是客户得名称,而是开票的单位名称
+		if(null!=o.getUserName())params.put("userName", o.getUserName());
+		if(null!=o.getInvoiceType())params.put("invoiceType", o.getInvoiceType());
+		if(null!=o.getStartTime())params.put("startTime", o.getStartTime());
+		if(null!=o.getEndTime())params.put("endTime", o.getEndTime()+" 23:59:59");
 		return (Pagination<TOrderInvoiceBo>)findPage("financeOrderInvoiceList", "financeOrderInvoiceCount", params, pageNo, pageSize);
 
 	}

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

@@ -327,6 +327,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tNew.setProcessStatus(getOrderProcessStatus(orderNo));
 		tNew.setExamineName("");
 		tOrderNewMapper.updateByPrimaryKeySelective(tNew);
+		updateMidServiceProject(orderNo);
 	}
 
 	@Override
@@ -1475,7 +1476,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 
 	@Override
 	public void updateMidServiceProject(String orderNo) {
-		List<TOrderTaskBo> taskBos = tOrderTaskMapper.selectOrderTaskAll(orderNo, null);
+		List<TOrderTaskBo> taskBos = tOrderTaskMapper.selectOrderTaskAll(orderNo, 4);
 		if (!taskBos.isEmpty()){
 			List<String > cp=new ArrayList<>();
 			List<String > cc=new ArrayList<>();
@@ -1486,8 +1487,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 					cp.add(taskBo.getCommodityName());
 					ps=ps.append(taskBo.getCommodityName());
 					String str= NewProjectStatus.getValueByCode(taskBo.getProjectStatus());
-					ps=ps.append("-").append(str).append(",");
-
+					String contacts=taskBo.getContacts()!=null?taskBo.getContacts():"暂无";
+					ps=ps.append("-").append(str).append("-").append(contacts).append(",");
 				}
 				if (!cc.contains(taskBo.getCname())){
 					cc.add(taskBo.getCname());

+ 15 - 40
src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java

@@ -1,40 +1,12 @@
 package com.goafanti.order.service.impl;
 
-import java.math.BigDecimal;
-import java.util.*;
-
-import javax.annotation.Resource;
-
 import com.goafanti.admin.service.DepartmentService;
-import com.goafanti.common.model.*;
-import com.goafanti.order.bo.*;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFCellStyle;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.TOrderBillNewMapper;
-import com.goafanti.common.dao.TOrderBonusMapper;
-import com.goafanti.common.dao.TOrderLogMapper;
-import com.goafanti.common.dao.TOrderMidMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
-import com.goafanti.common.dao.TemporaryReceivablesMapper;
+import com.goafanti.common.dao.*;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.*;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.ExcelUtils;
 import com.goafanti.common.utils.ExportExcelUtil;
@@ -42,16 +14,19 @@ import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.order.enums.ApprovalNewState;
-import com.goafanti.order.enums.BonusSubject;
-import com.goafanti.order.enums.LiquidationNewState;
-import com.goafanti.order.enums.ProcessStatus;
-import com.goafanti.order.enums.ReceivablesStatus;
-import com.goafanti.order.enums.TransactionSubject;
-import com.goafanti.order.service.FundManageOrderService;
-import com.goafanti.order.service.OrderBillService;
-import com.goafanti.order.service.OrderInvoiceService;
+import com.goafanti.order.bo.*;
+import com.goafanti.order.enums.*;
 import com.goafanti.order.service.OrderReceivablesService;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.usermodel.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.math.BigDecimal;
+import java.util.*;
 
 @Service
 public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceivablesMapper> implements OrderReceivablesService{
@@ -524,7 +499,7 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 					switch (comment[i]) {
 //					String[] comment = {"编号","订单编号","开票金额(万元)","申请时间","开票状态"};
 					case "编号": o = ob.getId().toString(); break;
-					case "订单编号": o = ob.getOrderno(); break;
+					case "订单编号": o = ob.getOrderNo(); break;
 					case "开票金额(万元)": o = ob.getAmount().toString(); break;
 					case "申请时间": o = ob.getCreateTime(); break;
 					case "开票状态":

+ 6 - 2
src/main/java/com/goafanti/order/service/impl/PushOrderService.java

@@ -16,7 +16,8 @@ public class PushOrderService {
 
     /**
      * 根据流程与角色判断是否可以查看订单合同
-     * @return  超级管理员、运营决策者、总裁、外包审核与可以查看;营销员与经理可以查看自己的订单;
+     * @return  超级管理员、运营决策者、总裁、外包审核与可以查看;
+     *          营销员与经理可以查看自己的订单;
      *         营销管理员、财务专员、咨询师管理员可以看到在自己手上的合同;其他只能获取到无权限查看的图片
      *
      */
@@ -70,14 +71,17 @@ public class PushOrderService {
      * @return
      */
     public String changeProcessStatusConstant(String url,String aid,Integer processStatus,Integer status){
-        boolean flag=false;
         //流程状态 0营销员 1营销管理员 2技术员 3技术经理 4技术总监 5财务专员(退单) 6财务总监 7总裁 8董事长 9 财务专员(非退单)
+        boolean flag=false;
+        //超级管理员、董事长、总裁、总裁助手可以看
+        //营销员、营销经理可以看
         if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION) ||
                 TokenManager.hasRole(AFTConstants.CED) ||TokenManager.hasRole(AFTConstants.CED_ASSISTANT)){
             flag=true;
         } else  if(TokenManager.hasRole(AFTConstants.SALESMAN)||TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
             flag=true;
         }else{
+            //其他都是审核得时候可以看
             switch (processStatus) {
                 case 2:
                     if(TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){

+ 10 - 10
src/main/java/com/goafanti/organization/bo/outPaymentList.java

@@ -1,19 +1,19 @@
 package com.goafanti.organization.bo;
 
-import java.math.BigDecimal;
-
 import com.goafanti.common.utils.excel.Excel;
 import com.goafanti.common.utils.excel.ExcelConstant;
 
+import java.math.BigDecimal;
+
 public class outPaymentList {
-		
+
 		@Excel(name = "支付编号")
 		private Integer id;
 		@Excel(name = "项目编号")
 		private Integer tid;
 		@Excel(name = "项目名称")
 		private String pname;
-		@Excel(name = "项目状态",readConverterExp = ExcelConstant.NewProjectStatusStr)
+		@Excel(name = "项目状态",enumsName = "com.goafanti.order.enums.NewProjectStatus")
 		private Integer projectStatus;
 		@Excel(name = "分类名称")
 		private String cname;
@@ -49,10 +49,10 @@ public class outPaymentList {
 		private BigDecimal settlementAmount;
 		private String officialName;
 		private Integer processStatus;
-		
-		
-		
-		
+
+
+
+
 		public String getContractNo() {
 			return contractNo;
 		}
@@ -83,7 +83,7 @@ public class outPaymentList {
 		public void setCostAmount(String costAmount) {
 			this.costAmount = costAmount;
 		}
-		
+
 		public BigDecimal getPaymentAmount() {
 			return paymentAmount;
 		}
@@ -204,5 +204,5 @@ public class outPaymentList {
 		public void setProcessStatus(Integer processStatus) {
 			this.processStatus = processStatus;
 		}
-		
+
 }

+ 9 - 11
src/main/java/com/goafanti/permission/controller/NewRoleApiController.java

@@ -1,15 +1,5 @@
 package com.goafanti.permission.controller;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -20,6 +10,14 @@ import com.goafanti.common.model.Role;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.permission.bo.RoleBo;
 import com.goafanti.permission.service.NewRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
 
 @RestController
 @RequestMapping("/api/admin")
@@ -165,7 +163,7 @@ public class NewRoleApiController extends BaseApiController{
 		return res;
 	}
 	/**
-	 * 离职转交
+	 * 离职转交 离职一键转交
 	 * @param aid 离职ID
 	 * @param transferId 转交ID
 	 * @return

+ 20 - 30
src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java

@@ -1,39 +1,24 @@
 package com.goafanti.permission.service.impl;
 
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-import com.goafanti.common.bo.OrderExamineBo;
-import com.goafanti.common.dao.*;
-import com.goafanti.common.model.*;
-import com.goafanti.common.utils.AsyncUtils;
-import com.goafanti.order.bo.NewOrderChangeBo;
-import com.goafanti.order.bo.TOrderTaskBo;
-import com.goafanti.order.enums.ChangeState;
-import com.goafanti.order.enums.NewProjectStatus;
-import com.goafanti.order.enums.OrderChangeProcess;
-import com.goafanti.order.service.OrderChangeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import com.goafanti.common.bo.Error;
-import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.*;
 import com.goafanti.common.enums.roleResources;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.*;
+import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.service.CustomerService;
 import com.goafanti.permission.bo.RoleBo;
 import com.goafanti.permission.bo.RolePermissionBo;
 import com.goafanti.permission.service.NewRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
 @Service
 public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements NewRoleService {
 	@Autowired
@@ -57,7 +42,7 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 	@Autowired
 	private TOrderMidMapper	tOrderMidMapper;
 	@Autowired
-	private OrderExamineMapper	orderExamineMapper;
+	private CustomerService customerService;
 	@Autowired
 	private UserTransferLogMapper	userTransferLogMapper;
 	@Autowired
@@ -207,6 +192,7 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 				userBusinessMapper.updateDimissionTransfer(aid,transferId);
 				organizationContactBookMapper.updateDimissionTransfer(aid,transferId);
 				//所有客户转交给接受者
+				transferUserUpdateExamine(aid,transferId);
 				userMapper.updateDimissionTransfer(aid,transferId);
 			}else if (s==roleResources.QDYW.getCode()) {
 				userTransferLogMapper.insertUserLockLog(aid,transferId,date);
@@ -230,11 +216,15 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 		return 1;
 	}
 
-
-
-
-
-
+	/**
+	 *
+	 * @param aid 离职id
+	 * @param transferId 转交id
+	 */
+	private void transferUserUpdateExamine(String aid, String transferId) {
+		List<String> uids=userMapper.selectBelongByaid(aid);
+		customerService.transferUser(uids,transferId,null);
+	}
 
 
 	@Override

+ 12 - 14
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -1,28 +1,26 @@
 package com.goafanti.weChat.controller;
 
 
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import com.goafanti.common.bo.Error;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.weChat.bo.*;
+import com.goafanti.weChat.service.PublicReleaseService;
 import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 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.utils.StringUtils;
-import com.goafanti.common.utils.excel.NewExcelUtil;
-import com.goafanti.weChat.service.PublicReleaseService;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
 
 @RestController
 @RequestMapping(value = "/api/admin/release")
@@ -145,7 +143,7 @@ public class AdminReleaseApiController extends CertifyApiController{
 	}
 
 	/**
-	 * 外出申请列表
+	 * 外出申请列表.公出列表
 	 * @return
 	 */
 	@RequestMapping(value = "/listPublicRelease", method = RequestMethod.GET)

+ 19 - 20
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -1,24 +1,14 @@
 package com.goafanti.weChat.service.impl;
 
-import java.text.ParseException;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicReference;
-
-import com.goafanti.admin.service.DepartmentService;
-import com.goafanti.common.dao.*;
-import com.goafanti.common.model.*;
-import com.goafanti.weChat.bo.*;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.socket.TextMessage;
-
+import cn.jiguang.common.utils.StringUtils;
 import com.goafanti.admin.bo.AdminListBo;
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.*;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.*;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.SendEmailUtil;
@@ -26,12 +16,20 @@ import com.goafanti.common.utils.WeChatUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.core.websocket.SystemWebSocketHandler;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.service.CustomerService;
+import com.goafanti.weChat.bo.*;
 import com.goafanti.weChat.service.PublicReleaseService;
-import com.goafanti.core.websocket.SystemWebSocketHandler;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.socket.TextMessage;
 
-import cn.jiguang.common.utils.StringUtils;
+import java.text.ParseException;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
 
 @Service
 public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper> implements PublicReleaseService {
@@ -341,7 +339,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				PublicExamine pe=new PublicExamine();
 				pe.setPrid(in.getId());
 				pe.setStatus(0);
-				publicExamineMapper.updatePrid(pe);
+				publicExamineMapper.updateStatusByPrid(pe);
 			}
 			AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 
@@ -587,7 +585,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					PublicExamine inpe=new PublicExamine();
 					inpe.setStatus(0);
 					inpe.setPrid(use.getId());
-					publicExamineMapper.updatePrid(inpe);
+					publicExamineMapper.updateStatusByPrid(inpe);
 				}
 			}else if(status==2){
 				str=str.append("同意,");
@@ -1080,7 +1078,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			if(in.getDeps()!=null){
 				map.put("deps", departmentService.parseArray(in.getDeps()));
 			}
-		}else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)||TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)||TokenManager.hasRole(AFTConstants.OPERATION_MANAGER)){
+		}else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)||TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)
+				||TokenManager.hasRole(AFTConstants.OPERATION_MANAGER)){
 			in.setType(1);
 			if (in.getDeps()!=null){
 				List<String> list = departmentService.selectSubDeps(in.getDeps());
@@ -1129,7 +1128,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			throw new BusinessException("转换异常");
 		}
 		List<Integer> is=publicReleaseMapper.checkTime(TokenManager.getAdminId(),in.getReleaseStart(),in.getReleaseEnd());
-		if (is.size()>1) {
+		if (is.size()>=1) {
 			return true;
 		}else  if(is.size()==1){
 			//如果id为新增那么直接不允许时间重复

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -52,11 +52,11 @@ yxjl_max=100
 amb.maxLvl=6
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.72
+static.host=//static.jishutao.com/1.2.81
 rd.static.host=//static.jishutao.com/RD/1.0.00
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.62
-#static.host=http://172.16.1.187/prod/1.2.66
+#static.host=//172.16.1.187/1.2.81
 
 #\u5FAE\u4FE1\u6253\u5361\u5C0F\u7A0B\u5E8F
 wx.appId=wxff2f5720ed7d7f63

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

@@ -52,7 +52,7 @@ amb.maxLvl=6
 
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.78
+static.host=//static.jishutao.com/1.2.81
 rd.static.host=//static.jishutao.com/RD/1.0.01
 avatar.upload.host=//static.jishutao.com/upload