Browse Source

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

anderx 1 year ago
parent
commit
c0164bb073
37 changed files with 1630 additions and 628 deletions
  1. 2 2
      src/main/java/com/goafanti/business/service/impl/RestrictProjectServiceImpl.java
  2. 3 0
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  3. 0 193
      src/main/java/com/goafanti/common/controller/TestPublicController.java
  4. 88 0
      src/main/java/com/goafanti/common/dao/OrderYearMaxDurationMapper.java
  5. 85 0
      src/main/java/com/goafanti/common/dao/StandardPlatformLinkMapper.java
  6. 74 12
      src/main/java/com/goafanti/common/dao/TOrderPublicReleaseCountMapper.java
  7. 163 0
      src/main/java/com/goafanti/common/mapper/OrderYearMaxDurationMapper.xml
  8. 2 2
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  9. 3 0
      src/main/java/com/goafanti/common/mapper/StandardDocumentMapper.xml
  10. 174 0
      src/main/java/com/goafanti/common/mapper/StandardPlatformLinkMapper.xml
  11. 4 3
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  12. 130 111
      src/main/java/com/goafanti/common/mapper/TOrderPublicReleaseCountMapper.xml
  13. 3 1
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  14. 100 0
      src/main/java/com/goafanti/common/model/OrderYearMaxDuration.java
  15. 116 0
      src/main/java/com/goafanti/common/model/StandardPlatformLink.java
  16. 8 122
      src/main/java/com/goafanti/common/model/TOrderPublicReleaseCount.java
  17. 8 7
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  18. 2 0
      src/main/java/com/goafanti/customer/bo/CustomerListOut.java
  19. 10 5
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  20. 12 9
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  21. 28 0
      src/main/java/com/goafanti/expenseAccount/bo/TOrderPublicReleaseCountBo.java
  22. 1 1
      src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java
  23. 43 21
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java
  24. 42 3
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseCountsServiceImpl.java
  25. 1 1
      src/main/java/com/goafanti/order/service/OrderNewService.java
  26. 2 1
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  27. 103 61
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  28. 13 0
      src/main/java/com/goafanti/standard/bo/InputStandardList.java
  29. 45 0
      src/main/java/com/goafanti/standard/bo/InputStandardPlatformLink.java
  30. 85 0
      src/main/java/com/goafanti/standard/controller/StandardPlatformLinkController.java
  31. 48 0
      src/main/java/com/goafanti/standard/service/StandardPlatformLinkService.java
  32. 90 0
      src/main/java/com/goafanti/standard/service/impl/StandardPlatformLinkServiceImpl.java
  33. 1 0
      src/main/java/com/goafanti/standard/service/impl/StandardServiceImpl.java
  34. 18 9
      src/main/java/com/goafanti/weChat/bo/CheckOrderNoOut.java
  35. 120 61
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  36. 2 2
      src/main/resources/props/config_local.properties
  37. 1 1
      src/main/resources/props/config_test.properties

+ 2 - 2
src/main/java/com/goafanti/business/service/impl/RestrictProjectServiceImpl.java

@@ -194,12 +194,12 @@ public class RestrictProjectServiceImpl extends BaseMybatisDao<RestrictProjectMa
 //                long between = ChronoUnit.DAYS.between(now, endTime);
 //                e.setPrivateDays(between>0?(int)between:0);
                 //保持与旧版开发29-0一致,所以减去一天与私有客户同步
-                e.setPrivateDays(e.getDays()-1);
+                e.setPrivateDays(e.getDays());
             }else if (e.getType()==2){
 //                LocalDateTime endTime = lockTime.plusDays(270);
 //                long between = ChronoUnit.DAYS.between(now, endTime);
 //                e.setSignDays(between>0?(int)between:0);
-                e.setSignDays(e.getDays()-1);
+                e.setSignDays(e.getDays());
             }
         }
     }

+ 3 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -203,11 +203,14 @@ public class AFTConstants {
 
 	/** 转公共客户拜访时限 **/
 	public static final long USER_FOLLOW_LIMIT_MS					= 24*3600*1000*30L;
+	public static final long USER_FOLLOW_DAYS					= 30;
 	/** 转公公共客户签单时限 **/
 	public static final long USER_SIGN_LIMIT_MS						= 24*3600*1000*270L;
+	public static final long USER_SIGN_DAYS						=270;
 
 	/** 转公共客户拜访时限 **/
 	public static final long PROJECT_FOLLOW_LIMIT_MS					= 24*3600*1000*30L;
+	public static final long PROJECT_FOLLOW_DAYS					= 30;
 	/** 转公公共客户签单时限 **/
 	public static final long PROJECT_SIGN_LIMIT_MS						= 24*3600*1000*900L;
 

+ 0 - 193
src/main/java/com/goafanti/common/controller/TestPublicController.java

@@ -1,54 +1,12 @@
 package com.goafanti.common.controller;
 
-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.TOrderNewMapper;
-import com.goafanti.common.enums.UserType;
-import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.TOrderNew;
-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.fragment.service.FragmentService;
-import com.goafanti.order.service.OrderProjectService;
-import com.goafanti.user.service.UserService;
-import org.apache.commons.collections4.map.HashedMap;
-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.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Scope;
-import org.springframework.http.MediaType;
 import org.springframework.stereotype.Controller;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.socket.TextMessage;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.util.*;
 
 @Controller
 @RequestMapping("/open")
@@ -65,160 +23,9 @@ public class TestPublicController extends CertifyApiController {
 
     private static final Logger logger	= LoggerFactory.getLogger(TestPublicController.class);
 
-    @RequestMapping("/pushOrderList")
-    @Transactional
-    public Result pushOrder() {
-      Result res= new Result();
-        List<TOrderNew> list = tOrderNewMapper.selectgetAll();
-        for (TOrderNew t : list) {
-            if (StringUtils.isNotBlank(t.getContractPictureUrl())||
-                    StringUtils.isNotBlank(t.getAgreementUrl())||
-                    StringUtils.isNotBlank(t.getServiceContent())){
-                TOrderNew neworder=new TOrderNew();
-                neworder.setOrderNo(t.getOrderNo());
-                try {
-                    if (StringUtils.isNotBlank(t.getContractPictureUrl())){
-                        String str= null;
-                        str = moveImg(t.getContractPictureUrl(),t.getOrderNo(),0,uploadPath);
-                        neworder.setContractPictureUrl(str);
-                    }
-                    if (StringUtils.isNotBlank(t.getAgreementUrl())){
-                        String str=moveImg(t.getAgreementUrl(),t.getOrderNo(),1,uploadPath);
-                        neworder.setAgreementUrl(str);
-                    }
-                    if (StringUtils.isNotBlank(t.getServiceContent())){
-                        String str=moveImg(t.getServiceContent(),t.getOrderNo(),2,uploadPath);
-                        neworder.setServiceContent(str);
-                    }
-                } catch (Exception e) {
-                    logger.debug("订单编号["+t.getOrderNo()+"]移动异常..."+e.getLocalizedMessage());
-                    continue;
-                }
-                logger.debug("订单编号["+t.getOrderNo()+"]移动成功\n"+t.getContractPictureUrl()+"\n"+neworder.getContractPictureUrl());
-                tOrderNewMapper.updateByPrimaryKeySelective(neworder);
-            }
-        }
-        return res;
-    }
-
-    @RequestMapping(value = "/pushOrder" ,method = RequestMethod.GET)
-    public Result pushOrder(String orderNo) {
-        Result res= new Result();
-        TOrderNew t = tOrderNewMapper.selectByPrimaryKey(orderNo);
-        TOrderNew neworder=new TOrderNew();
-        neworder.setOrderNo(t.getOrderNo());
-        try {
-            if (StringUtils.isNotBlank(t.getContractPictureUrl())){
-                String str= null;
-                    str = moveImg(t.getContractPictureUrl(),t.getOrderNo(),0,uploadPath);
-                neworder.setContractPictureUrl(str);
-            }
-            if (StringUtils.isNotBlank(t.getAgreementUrl())){
-                String str=moveImg(t.getAgreementUrl(),t.getOrderNo(),1,uploadPath);
-                neworder.setAgreementUrl(str);
-            }
-            if (StringUtils.isNotBlank(t.getServiceContent())){
-                String str=moveImg(t.getServiceContent(),t.getOrderNo(),2,uploadPath);
-                neworder.setServiceContent(str);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        tOrderNewMapper.updateByPrimaryKeySelective(neworder);
-        return res;
-    }
-
-
-
-    /**
-
-     * @param i 0订单合同
-     * @param uploadPath
-     * @return
-     */
-
-    private static String moveImg(String attURL ,String orderNo,Integer i,String uploadPath) throws Exception {
-        StringBuffer str =new StringBuffer();
-        String[] split = attURL.split(",");
-        for (String s : split) {
-            String url="";
-            if (s.contains("/")){
-                url=s.substring(s.lastIndexOf("/"));
-            }else {
-                url=s.substring(s.lastIndexOf("\\"));
-            }
-            String newURL="";
-            String frontName="/new_order_file/";
-            String rearName="";
-            if (i==0){
-                rearName="/contract";
-            }else if (i==1){
-                rearName="/agreement";
-
-            }else if (i==2){
-                rearName="/content";
-            }
-            newURL=frontName+orderNo+rearName;
-            moveFile(s, newURL,uploadPath,url);
-            str.append(newURL+url).append(",");
-        }
-        return str.substring(0,str.length()-1);
-    }
-
-
 
-    /**
-     *
-     * @param useURL 旧地址
-     * @param newURL 新地址
-     */
-    private static int moveFile(String useURL, String newURL,String uploadPath,String url) throws Exception {
-        String targePath=uploadPath+newURL;
-        useURL=uploadPath+useURL;
-        String targeUrl=targePath+url;
-        //目标文件夹路径(没有会自动创建)
-        File targetFile = new File(targePath);
-        File srcFile = new File(useURL);
-        if (!srcFile.exists()){
-            throw new BusinessException("文件不存在");
-        }
-        File destFile = new File(targeUrl);
-        //创建文件件
-        createFile(targetFile);
-        //复制文件
-        copyFile(srcFile,destFile);
-        //新地址有则删除旧数据删除源文件
-        if (destFile.exists()){
-            srcFile.delete();
-        }
-        return 1;
-    }
 
-    private static void createFile(File file) {
-        if (file.exists()) {
-        } else {
-            if (!file.exists()) {
-                //创建上级目录
-                file.mkdirs();
-            }
-        }
-    }
 
-    private static void copyFile(File srcFile,File destFile) throws IOException {
-        //该方法为复制文件,srcFile是原文件所在地址,destFile是目标文件所在地址
 
-        File[] fileArray1 = srcFile.listFiles();
-        File[] fileArray2 = destFile.listFiles();
 
-        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcFile));
-        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile));
-        byte[] bys = new byte[1024];
-        int len = 0;
-        while ((len = bis.read(bys)) != -1)
-        {
-            bos.write(bys, 0, len);
-        }
-        bos.close();
-        bis.close();
-    }
 }

+ 88 - 0
src/main/java/com/goafanti/common/dao/OrderYearMaxDurationMapper.java

@@ -0,0 +1,88 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.OrderYearMaxDuration;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 订单最大公出表(OrderYearMaxDuration)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-07-04 16:41:14
+ */
+public interface OrderYearMaxDurationMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    OrderYearMaxDuration queryById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param orderYearMaxDuration 查询条件
+     * @param pageable             分页对象
+     * @return 对象列表
+     */
+    List<OrderYearMaxDuration> findOrderYearMaxDurationList(OrderYearMaxDuration orderYearMaxDuration, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param orderYearMaxDuration 查询条件
+     * @return 总行数
+     */
+    int queryAllByCount(OrderYearMaxDuration orderYearMaxDuration);
+
+    /**
+     * 新增数据
+     *
+     * @param orderYearMaxDuration 实例对象
+     * @return 影响行数
+     */
+    int insert(OrderYearMaxDuration orderYearMaxDuration);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<OrderYearMaxDuration> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<OrderYearMaxDuration> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<OrderYearMaxDuration> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<OrderYearMaxDuration> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param orderYearMaxDuration 实例对象
+     * @return 影响行数
+     */
+    int update(OrderYearMaxDuration orderYearMaxDuration);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    void updateByOrderNoAndYear(OrderYearMaxDuration orderYearMaxDuration);
+
+    List<OrderYearMaxDuration> selectByOrderNo(String orderNo);
+}
+

+ 85 - 0
src/main/java/com/goafanti/common/dao/StandardPlatformLinkMapper.java

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.StandardPlatformLink;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 标准平台连接(StandardPlatformLink)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-07-02 09:43:35
+ */
+public interface StandardPlatformLinkMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    StandardPlatformLink queryById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param standardPlatformLink 查询条件
+     * @param pageable             分页对象
+     * @return 对象列表
+     */
+    List<StandardPlatformLink> queryAllByLimit(StandardPlatformLink standardPlatformLink, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param standardPlatformLink 查询条件
+     * @return 总行数
+     */
+    Integer queryAllByCount(StandardPlatformLink standardPlatformLink);
+
+    /**
+     * 新增数据
+     *
+     * @param standardPlatformLink 实例对象
+     * @return 影响行数
+     */
+    int insert(StandardPlatformLink standardPlatformLink);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<StandardPlatformLink> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<StandardPlatformLink> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<StandardPlatformLink> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<StandardPlatformLink> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param standardPlatformLink 实例对象
+     * @return 影响行数
+     */
+    int update(StandardPlatformLink standardPlatformLink);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+}
+

+ 74 - 12
src/main/java/com/goafanti/common/dao/TOrderPublicReleaseCountMapper.java

@@ -2,28 +2,90 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.TOrderPublicReleaseCount;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+
 
 /**
-* @author Administrator
-* @description 针对表【t_order_public_release_count(订单公出信息表)】的数据库操作Mapper
-* @createDate 2024-06-17 10:18:34
-* @Entity com.goafanti.common.model.TOrderPublicReleaseCount
-*/
+ * 订单公出信息表(TOrderPublicReleaseCount)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-07-05 09:21:46
+ */
 public interface TOrderPublicReleaseCountMapper {
 
-    int deleteByPrimaryKey(Long id);
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    TOrderPublicReleaseCount queryById(Integer id);
+
 
-    int insert(TOrderPublicReleaseCount record);
+    /**
+     * 查询指定行数据
+     *
+     * @param tOrderPublicReleaseCount 查询条件
+     * @param pageable                 分页对象
+     * @return 对象列表
+     */
+    List<TOrderPublicReleaseCount> findTOrderPublicReleaseCountList(TOrderPublicReleaseCount tOrderPublicReleaseCount, @Param("pageable") Pageable pageable);
 
-    int insertSelective(TOrderPublicReleaseCount record);
+    /**
+     * 统计总行数
+     *
+     * @param tOrderPublicReleaseCount 查询条件
+     * @return 总行数
+     */
+    int findTOrderPublicReleaseCountCount(TOrderPublicReleaseCount tOrderPublicReleaseCount);
 
-    TOrderPublicReleaseCount selectByPrimaryKey(Long id);
+    /**
+     * 新增数据
+     *
+     * @param tOrderPublicReleaseCount 实例对象
+     * @return 影响行数
+     */
+    int insert(TOrderPublicReleaseCount tOrderPublicReleaseCount);
 
-    int updateByPrimaryKeySelective(TOrderPublicReleaseCount record);
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TOrderPublicReleaseCount> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<TOrderPublicReleaseCount> entities);
 
-    int updateByPrimaryKey(TOrderPublicReleaseCount record);
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TOrderPublicReleaseCount> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<TOrderPublicReleaseCount> entities);
 
-    TOrderPublicReleaseCount selectByOrderNo(@Param("orderNo") String orderNo, @Param("sumYear") String sumYear);
+    /**
+     * 修改数据
+     *
+     * @param tOrderPublicReleaseCount 实例对象
+     * @return 影响行数
+     */
+    int update(TOrderPublicReleaseCount tOrderPublicReleaseCount);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    TOrderPublicReleaseCount selectByOrderNo(@Param("orderNo") String orderNo);
 
     void updateByOrderNo(TOrderPublicReleaseCount update);
+
 }
+

+ 163 - 0
src/main/java/com/goafanti/common/mapper/OrderYearMaxDurationMapper.xml

@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.OrderYearMaxDurationMapper">
+
+    <resultMap type="com.goafanti.common.model.OrderYearMaxDuration" id="OrderYearMaxDurationMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
+        <result property="year" column="year" jdbcType="INTEGER"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="maxDuration" column="max_duration" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="OrderYearMaxDurationMap">
+        select id,
+               order_no,
+               year,
+               status,
+               max_duration,
+               create_time
+        from order_year_max_duration
+        where id = #{id}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="findOrderYearMaxDurationList" resultMap="OrderYearMaxDurationMap">
+        select
+        id, order_no, year, status, max_duration, create_time
+        from order_year_max_duration
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                and order_no = #{orderNo}
+            </if>
+            <if test="year != null">
+                and year = #{year}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="maxDuration != null">
+                and max_duration = #{maxDuration}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+        limit #{pageable.offset}, #{pageable.pageSize}
+    </select>
+
+    <!--统计总行数-->
+    <select id="queryAllByCount" resultType="java.lang.Integer">
+        select count(1)
+        from order_year_max_duration
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                and order_no = #{orderNo}
+            </if>
+            <if test="year != null">
+                and year = #{year}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="maxDuration != null">
+                and max_duration = #{maxDuration}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into order_year_max_duration(order_no, year, status, max_duration)
+        values (#{orderNo}, #{year}, #{status}, #{maxDuration})
+    </insert>
+
+    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into order_year_max_duration(order_no, year, status, max_duration)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.orderNo}, #{entity.year}, #{entity.status}, #{entity.maxDuration})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into order_year_max_duration(order_no, year, status, max_duration, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.orderNo}, #{entity.year}, #{entity.status}, #{entity.maxDuration}, #{entity.createTime})
+        </foreach>
+        on duplicate key update
+        order_no = values(order_no),
+        year = values(year),
+        status = values(status),
+        max_duration = values(max_duration),
+        create_time = values(create_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update order_year_max_duration
+        <set>
+            <if test="orderNo != null and orderNo != ''">
+                order_no = #{orderNo},
+            </if>
+            <if test="year != null">
+                year = #{year},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="maxDuration != null">
+                max_duration = #{maxDuration},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from order_year_max_duration
+        where id = #{id}
+    </delete>
+
+    <select id="selectByOrderNo"  resultMap="OrderYearMaxDurationMap">
+        select
+            id, order_no, year, status, max_duration, create_time
+        from order_year_max_duration
+        where   order_no =  #{orderNo,jdbcType=VARCHAR}
+    </select>
+
+    <update id="updateByOrderNoAndYear">
+        update order_year_max_duration
+        <set>
+            <if test="orderNo != null and orderNo != ''">
+                order_no = #{orderNo},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="maxDuration != null">
+                max_duration = #{maxDuration},
+            </if>
+        </set>
+        where order_no = #{orderNo} and year = #{year}
+    </update>
+
+</mapper>
+

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

@@ -760,8 +760,8 @@
     <select id="releaseAndExpenseCount" resultType="com.goafanti.weChat.bo.releaseAndExpenseCountOut">
         select
             a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,b.salesman_name salesmanName,b.dep_name depName,
-            toc.max_duration maxDuration ,toc.actual_duration actualDuration ,
-            toc.exceed_duration exceedDuration, a.total_amount totalAmount,a.settlement_amount settlementAmount,b.bid_type bidType,
+            toc.actual_duration actualDuration ,
+            a.total_amount totalAmount,a.settlement_amount settlementAmount,b.bid_type bidType,
             c.expenseCount,c.peopleCount,c.notExamine,c.rejectCount,d.paymentAmount,c.days,c.amount expenseAmount
         from t_order_new a left join t_order_mid b on a.order_no =b.order_no
         left join t_order_public_release_count toc on a.order_no =toc.order_no

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

@@ -171,6 +171,9 @@
         <if test="name !=null">
             and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
         </if>
+        <if test="type !=null">
+            and a.type = #{type,jdbcType=INTEGER}
+        </if>
     </sql>
 
     <select id="standardCount"  resultType="java.lang.Integer">

+ 174 - 0
src/main/java/com/goafanti/common/mapper/StandardPlatformLinkMapper.xml

@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.StandardPlatformLinkMapper">
+
+    <resultMap type="com.goafanti.common.model.StandardPlatformLink" id="StandardPlatformLinkMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="url" column="url" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="sort" column="sort" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="StandardPlatformLinkMap">
+        select id,
+               name,
+               url,
+               aid,
+               status,
+               sort,
+               create_time,
+               update_time
+        from standard_platform_link
+        where id = #{id}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="queryAllByLimit" resultMap="StandardPlatformLinkMap">
+        select
+        id, name, url, aid, status, sort, create_time, update_time
+        from standard_platform_link
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="name != null and name != ''">
+                and name like concat('%',#{name},'%')
+            </if>
+            <if test="url != null and url != ''">
+                and url = #{url}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="sort != null">
+                and sort = #{sort}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="updateTime != null">
+                and update_time = #{updateTime}
+            </if>
+            <if test="startTime != null and endTime !=null">
+                and update_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+        order by sort desc
+        <if test="page_sql!=null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="queryAllByCount" resultType="java.lang.Integer">
+        select count(1)
+        from standard_platform_link
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="name != null and name != ''">
+                and name like concat('%',#{name},'%')
+            </if>
+            <if test="url != null and url != ''">
+                and url = #{url}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="sort != null">
+                and sort = #{sort}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="updateTime != null">
+                and update_time = #{updateTime}
+            </if>
+            <if test="startTime != null and endTime !=null">
+                and update_time between #{startTime} and #{endTime}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into standard_platform_link(name, url, aid, status, sort, create_time, update_time)
+        values (#{name}, #{url}, #{aid}, #{status}, #{sort}, #{createTime}, #{updateTime})
+    </insert>
+
+    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into standard_platform_link(name, url, aid, status, sort, create_time, update_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.name}, #{entity.url}, #{entity.aid}, #{entity.status}, #{entity.sort}, #{entity.createTime},
+            #{entity.updateTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into standard_platform_link(name, url, aid, status, sort, create_time, update_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.name}, #{entity.url}, #{entity.aid}, #{entity.status}, #{entity.sort}, #{entity.createTime},
+            #{entity.updateTime})
+        </foreach>
+        on duplicate key update
+        name = values(name),
+        url = values(url),
+        aid = values(aid),
+        status = values(status),
+        sort = values(sort),
+        create_time = values(create_time),
+        update_time = values(update_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update standard_platform_link
+        <set>
+            <if test="name != null and name != ''">
+                name = #{name},
+            </if>
+            <if test="url != null and url != ''">
+                url = #{url},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="sort != null">
+                sort = #{sort},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from standard_platform_link
+        where id = #{id}
+    </delete>
+
+</mapper>
+

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

@@ -2019,7 +2019,8 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
 
 
   <select id="selectgetAll" resultType="com.goafanti.common.model.TOrderNew">
-    select order_no orderNo,contract_picture_url contractPictureUrl ,agreement_url agreementUrl ,service_content serviceContent
+    select order_no orderNo,contract_picture_url contractPictureUrl ,agreement_url agreementUrl ,service_content serviceContent,
+    total_amount totalAmount
     from t_order_new where delete_sign in (0,2) and process_status>0
   </select>
   <select id="getProcessName" resultType="com.goafanti.order.bo.OrderProcessName">
@@ -2138,8 +2139,8 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     where  b.aid = #{financeId} and a.process_status = 3 and a.order_dep= #{depId}
   </select>
     <select id="selectExpenseCount" parameterType="com.goafanti.expenseAccount.bo.ExpenseCountsInput" resultType="com.goafanti.expenseAccount.bo.ExpenseCountsBo">
-      select a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,toc.max_duration maxDuration ,toc.actual_duration actualDuration ,
-             toc.exceed_duration exceedDuration, a.total_amount totalAmount,a.settlement_amount settlementAmount,b.bid_type bidType,
+      select a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,toc.actual_duration actualDuration ,
+              a.total_amount totalAmount,a.settlement_amount settlementAmount,b.bid_type bidType,
       c.expenseCount,c.peopleCount,c.notExamine,c.rejectCount,d.paymentAmount,c.days,c.amount expenseAmount
       from t_order_new a left join t_order_mid b on a.order_no =b.order_no
       left join t_order_public_release_count toc on a.order_no =toc.order_no

+ 130 - 111
src/main/java/com/goafanti/common/mapper/TOrderPublicReleaseCountMapper.xml

@@ -1,139 +1,158 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.TOrderPublicReleaseCountMapper">
 
-    <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderPublicReleaseCount">
-            <id property="id" column="id" jdbcType="INTEGER"/>
-            <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
-            <result property="status" column="status" jdbcType="INTEGER"/>
-            <result property="maxDuration" column="max_duration" jdbcType="DOUBLE"/>
-            <result property="actualDuration" column="actual_duration" jdbcType="DOUBLE"/>
-            <result property="exceedDuration" column="exceed_duration" jdbcType="DOUBLE"/>
-            <result property="peopleCount" column="people_count" jdbcType="INTEGER"/>
-            <result property="frequency" column="frequency" jdbcType="INTEGER"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="sumYear" column="sum_year" jdbcType="VARCHAR"/>
+    <resultMap type="com.goafanti.common.model.TOrderPublicReleaseCount" id="TOrderPublicReleaseCountMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
+        <result property="actualDuration" column="actual_duration" jdbcType="NUMERIC"/>
+        <result property="peopleCount" column="people_count" jdbcType="INTEGER"/>
+        <result property="frequency" column="frequency" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
-    <sql id="Base_Column_List">
-        id,order_no,status,
-        max_duration,actual_duration,exceed_duration,
-        people_count,frequency,create_time,
-        sum_year
-    </sql>
+    <!--查询单个-->
+    <select id="queryById" resultMap="TOrderPublicReleaseCountMap">
+        select id,
+               order_no,
+               actual_duration,
+               people_count,
+               frequency,
+               create_time
+        from t_order_public_release_count
+        where id = #{id}
+    </select>
 
-    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    <!--查询指定行数据-->
+    <select id="findTOrderPublicReleaseCountList" resultMap="TOrderPublicReleaseCountMap">
         select
-        <include refid="Base_Column_List" />
+        id, order_no, actual_duration, people_count, frequency, create_time
         from t_order_public_release_count
-        where  id = #{id,jdbcType=INTEGER} 
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                and order_no = #{orderNo}
+            </if>
+            <if test="actualDuration != null">
+                and actual_duration = #{actualDuration}
+            </if>
+            <if test="peopleCount != null">
+                and people_count = #{peopleCount}
+            </if>
+            <if test="frequency != null">
+                and frequency = #{frequency}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+        limit #{pageable.offset}, #{pageable.pageSize}
     </select>
 
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-        delete from t_order_public_release_count
-        where  id = #{id,jdbcType=INTEGER} 
-    </delete>
-    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderPublicReleaseCount" useGeneratedKeys="true">
-        insert into t_order_public_release_count
-        ( id,order_no,status
-        ,max_duration,actual_duration,exceed_duration
-        ,people_count,frequency,create_time
-        ,sum_year)
-        values (#{id,jdbcType=INTEGER},#{orderNo,jdbcType=VARCHAR},#{status,jdbcType=INTEGER}
-        ,#{maxDuration,jdbcType=DOUBLE},#{actualDuration,jdbcType=DOUBLE},#{exceedDuration,jdbcType=DOUBLE}
-        ,#{peopleCount,jdbcType=INTEGER},#{frequency,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP}
-        ,#{sumYear,jdbcType=VARCHAR})
+    <!--统计总行数-->
+    <select id="findTOrderPublicReleaseCountCount" resultType="java.lang.Integer">
+        select count(1)
+        from t_order_public_release_count
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                and order_no = #{orderNo}
+            </if>
+            <if test="actualDuration != null">
+                and actual_duration = #{actualDuration}
+            </if>
+            <if test="peopleCount != null">
+                and people_count = #{peopleCount}
+            </if>
+            <if test="frequency != null">
+                and frequency = #{frequency}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into t_order_public_release_count(order_no, actual_duration, people_count, frequency)
+        values (#{orderNo}, #{actualDuration}, #{peopleCount}, #{frequency})
     </insert>
-    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderPublicReleaseCount" useGeneratedKeys="true">
-        insert into t_order_public_release_count
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-                <if test="id != null">id,</if>
-                <if test="orderNo != null">order_no,</if>
-                <if test="status != null">status,</if>
-                <if test="maxDuration != null">max_duration,</if>
-                <if test="actualDuration != null">actual_duration,</if>
-                <if test="exceedDuration != null">exceed_duration,</if>
-                <if test="peopleCount != null">people_count,</if>
-                <if test="frequency != null">frequency,</if>
-                <if test="createTime != null">create_time,</if>
-                <if test="sumYear != null">sum_year,</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-                <if test="id != null">#{id,jdbcType=INTEGER},</if>
-                <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
-                <if test="status != null">#{status,jdbcType=INTEGER},</if>
-                <if test="maxDuration != null">#{maxDuration,jdbcType=DOUBLE},</if>
-                <if test="actualDuration != null">#{actualDuration,jdbcType=DOUBLE},</if>
-                <if test="exceedDuration != null">#{exceedDuration,jdbcType=DOUBLE},</if>
-                <if test="peopleCount != null">#{peopleCount,jdbcType=INTEGER},</if>
-                <if test="frequency != null">#{frequency,jdbcType=INTEGER},</if>
-                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
-                <if test="sumYear != null">#{sumYear,jdbcType=VARCHAR},</if>
-        </trim>
+
+    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into t_order_public_release_count(order_no, actual_duration, people_count, frequency, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.orderNo}, #{entity.actualDuration}, #{entity.peopleCount}, #{entity.frequency},
+            #{entity.createTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into t_order_public_release_count(order_no, actual_duration, people_count, frequency, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.orderNo}, #{entity.actualDuration}, #{entity.peopleCount}, #{entity.frequency},
+            #{entity.createTime})
+        </foreach>
+        on duplicate key update
+        order_no = values(order_no),
+        actual_duration = values(actual_duration),
+        people_count = values(people_count),
+        frequency = values(frequency),
+        create_time = values(create_time)
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderPublicReleaseCount">
+
+    <!--通过主键修改数据-->
+    <update id="update">
         update t_order_public_release_count
         <set>
-                <if test="orderNo != null">
-                    order_no = #{orderNo,jdbcType=VARCHAR},
-                </if>
-                <if test="status != null">
-                    status = #{status,jdbcType=INTEGER},
-                </if>
-                <if test="maxDuration != null">
-                    max_duration = #{maxDuration,jdbcType=DOUBLE},
-                </if>
-                <if test="actualDuration != null">
-                    actual_duration = #{actualDuration,jdbcType=DOUBLE},
-                </if>
-                <if test="exceedDuration != null">
-                    exceed_duration = #{exceedDuration,jdbcType=DOUBLE},
-                </if>
-                <if test="peopleCount != null">
-                    people_count = #{peopleCount,jdbcType=INTEGER},
-                </if>
-                <if test="frequency != null">
-                    frequency = #{frequency,jdbcType=INTEGER},
-                </if>
-                <if test="createTime != null">
-                    create_time = #{createTime,jdbcType=TIMESTAMP},
-                </if>
-                <if test="sumYear != null">
-                    sum_year = #{sumYear,jdbcType=VARCHAR},
-                </if>
+            <if test="orderNo != null and orderNo != ''">
+                order_no = #{orderNo},
+            </if>
+            <if test="actualDuration != null">
+                actual_duration = #{actualDuration},
+            </if>
+            <if test="peopleCount != null">
+                people_count = #{peopleCount},
+            </if>
+            <if test="frequency != null">
+                frequency = #{frequency},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
         </set>
-        where   id = #{id,jdbcType=INTEGER} 
-    </update>
-    <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderPublicReleaseCount">
-        update t_order_public_release_count
-        set 
-            order_no =  #{orderNo,jdbcType=VARCHAR},
-            status =  #{status,jdbcType=INTEGER},
-            max_duration =  #{maxDuration,jdbcType=DOUBLE},
-            actual_duration =  #{actualDuration,jdbcType=DOUBLE},
-            exceed_duration =  #{exceedDuration,jdbcType=DOUBLE},
-            people_count =  #{peopleCount,jdbcType=INTEGER},
-            frequency =  #{frequency,jdbcType=INTEGER},
-            create_time =  #{createTime,jdbcType=TIMESTAMP},
-            sum_year =  #{sumYear,jdbcType=VARCHAR}
-        where   id = #{id,jdbcType=INTEGER} 
+        where id = #{id}
     </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from t_order_public_release_count
+        where id = #{id}
+    </delete>
+
+
     <update id="updateByOrderNo">
         update t_order_public_release_count
         set
             actual_duration =  #{actualDuration,jdbcType=DOUBLE},
-            exceed_duration =  if(#{actualDuration,jdbcType=DOUBLE}-max_duration>0,(#{actualDuration,jdbcType=DOUBLE}-max_duration),0),
             people_count =  #{peopleCount,jdbcType=INTEGER},
             frequency =  #{frequency,jdbcType=INTEGER}
-        where   order_no =  #{orderNo,jdbcType=VARCHAR} and sum_year= #{sumYear,jdbcType=VARCHAR}
+        where   order_no =  #{orderNo,jdbcType=VARCHAR}
     </update>
 
-    <select id="selectByOrderNo"  resultMap="BaseResultMap">
+    <select id="selectByOrderNo"  resultMap="TOrderPublicReleaseCountMap">
         select
-        <include refid="Base_Column_List" />
+            id, order_no, actual_duration, people_count, frequency, create_time
         from t_order_public_release_count
-        where  order_no =  #{orderNo,jdbcType=VARCHAR} and sum_year= #{sumYear,jdbcType=VARCHAR}
+        where  order_no =  #{orderNo,jdbcType=VARCHAR}
     </select>
+
 </mapper>
+

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

@@ -447,6 +447,7 @@
 			a.nickname as name,
 			a.create_time as createTime,
 			a.transfer_time as transferTime,
+			a.sign_bills signBills,
 			dg1.name as province,
 			dg2.name as city,
 			dg3.name as area
@@ -570,7 +571,8 @@
 		<if test="area != null">
 			and b.location_area = #{area,jdbcType=INTEGER}
 		</if>
-		order by if(a.transfer_time &gt; um.last_follow_time, a.transfer_time,um.last_follow_time) ,a.`number`
+		order by if(um.last_follow_time is null,a.transfer_time,if(a.transfer_time &gt; um.last_follow_time, a.transfer_time, um.last_follow_time)) ,
+		         a.`number`
 		 <if test="page_sql != null">
     		${page_sql}
    		 </if>

+ 100 - 0
src/main/java/com/goafanti/common/model/OrderYearMaxDuration.java

@@ -0,0 +1,100 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+ * 订单最大公出表(OrderYearMaxDuration)实体类
+ *
+ * @author makejava
+ * @since 2024-07-04 16:41:14
+ */
+public class OrderYearMaxDuration implements Serializable {
+    private static final long serialVersionUID = -31870521635051598L;
+
+    private Integer id;
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+    /**
+     * 年份
+     */
+    private Integer year;
+    /**
+     * 状态 0=限制,1=不限制
+     */
+    private Integer status;
+    /**
+     * 最大公出时间
+     */
+    private BigDecimal maxDuration;
+    /**
+     * 发起时间
+     */
+    private Date createTime;
+
+    public OrderYearMaxDuration(String orderNo, Integer year) {
+        this.orderNo = orderNo;
+        this.year = year;
+    }
+
+    public OrderYearMaxDuration() {
+    }
+
+    public OrderYearMaxDuration(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getYear() {
+        return year;
+    }
+
+    public void setYear(Integer year) {
+        this.year = year;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public BigDecimal getMaxDuration() {
+        return maxDuration;
+    }
+
+    public void setMaxDuration(BigDecimal maxDuration) {
+        this.maxDuration = maxDuration;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+}
+

+ 116 - 0
src/main/java/com/goafanti/common/model/StandardPlatformLink.java

@@ -0,0 +1,116 @@
+package com.goafanti.common.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 标准平台连接(StandardPlatformLink)实体类
+ *
+ * @author makejava
+ * @since 2024-07-02 09:43:35
+ */
+public class StandardPlatformLink implements Serializable {
+    private static final long serialVersionUID = 444345986710946358L;
+
+    private Integer id;
+    /**
+     * 标准平台名称
+     */
+    private String name;
+    /**
+     * 平台链接
+     */
+    private String url;
+    /**
+     * 负责人
+     */
+    private String aid;
+    /**
+     * 状态 0=关闭,1=开启
+     */
+    private Integer status;
+    /**
+     * 排序
+     */
+    private Integer sort;
+    /**
+     * 发起时间
+     */
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+}
+

+ 8 - 122
src/main/java/com/goafanti/common/model/TOrderPublicReleaseCount.java

@@ -3,200 +3,86 @@ package com.goafanti.common.model;
 import java.io.Serializable;
 import java.util.Date;
 
+
 /**
- * 订单公出信息表
- * @TableName t_order_public_release_count
+ * 订单公出信息表(TOrderPublicReleaseCount)实体类
+ *
+ * @author makejava
+ * @since 2024-07-05 09:21:46
  */
 public class TOrderPublicReleaseCount implements Serializable {
-    /**
-     * 
-     */
-    private Integer id;
+    private static final long serialVersionUID = 515848789423733193L;
 
+    private Integer id;
     /**
      * 订单编号
      */
     private String orderNo;
-
-    /**
-     * 状态0=无需限制,1需要限制
-     */
-    private Integer status;
-
-    /**
-     * 最大公出
-     */
-    private Double maxDuration;
-
     /**
      * 实际公出
      */
     private Double actualDuration;
-
-    /**
-     * 超出公出
-     */
-    private Double exceedDuration;
-
     /**
      * 公出人数
      */
     private Integer peopleCount;
-
     /**
      * 公出次数
      */
     private Integer frequency;
-
     /**
      * 发起时间
      */
     private Date createTime;
 
-    /**
-     * 统计年份
-     */
-    private String sumYear;
 
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 
-     */
     public Integer getId() {
         return id;
     }
 
-    /**
-     * 
-     */
     public void setId(Integer id) {
         this.id = id;
     }
 
-    /**
-     * 订单编号
-     */
     public String getOrderNo() {
         return orderNo;
     }
 
-    /**
-     * 订单编号
-     */
     public void setOrderNo(String orderNo) {
         this.orderNo = orderNo;
     }
 
-    /**
-     * 状态0=无需限制,1需要限制
-     */
-    public Integer getStatus() {
-        return status;
-    }
-
-    /**
-     * 状态0=无需限制,1需要限制
-     */
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    /**
-     * 最大公出
-     */
-    public Double getMaxDuration() {
-        return maxDuration;
-    }
-
-    /**
-     * 最大公出
-     */
-    public void setMaxDuration(Double maxDuration) {
-        this.maxDuration = maxDuration;
-    }
-
-    /**
-     * 实际公出
-     */
     public Double getActualDuration() {
         return actualDuration;
     }
 
-    /**
-     * 实际公出
-     */
     public void setActualDuration(Double actualDuration) {
         this.actualDuration = actualDuration;
     }
 
-    /**
-     * 超出公出
-     */
-    public Double getExceedDuration() {
-        return exceedDuration;
-    }
-
-    /**
-     * 超出公出
-     */
-    public void setExceedDuration(Double exceedDuration) {
-        this.exceedDuration = exceedDuration;
-    }
-
-    /**
-     * 公出人数
-     */
     public Integer getPeopleCount() {
         return peopleCount;
     }
 
-    /**
-     * 公出人数
-     */
     public void setPeopleCount(Integer peopleCount) {
         this.peopleCount = peopleCount;
     }
 
-    /**
-     * 公出次数
-     */
     public Integer getFrequency() {
         return frequency;
     }
 
-    /**
-     * 公出次数
-     */
     public void setFrequency(Integer frequency) {
         this.frequency = frequency;
     }
 
-    /**
-     * 发起时间
-     */
     public Date getCreateTime() {
         return createTime;
     }
 
-    /**
-     * 发起时间
-     */
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
 
-    /**
-     * 统计年份
-     */
-    public String getSumYear() {
-        return sumYear;
-    }
+}
 
-    /**
-     * 统计年份
-     */
-    public void setSumYear(String sumYear) {
-        this.sumYear = sumYear;
-    }
-}

+ 8 - 7
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -22,8 +22,8 @@ import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.service.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
@@ -35,8 +35,8 @@ import java.util.List;
 import java.util.UUID;
 
 
-@Component
-//@RestController
+//@Component
+@RestController
 public class ReleaseUserTask {
 	@Resource
 	private CustomerService customerService;
@@ -65,9 +65,9 @@ public class ReleaseUserTask {
 	 * 客户释放
 	 *
 	 */
-//	@Scheduled(cron = "0 22 14  * * ?")
-//	@RequestMapping("/open/test")
-	@Scheduled(cron = "0 0 1  * * ?")
+//	@Scheduled(cron = "0 23 9  * * ?")
+	@RequestMapping("/open/test")
+//	@Scheduled(cron = "0 0 1  * * ?")
 	public void startTask() {
 		try {
 			List<User> userList = userService.selectUserByRoleName("营销员", "营销经理");
@@ -238,6 +238,7 @@ public class ReleaseUserTask {
 					System.out.println(u.getId());
 					if (StringUtils.isNotBlank(u.getId())&&!AFTConstants.CAOJIN_AID.equals(u.getId())) {
 						// 获取30天释放 释放以锁定表与user_mid最后跟进取时间
+
 						List<LockingReleaseBo>  userTmpList = customerService.selectWaitReleaseCustomer(u.getId());
 						customerService.pushReleaseLog(userTmpList, 0);
 						addUserNotice(userTmpList);

+ 2 - 0
src/main/java/com/goafanti/customer/bo/CustomerListOut.java

@@ -71,6 +71,8 @@ public class CustomerListOut extends CustomerListIn{
 	/** 渠道 0否 1是 */
 	private Integer newChannel;
 
+
+
 	public Integer getNewChannel() {
 		return newChannel;
 	}

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

@@ -35,6 +35,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.reflect.InvocationTargetException;
+import java.nio.charset.StandardCharsets;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -198,16 +199,20 @@ public class AdminCustomerApiController extends BaseApiController{
 		} catch (IOException e) {
 			e.printStackTrace();
 		}
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));
+		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(), StandardCharsets.ISO_8859_1));
          response.setContentType("application/octet-stream;charset=utf-8");
 		try {
 			// 返回数据流
 			wb.write(out);
-			out.flush();
-			out.close();
+            if (out != null) {
+                out.flush();
+            	out.close();
+            }
 		} finally {
-			out.flush();
-			out.close();
+            if (out != null) {
+                out.flush();
+            	out.close();
+            }
 		}
 
 		return res;

+ 12 - 9
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -35,6 +35,9 @@ import javax.annotation.Resource;
 import java.lang.reflect.InvocationTargetException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 
 @Service
@@ -2142,9 +2145,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	 * @param power
 	 */
 	private void setCustomerList(List<CustomerListOut> tmpList, int i, Integer power) {
-		Date now = new Date();
 		Date s1, s2;
-		long l1, l2;
 		int diff1 = 0, diff2 = 0;
 		for (CustomerListOut clo : tmpList) {
             // 如果最近跟进为空直接取转换时间
@@ -2161,15 +2162,17 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
             }
             // 另外一个时间取转换时间
             s2 = clo.getTransferTime();
-            l1 = s1.getTime();
-            l2 = s2.getTime();
-            if (i == 0) {
-                diff1 = (int) ((l1 + AFTConstants.USER_FOLLOW_LIMIT_MS - now.getTime()) / (24 * 3600 * 1000));
-                diff2 = (int) ((l2 + AFTConstants.USER_SIGN_LIMIT_MS - now.getTime()) / (24 * 3600 * 1000));
+			LocalDate localDate = LocalDate.now();
+			LocalDate localDate1 = s1.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().plusDays(AFTConstants.USER_FOLLOW_DAYS);
+			LocalDate localDate2 = s2.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().plusDays(AFTConstants.USER_SIGN_DAYS);
+			if (i == 0) {
+				diff1 =  (int)ChronoUnit.DAYS.between(localDate,localDate1);
+				diff2 =  (int)ChronoUnit.DAYS.between(localDate,localDate2);
 				if (diff1 < 0)diff1 = 0;
 				if (diff2 < 0)diff2 = 0;
             } else if (i == 1) {
-                diff1 = (int) ((l1 + AFTConstants.PROJECT_FOLLOW_LIMIT_MS - now.getTime()) / (24 * 3600 * 1000));
+				localDate1 = s1.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().plusDays(AFTConstants.PROJECT_FOLLOW_DAYS);
+				diff1 =  (int)ChronoUnit.DAYS.between(localDate,localDate1);
 //                diff2 = (int) ((l2 + AFTConstants.PROJECT_SIGN_LIMIT_MS - now.getTime()) / (24 * 3600 * 1000));
 				if (diff1 < 0)diff1 = 0;
             }
@@ -2253,7 +2256,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		List<LockingReleaseBo> lockingReleaseBos = userLockReleaseMapper.selectWaitReleaseCustomer(uid);
 		for (LockingReleaseBo bo : lockingReleaseBos) {
 			// 渠道为空或者不其他的需要处理
-			if (bo.getChannelType()==null||bo.getChannelType()!=1){
+			if (bo.getNewChannel()!=1||bo.getChannelType()==null||bo.getChannelType()!=1){
 				list.add(bo);
 			}
 		}

+ 28 - 0
src/main/java/com/goafanti/expenseAccount/bo/TOrderPublicReleaseCountBo.java

@@ -0,0 +1,28 @@
+package com.goafanti.expenseAccount.bo;
+
+import com.goafanti.common.model.TOrderPublicReleaseCount;
+
+import java.math.BigDecimal;
+
+public class TOrderPublicReleaseCountBo extends TOrderPublicReleaseCount {
+
+    private BigDecimal maxDuration;
+
+    private BigDecimal exceedDuration;
+
+    public BigDecimal getMaxDuration() {
+        return maxDuration;
+    }
+
+    public void setMaxDuration(BigDecimal maxDuration) {
+        this.maxDuration = maxDuration;
+    }
+
+    public BigDecimal getExceedDuration() {
+        return exceedDuration;
+    }
+
+    public void setExceedDuration(BigDecimal exceedDuration) {
+        this.exceedDuration = exceedDuration;
+    }
+}

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

@@ -443,7 +443,7 @@ public class ExpenseAccountController extends CertifyApiController {
     @RequestMapping(value = "/pushExpenseTotalAmount",method = RequestMethod.GET)
     public Result pushExpenseTotalAmount(){
         expenseAccountService.pushExpenseTotalAmount();
-        return res().data(1);
+        return res().data(true);
     }
 
     /**

+ 43 - 21
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -86,6 +86,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     private TOrderPublicReleaseCountMapper tOrderPublicReleaseCountMapper;
     @Autowired
     private OrderNewService orderNewService;
+    @Autowired
+    private OrderYearMaxDurationMapper orderYearMaxDurationMapper;
 
 
 
@@ -472,7 +474,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 //                        orderNewService.pushOrderPublicReleaseCount("800326086952370176");
         List<TOrderNew> tOrderNews = orderNewService.selectGetAll();
         for (TOrderNew e : tOrderNews) {
-                orderNewService.pushOrderPublicReleaseCount(e.getOrderNo());
+            orderNewService.pushOrderPublicReleaseCount(e);
 
         }
     }
@@ -1428,7 +1430,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 BigDecimal yxyCount = BigDecimal.ZERO;
                 BigDecimal zxsCount = BigDecimal.ZERO;
                 BigDecimal qtCount = BigDecimal.ZERO;
-                TOrderPublicReleaseCount out = tOrderPublicReleaseCountMapper.selectByOrderNo(e.getOrderNo(), String.valueOf(year));
+                TOrderPublicReleaseCount out = tOrderPublicReleaseCountMapper.selectByOrderNo(e.getOrderNo());
                 if(!expenseAccounts.isEmpty()){
                     for (ExpenseAccount ea : expenseAccounts) {
                         count=count.add(ea.getAmount());
@@ -1444,7 +1446,28 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                         }
                     }
                 }
-                String str = getString(e, out, count, yxyCount, zxsCount,qtCount);
+                List<OrderYearMaxDuration> yearMaxDurationList = orderYearMaxDurationMapper.selectByOrderNo(e.getOrderNo());
+                OrderYearMaxDuration useOyd = null;
+                for (int i = 0; i < yearMaxDurationList.size(); i++) {
+                    OrderYearMaxDuration oyd = yearMaxDurationList.get(i);
+                    //年份为0不是会员直接获取跳出循环,否则获取当前年份,获取不到获取最后一年
+                    if (oyd.getYear()==0){
+                        useOyd=oyd;
+                        break;
+                    }else {
+                        if (oyd.getYear().equals(year)){
+                            useOyd = oyd;
+                            break;
+                        }
+                        if(i==yearMaxDurationList.size()-1&&useOyd==null){
+                            useOyd = yearMaxDurationList.get(i);
+                        }
+                    }
+
+                }
+
+
+                String str = getString(e, out, count, yxyCount, zxsCount,qtCount,useOyd);
                 e.setCountStr(str);
             }
         }
@@ -1454,37 +1477,36 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 
     }
 
-    private String getString(SonExpenseAccount e, TOrderPublicReleaseCount out, BigDecimal count, BigDecimal yxyCount, BigDecimal zxsCount, BigDecimal qtCount) {
-        if (out == null){
-            out=new TOrderPublicReleaseCount();
-            out.setMaxDuration(0d);
-            out.setExceedDuration(0d);
-            out.setActualDuration(0d);
-            out.setFrequency(0);
-            out.setPeopleCount(0);
-        }
-        String maxString=":应公出" + out.getMaxDuration() + "小时";
-        String actualString=",超过" + out.getExceedDuration() + "小时,";
-        if (out.getMaxDuration().equals(-1d)){
-            maxString=":不限制公出小时";
+    private String getString(SonExpenseAccount e, TOrderPublicReleaseCount out, BigDecimal count, BigDecimal yxyCount,
+                             BigDecimal zxsCount, BigDecimal qtCount,OrderYearMaxDuration useOyd) {
+        TOrderPublicReleaseCountBo bo = new TOrderPublicReleaseCountBo();
+        bo.setMaxDuration(useOyd.getMaxDuration());
+        bo.setExceedDuration(useOyd.getMaxDuration().subtract(BigDecimal.valueOf(out.getActualDuration())).abs());
+        bo.setActualDuration(out.getActualDuration());
+        bo.setFrequency(out.getFrequency());
+        bo.setPeopleCount(out.getPeopleCount());
+        String maxString=":应公出" + bo.getMaxDuration() +"小时["+useOyd.getYear()+"年]";
+        String actualString=",超过" + bo.getExceedDuration() + "小时,";
+        if (useOyd.getStatus()==1){
+            maxString=":不限制公出小时["+useOyd.getYear()+"年]";
             actualString="";
         }
         StringBuilder expenseString=new StringBuilder().append("报销").append(count.stripTrailingZeros().toPlainString()).append("元");
-        if (yxyCount != null || zxsCount != null||qtCount != null){
+        if (yxyCount.compareTo(BigDecimal.ZERO)>0 || zxsCount.compareTo(BigDecimal.ZERO)>0||qtCount.compareTo(BigDecimal.ZERO)>0){
             expenseString.append("(");
-            if (zxsCount != null && zxsCount.compareTo(BigDecimal.ZERO) > 0) {
+            if (zxsCount.compareTo(BigDecimal.ZERO) > 0) {
                 expenseString.append("技术").append(zxsCount.stripTrailingZeros().toPlainString()).append("元,");
             }
-            if (yxyCount != null && yxyCount.compareTo(BigDecimal.ZERO) > 0){
+            if (yxyCount.compareTo(BigDecimal.ZERO) > 0){
                 expenseString.append("营销").append(yxyCount.stripTrailingZeros().toPlainString()).append("元,");
             }
-            if (qtCount != null && qtCount.compareTo(BigDecimal.ZERO) > 0){
+            if (qtCount.compareTo(BigDecimal.ZERO) > 0){
                 expenseString.append("其他").append(qtCount.stripTrailingZeros().toPlainString()).append("元,");
             }
             expenseString.deleteCharAt(expenseString.length() - 1);
             expenseString.append(")");
         }
-        if (out.getActualDuration()<=out.getMaxDuration()){
+        if (bo.getMaxDuration().compareTo(BigDecimal.valueOf(bo.getActualDuration()))>0){
             actualString="";
         }
         return e.getBuyerName() + e.getContractNo() +

+ 42 - 3
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseCountsServiceImpl.java

@@ -1,6 +1,9 @@
 package com.goafanti.expenseAccount.service.impl;
 
+import cn.jiguang.common.utils.StringUtils;
+import com.goafanti.common.dao.OrderYearMaxDurationMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.model.OrderYearMaxDuration;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.expenseAccount.bo.ExpenseCountsBo;
 import com.goafanti.expenseAccount.bo.ExpenseCountsInput;
@@ -10,6 +13,8 @@ import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.List;
 
 @Service
@@ -17,6 +22,8 @@ public class ExpenseCountsServiceImpl implements ExpenseCountsService {
 
     @Autowired
     private TOrderNewMapper tOrderNewMapper;
+    @Autowired
+    private OrderYearMaxDurationMapper orderYearMaxDurationMapper;
     @Override
     @Cacheable(value = "getCounts#300", key = "'getCounts:key='+#in.buyerName+#in.startTime+#in.endTime+#in.depId+#in.contactNo+#in.targetType")
     public Object getCounts(ExpenseCountsInput in) {
@@ -24,9 +31,41 @@ public class ExpenseCountsServiceImpl implements ExpenseCountsService {
         if (in.getTargetType()==1){
             List<ExpenseCountsBo> expenseCountsBos = tOrderNewMapper.selectExpenseCount(in);
             expenseCountsBos.forEach(e->{
-               if (e.getMaxDuration().equals("-1")){
-                   e.setMaxDuration("不限制");
-               }
+                //获取年份
+                if (StringUtils.isNotEmpty(e.getOrderNo())){
+                    List<OrderYearMaxDuration> yearMaxDurationList = orderYearMaxDurationMapper.selectByOrderNo(e.getOrderNo());
+                    int year = LocalDate.now().getYear();
+                    OrderYearMaxDuration useOyd = null;
+                    for (int i = 0; i < yearMaxDurationList.size(); i++) {
+                        OrderYearMaxDuration oyd = yearMaxDurationList.get(i);
+                        //年份为0不是会员直接获取跳出循环,否则获取当前年份,获取不到获取最后一年
+                        if (oyd.getYear()==0){
+                            useOyd=oyd;
+                            break;
+                        }else {
+                            if (oyd.getYear().equals(year)){
+                                useOyd = oyd;
+                                break;
+                            }
+                            if(i==yearMaxDurationList.size()-1&&useOyd==null){
+                                useOyd = yearMaxDurationList.get(i);
+                            }
+                        }
+
+                    }
+                    if(useOyd.getStatus()==1){
+                        e.setMaxDuration("不限制");
+                        e.setExceedDuration("0");
+                    }else {
+                        e.setMaxDuration(useOyd.getMaxDuration().toString());
+                        if (useOyd.getMaxDuration().compareTo(new BigDecimal(e.getActualDuration()))>=0){
+                            e.setExceedDuration("0");
+                        }else {
+                            e.setExceedDuration(new BigDecimal(e.getActualDuration()).subtract(useOyd.getMaxDuration()).toString());
+                        }
+                    }
+                }
+
             });
             return expenseCountsBos;
         }else {

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

@@ -230,7 +230,7 @@ public interface OrderNewService {
 
 	void orderNewListDownload(InputOrderNewListBo in, HttpServletResponse response);
 
-	void pushOrderPublicReleaseCount(String orderNo);
+	void pushOrderPublicReleaseCount(TOrderNew e);
 
 	List<TOrderNew> selectGetAll();
 

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

@@ -988,7 +988,8 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		date.setTime(date.getTime()+500);
 		addOrderChangeLog("变更完成。", 4, nb.getOrderNo(), nb.getId(),date);
 		pushGeneralSendNoticeAndEmail(alist,NoticeStatus.ORDER_CHANGE_END.getCode(), order, TokenManager.getAdminId(),0);
-		orderNewService.pushOrderPublicReleaseCount(nb.getOrderNo());
+		TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
+		orderNewService.pushOrderPublicReleaseCount(tOrderNew);
 		//修改投标标识
 		tOrderMidMapper.updateBidTypeByOrderNo(nb.getOrderNo());
 		return 1;

+ 103 - 61
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -52,9 +52,9 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.ZoneId;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
@@ -145,9 +145,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Autowired
 	private PublicReleaseMapper publicReleaseMapper;
 	@Autowired
-	private TOrderPublicReleaseCountMapper tOrderPublicReleaseCountMapper;
+	private OrderYearMaxDurationMapper orderYearMaxDurationMapper;
 	@Autowired
 	private TOrderApprovalMapper tOrderApprovalMapper;
+	@Autowired
+	private TOrderPublicReleaseCountMapper tOrderPublicReleaseCountMapper;
 
 
 	@Value(value = "${upload.path}")
@@ -647,7 +649,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		}
 		tOrderNewMapper.updateByPrimaryKeySelective(t);
 		//计算公出统计
-		pushOrderPublicReleaseCount(t.getOrderNo());
+		pushOrderPublicReleaseCount(t2);
 		updateAdminUserCountOrder(t2.getSalesmanId(),t2.getCreateTime());
 		if (newOrderFlag){
 			updateAdminUserCountOrder(t2.getSalesmanId(),date);
@@ -707,72 +709,122 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	/**
 	 * 处理订单公出&报销之间数据统计
-	 * @param orderNo
 	 */
-	public void pushOrderPublicReleaseCount(String orderNo) {
-		//获取所有公出、订单与会员信息
-		List<PublicRelease> list = publicReleaseMapper.selectByOrderNo(orderNo);
-		TOrderNewBo t = tOrderNewMapper.getOrderNewDetail(orderNo);
-		List<TTaskMember> tTaskMembers = tTaskMemberMapper.selectByOrderNo(t.getOrderNo());
+	public void pushOrderPublicReleaseCount(TOrderNew orderNew) {
+		//获取公出信息
+		List<PublicRelease> list = publicReleaseMapper.selectByOrderNo(orderNew.getOrderNo());
 		//公出时间统计
 		BigDecimal durationCount = BigDecimal.ZERO;
 		//公出次数
 		int count=0;
-		//年数
-		int yearSum=1;
-		//公出人数
 		List<String> peopleList = new ArrayList<>();
-		LocalDate startDate = LocalDate.now().withMonth(1).withDayOfMonth(1);
-		String sumYear= String.valueOf(startDate.getYear());
-		LocalDate endDate = startDate.withYear(startDate.getYear()+1);
-		//分成会员统计和非会员统计
-		if (!tTaskMembers.isEmpty()){
-			for (PublicRelease e : list) {
-				LocalDate date = e.getReleaseStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
-				if (date.isAfter(startDate)&&date.isBefore(endDate)){
+		for (PublicRelease e : list) {
 					durationCount=durationCount.add(BigDecimal.valueOf(e.getDuration()));
 					if (!peopleList.contains(e.getAid())){
 						peopleList.add(e.getAid());
 					}
 					count++;
-				}
+		}
+		TOrderPublicReleaseCount out = null;
+		out=new TOrderPublicReleaseCount();
+		out.setOrderNo(orderNew.getOrderNo());
+		out.setActualDuration(durationCount.doubleValue());
+		out.setPeopleCount(peopleList.size());
+		out.setFrequency(count);
+		TOrderPublicReleaseCount tOrderPublicReleaseCount = tOrderPublicReleaseCountMapper.selectByOrderNo(orderNew.getOrderNo());
+		if (tOrderPublicReleaseCount!=null){
+			tOrderPublicReleaseCountMapper.updateByOrderNo(out);
+		}else {
+			tOrderPublicReleaseCountMapper.insert(out);
+		}
+		//获取会员信息
+		List<TTaskMember> tTaskMembers = tTaskMemberMapper.selectByOrderNo(orderNew.getOrderNo());
+		int yearSum=0;
+		String serviceLife = null;
+		if (tTaskMembers.isEmpty()){
+			OrderYearMaxDuration orderYearMaxDuration = new OrderYearMaxDuration();
+			orderYearMaxDuration.setYear(0);
+			BigDecimal maxDuration = pushMaxDuration(orderNew.getTotalAmount());
+			//需修改成判定
+			if (maxDuration.compareTo(new BigDecimal(-1))==0){
+				orderYearMaxDuration.setMaxDuration(BigDecimal.ZERO);
+				orderYearMaxDuration.setStatus(1);
+			}else {
+				orderYearMaxDuration.setMaxDuration(maxDuration);
+				orderYearMaxDuration.setStatus(0);
 			}
+			orderYearMaxDuration.setOrderNo(orderNew.getOrderNo());
+			orderYearMaxDurationMapper.insert(orderYearMaxDuration);
+		}else {
 			for (TTaskMember e : tTaskMembers) {
-				if(e.getYearSum()!=null&&e.getYearSum()>yearSum){
+				if (e.getYearSum()!=null&&e.getYearSum()>yearSum){
 					yearSum=e.getYearSum();
+					serviceLife=e.getServiceLife();
 				}
 			}
-		}else {
-			for (PublicRelease e : list) {
-					durationCount=durationCount.add(BigDecimal.valueOf(e.getDuration()));
-					if (!peopleList.contains(e.getAid())){
-						peopleList.add(e.getAid());
+			List<String> strings = JSON.parseArray(serviceLife, String.class);
+			List<Integer> collect = null;
+			if (strings != null) {
+				collect = strings.stream().map(this::extractYear).collect(Collectors.toList());
+				int size = collect.size();
+				BigDecimal divide = orderNew.getTotalAmount().divide(new BigDecimal(size), RoundingMode.HALF_EVEN);
+				BigDecimal maxDuration = pushMaxDuration(divide);
+				List<OrderYearMaxDuration> maxLists = new ArrayList<>();
+				int i = 1;
+				for (Integer year : collect) {
+					OrderYearMaxDuration orderYearMaxDuration = new OrderYearMaxDuration();
+					orderYearMaxDuration.setYear(year);
+					if (maxDuration.compareTo(new BigDecimal(-1))==0){
+						orderYearMaxDuration.setMaxDuration(BigDecimal.ZERO);
+						orderYearMaxDuration.setStatus(1);
+					}else {
+						orderYearMaxDuration.setMaxDuration(maxDuration.multiply(new BigDecimal(i)));
+						orderYearMaxDuration.setStatus(0);
 					}
-					count++;
-			}
-		}
-		TOrderPublicReleaseCount out = tOrderPublicReleaseCountMapper.selectByOrderNo(orderNo,sumYear);
-			if (out==null){
-				out=new TOrderPublicReleaseCount();
-				out.setOrderNo(orderNo);
-				out.setMaxDuration(0d);
-				out.setActualDuration(durationCount.doubleValue());
-				out.setPeopleCount(peopleList.size());
-				out.setFrequency(count);
-				out.setSumYear(sumYear);
-				pushMaxDuration(t,out,yearSum);
-				tOrderPublicReleaseCountMapper.insertSelective(out);
+					orderYearMaxDuration.setOrderNo(orderNew.getOrderNo());
+					i++;
+					int x = orderYearMaxDurationMapper.queryAllByCount(new OrderYearMaxDuration(orderNew.getOrderNo(), year));
+					if (x>0){
+						orderYearMaxDurationMapper.updateByOrderNoAndYear(orderYearMaxDuration);
+					}else {
+						orderYearMaxDurationMapper.insert(orderYearMaxDuration);
+					}
+				}
 			}else {
-				out.setOrderNo(orderNo);
-				out.setMaxDuration(0d);
-				out.setActualDuration(durationCount.doubleValue());
-				out.setPeopleCount(peopleList.size());
-				out.setFrequency(count);
-				pushMaxDuration(t,out,yearSum);
-				tOrderPublicReleaseCountMapper.updateByPrimaryKeySelective(out);
+				//异常单处理
+				OrderYearMaxDuration orderYearMaxDuration = new OrderYearMaxDuration();
+				orderYearMaxDuration.setYear(0);
+				orderYearMaxDuration.setOrderNo(orderNew.getOrderNo());
+				BigDecimal maxDuration = pushMaxDuration(orderNew.getTotalAmount());
+				if (maxDuration.compareTo(new BigDecimal(-1))==0){
+					orderYearMaxDuration.setMaxDuration(BigDecimal.ZERO);
+					orderYearMaxDuration.setStatus(1);
+				}else {
+					if (maxDuration.compareTo(new BigDecimal(-1))==0){
+						orderYearMaxDuration.setMaxDuration(BigDecimal.ZERO);
+						orderYearMaxDuration.setStatus(1);
+					}
+					orderYearMaxDuration.setMaxDuration(maxDuration);
+					orderYearMaxDuration.setStatus(0);
+				}
+				int x = orderYearMaxDurationMapper.queryAllByCount(new OrderYearMaxDuration(orderNew.getOrderNo(), 0));
+				if (x>0){
+					orderYearMaxDurationMapper.updateByOrderNoAndYear(orderYearMaxDuration);
+				}else {
+					orderYearMaxDurationMapper.insert(orderYearMaxDuration);
+				}
 			}
+		}
 
+	}
 
+	private  Integer extractYear(String yearStr) {
+		Pattern pattern = Pattern.compile("(\\d{4})");
+		Matcher matcher = pattern.matcher(yearStr);
+		if (matcher.find()) {
+			return Integer.parseInt(matcher.group(1));
+		}
+		throw new BusinessException("年份提取失败");
 	}
 
 	@Override
@@ -825,17 +877,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	/**
 	 * 处理订单公出&报销最大公出
-	 * @param t
-	 * @param out
-	 * @param yearSum
 	 */
-	private void pushMaxDuration(TOrderNewBo t,TOrderPublicReleaseCount out ,int yearSum) {
+	private BigDecimal pushMaxDuration(BigDecimal totalAmount) {
 		BigDecimal res=BigDecimal.ZERO;
-		BigDecimal totalAmount=t.getTotalAmount();
-		if (yearSum>1){
-			totalAmount=totalAmount.divide(BigDecimal.valueOf(yearSum),2, RoundingMode.HALF_UP);
-		}
-
 		int status=1;
 		if (totalAmount.compareTo(BigDecimal.valueOf(1)) < 0) {
 			res=BigDecimal.ZERO;
@@ -850,10 +894,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 		} else if (totalAmount.compareTo(BigDecimal.valueOf(10))>=0) {
 			res=BigDecimal.valueOf(-1);
-			status=0;
 		}
-		out.setMaxDuration(res.doubleValue());
-		out.setStatus(status);
+		return res;
 	}
 
 

+ 13 - 0
src/main/java/com/goafanti/standard/bo/InputStandardList.java

@@ -30,6 +30,19 @@ public class InputStandardList {
      */
     private String endTime;
 
+    /**
+     * 0=国家标准,1=行业标准,2=地方标准,3=团体标准,4=国际标准,5=企业标准
+     */
+    private Integer type;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public String getName() {
         return name;
     }

+ 45 - 0
src/main/java/com/goafanti/standard/bo/InputStandardPlatformLink.java

@@ -0,0 +1,45 @@
+package com.goafanti.standard.bo;
+
+import com.goafanti.common.model.StandardPlatformLink;
+
+public class InputStandardPlatformLink extends StandardPlatformLink {
+
+    private String startTime;
+    private String endTime;
+
+    private Integer pageNo;
+    private Integer pageSize;
+
+    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 getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+}

+ 85 - 0
src/main/java/com/goafanti/standard/controller/StandardPlatformLinkController.java

@@ -0,0 +1,85 @@
+package com.goafanti.standard.controller;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.model.StandardPlatformLink;
+import com.goafanti.standard.bo.InputStandardPlatformLink;
+import com.goafanti.standard.service.StandardPlatformLinkService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * 标准平台连接(StandardPlatformLink)表控制层
+ *
+ * @author makejava
+ * @since 2024-07-02 09:43:35
+ */
+@RestController
+@RequestMapping("/api/admin/standardPlatformLink")
+public class StandardPlatformLinkController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private StandardPlatformLinkService standardPlatformLinkService;
+
+
+    /**
+     * 列表查询
+     * @param in 参数
+     * @return
+     */
+    @GetMapping("/list")
+    public Result<StandardPlatformLink> list(InputStandardPlatformLink in ) {
+        return new Result<>().data(this.standardPlatformLinkService.list(in));
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/get")
+    public Result<StandardPlatformLink> queryById(Integer id) {
+        return new Result<>().data(this.standardPlatformLinkService.queryById(id));
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param standardPlatformLink 实体
+     * @return 新增结果
+     */
+    @PostMapping("/add")
+    public Result add(StandardPlatformLink standardPlatformLink) {
+        return new Result<>().data(this.standardPlatformLinkService.insert(standardPlatformLink));
+    }
+
+    /**
+     * 编辑数据
+     *
+     * @param standardPlatformLink 实体
+     * @return 编辑结果
+     */
+    @PostMapping("/update")
+    public Result edit(StandardPlatformLink standardPlatformLink) {
+        return new Result<>().data(this.standardPlatformLinkService.update(standardPlatformLink));
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除是否成功
+     */
+    @GetMapping("/delete")
+    public Result deleteById(Integer id) {
+        return new Result<>().data(this.standardPlatformLinkService.deleteById(id));
+    }
+
+}
+

+ 48 - 0
src/main/java/com/goafanti/standard/service/StandardPlatformLinkService.java

@@ -0,0 +1,48 @@
+package com.goafanti.standard.service;
+
+import com.goafanti.common.model.StandardPlatformLink;
+import com.goafanti.standard.bo.InputStandardPlatformLink;
+
+/**
+ * 标准平台连接(StandardPlatformLink)表服务接口
+ *
+ * @author makejava
+ * @since 2024-07-02 09:43:35
+ */
+public interface StandardPlatformLinkService {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    StandardPlatformLink queryById(Integer id);
+
+
+    /**
+     * 新增数据
+     *
+     * @param standardPlatformLink 实例对象
+     * @return 实例对象
+     */
+    StandardPlatformLink insert(StandardPlatformLink standardPlatformLink);
+
+    /**
+     * 修改数据
+     *
+     * @param standardPlatformLink 实例对象
+     * @return 实例对象
+     */
+    StandardPlatformLink update(StandardPlatformLink standardPlatformLink);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    boolean deleteById(Integer id);
+
+    Object list(InputStandardPlatformLink in);
+}

+ 90 - 0
src/main/java/com/goafanti/standard/service/impl/StandardPlatformLinkServiceImpl.java

@@ -0,0 +1,90 @@
+package com.goafanti.standard.service.impl;
+
+import com.goafanti.common.dao.StandardPlatformLinkMapper;
+import com.goafanti.common.model.StandardPlatformLink;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.standard.bo.InputStandardPlatformLink;
+import com.goafanti.standard.service.StandardPlatformLinkService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 标准平台连接(StandardPlatformLink)表服务实现类
+ *
+ * @author makejava
+ * @since 2024-07-02 09:43:35
+ */
+@Service("standardPlatformLinkService")
+public class StandardPlatformLinkServiceImpl extends BaseMybatisDao<StandardPlatformLinkMapper> implements StandardPlatformLinkService {
+    @Resource
+    private StandardPlatformLinkMapper standardPlatformLinkMapper;
+
+
+    public Pagination<StandardPlatformLink> list(InputStandardPlatformLink in) {
+        Map<String, Object> params = new HashMap<>();
+        if (in.getName() != null)params.put("name", in.getName());
+        if (in.getStatus() != null)params.put("status", in.getStatus());
+        if (in.getStartTime()!= null)params.put("startTime", in.getStartTime());
+        if (in.getEndTime()!= null)params.put("endTime", in.getEndTime()+" 23:59:59");
+        return (Pagination<StandardPlatformLink>) findPage("queryAllByLimit",
+                "queryAllByCount", params, in.getPageNo(), in.getPageSize());
+    }
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @Override
+    public StandardPlatformLink queryById(Integer id) {
+        return this.standardPlatformLinkMapper.queryById(id);
+    }
+
+
+    /**
+     * 新增数据
+     *
+     * @param in 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public StandardPlatformLink insert(StandardPlatformLink in) {
+        in.setAid(TokenManager.getAdminId());
+        Date now = new Date();
+        in.setCreateTime(now);
+        in.setUpdateTime(now);
+        this.standardPlatformLinkMapper.insert(in);
+        return in;
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param standardPlatformLink 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public StandardPlatformLink update(StandardPlatformLink standardPlatformLink) {
+        standardPlatformLink.setUpdateTime(new Date());
+        this.standardPlatformLinkMapper.update(standardPlatformLink);
+        return this.queryById(standardPlatformLink.getId());
+    }
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    @Override
+    public boolean deleteById(Integer id) {
+        return this.standardPlatformLinkMapper.deleteById(id) > 0;
+    }
+}

+ 1 - 0
src/main/java/com/goafanti/standard/service/impl/StandardServiceImpl.java

@@ -97,6 +97,7 @@ public class StandardServiceImpl extends BaseMybatisDao<StandardDocumentMapper>
         if (in.getEndTime()!=null)params.put("endTime",in.getEndTime()+" 23:59:59");
         if (in.getDepId()!=null)params.put("depId",in.getDepId());
         if (in.getName()!=null)params.put("name",in.getName());
+        if (in.getType()!=null)params.put("type",in.getType());
         return (Pagination<OutStandardDocument>) findPage("standardList","standardCount",params,in.getPageNo(),in.getPageSize());
     }
 

+ 18 - 9
src/main/java/com/goafanti/weChat/bo/CheckOrderNoOut.java

@@ -11,7 +11,9 @@ public class CheckOrderNoOut {
         private BigDecimal durationCount;
         private BigDecimal durationMax;
 
-        private Integer amountType;
+        private String amountName;
+
+        private String amountType;
 
     /**
      * 审核人
@@ -23,6 +25,17 @@ public class CheckOrderNoOut {
      */
     private String publicReleaseName;
 
+    public String getAmountName() {
+        return amountName;
+    }
+
+    public void setAmountName(String amountName) {
+        this.amountName = amountName;
+    }
+
+    public void setAmountType(String amountType) {
+        this.amountType = amountType;
+    }
 
     public String getPublicReleaseName() {
         return publicReleaseName;
@@ -80,15 +93,11 @@ public class CheckOrderNoOut {
             this.durationCount = durationCount;
         }
 
-        public Integer getAmountType() {
-            return amountType;
-        }
-
-        public void setAmountType(Integer amountType) {
-            this.amountType = amountType;
-        }
+    public String getAmountType() {
+        return amountType;
+    }
 
-        public String getAdminName() {
+    public String getAdminName() {
             return adminName;
         }
 

+ 120 - 61
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -19,6 +19,7 @@ import com.goafanti.core.websocket.SystemWebSocketHandler;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.order.bo.TOrderNewBo;
+import com.goafanti.order.service.OrderNewService;
 import com.goafanti.weChat.bo.*;
 import com.goafanti.weChat.service.PublicReleaseService;
 import org.springframework.beans.BeanUtils;
@@ -32,7 +33,6 @@ import org.springframework.web.socket.TextMessage;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.time.LocalDate;
-import java.time.ZoneId;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
@@ -76,6 +76,12 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 	@Autowired
 	private RestrictProjectMapper restrictProjectMapper;
+	@Autowired
+	private OrderYearMaxDurationMapper orderYearMaxDurationMapper;
+	@Autowired
+	private TTaskMemberMapper tTaskMemberMapper;
+	@Autowired
+	private OrderNewService orderNewService;
 
 	@Override
 	@Transactional
@@ -103,7 +109,12 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				in.setTechStartProcess(1);
 			}
 		}
+
 		publicReleaseMapper.insertSelective(in);
+		if (in.getOrderNo()!=null){
+			TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(in.getOrderNo());
+			orderNewService.pushOrderPublicReleaseCount(tOrderNew);
+		}
 		List<PublicReleaseDetails> prdList=new ArrayList<>();
 		List<User> users=new ArrayList<>();
 		StringBuilder str =new StringBuilder();
@@ -279,7 +290,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			Admin a = adminMapper.selectByPrimaryKey(salesmanId);
 			addPublicExamine(in.getId(),a);
 			CheckOrderNoOut data = (CheckOrderNoOut) checkOrderNo.get("data");
-			String format = getString(my, data);
+			String format = getString(my, data,tOrderNew);
 			pushNoticeAndSoucketAndEmail(my, in, date, a, format, map);
 		}
 		map.put("data", publicReleaseMapper.selectDtails(in.getId()));
@@ -293,24 +304,11 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		sendNoticeAndSoucket(u.getAid(),3,str2.toString());
 	}
 
-	private String getString(AdminListBo my, CheckOrderNoOut data) {
-		String amountName="";
-		String amountType="";
-		if (data.getAmountType()==0){
-			amountName="低于1万";
-			amountType="原则上技术人员不可下户";
-		}else if (data.getAmountType()==1){
-			amountName="在1~3万";
-			amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
-		}else if (data.getAmountType()==2){
-			amountName="在3~5万";
-			amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
-		}else if (data.getAmountType()==3){
-			amountName="在5~10万";
-			amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
-		}
+	private String getString(AdminListBo my, CheckOrderNoOut data,TOrderNew tOrderNew) {
+		String amountName=data.getAmountName();
+		String amountType=data.getAmountType();
 		String format = String.format("%s准备公出%s(%s)," +
-						"总计公出:%s人,%s次,%s时。本合同%s,本次申请,%s。请确认是否同意本次公出?", my.getName(), data.getUserName(), data.getContractNo(),
+						"总计公出:%s人,%s次,%s时。%s,本次申请,%s。请确认是否同意本次公出?", my.getName(), data.getUserName(), data.getContractNo(),
 				data.getPeopleCount(), data.getTimesCount(), data.getDurationCount().stripTrailingZeros().toPlainString(), amountName,
 				amountType);
 		return format;
@@ -435,8 +433,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				List<String> split = Arrays.asList(in.getUids().split(","));
 				List<OutPublicReleaseDetails> prList = publicReleaseDetailsMapper.selectByPrid(in.getId());
 				uses=pushPublicReleaseDetails(split,prList,use,in);
-
-
 			}
 			in.setStatus(1);
 			log.setStatus(PublicReleaseLog.states.xg.getCode());
@@ -481,7 +477,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		addPublicReleaseDateClock(in);
 		publicReleaseLogMapper.insertSelective(log);
 		publicReleaseMapper.updateByPrimaryKeySelective(in);
-
+		if (in.getOrderNo()!=null){
+			TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(in.getOrderNo());
+			orderNewService.pushOrderPublicReleaseCount(tOrderNew);
+		}
 		return 1;
 	}
 
@@ -1842,12 +1841,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			actualDuration=actualDuration.add(BigDecimal.valueOf(in.getDuration()));
 			frequency++;
 		}
-		LocalDate startDate = LocalDate.now().withMonth(1).withDayOfMonth(1);
-		String sumYear= String.valueOf(startDate.getYear());
-		LocalDate endDate = startDate.withYear(startDate.getYear()+1);
+
 		for (PublicRelease e : list) {
-			LocalDate date = e.getReleaseStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
-			if (date.isAfter(startDate)&&date.isBefore(endDate)){
 				//新增直接计算
 				if (in.getId()==null){
 					if (e.getDuration()!=null){
@@ -1877,7 +1872,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 						}
 					}
 				}
-			}
 		}
 		Map map=new HashMap();
 		CheckOrderNoOut data= new CheckOrderNoOut();
@@ -1891,7 +1885,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			update.setFrequency(frequency);
 			update.setActualDuration(actualDuration.doubleValue());
 			update.setPeopleCount(peopleList.size());
-			update.setSumYear(sumYear);
 			tOrderPublicReleaseCountMapper.updateByOrderNo(update);
 		}
 		data.setTimesCount(frequency);
@@ -1900,35 +1893,75 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		data.setContractNo(t.getContractNo());
 		data.setAdminName(t.getSalesmanName());
 		data.setDurationCount(actualDuration);
-		// 0=0-1 1=1-3 2=3-5 3=5-10 4=10以上
-		if (t.getTotalAmount().compareTo(BigDecimal.valueOf(1)) < 0) {
-			data.setAmountType(0);
-			data.setDurationMax(BigDecimal.ZERO);
-			map.put("code",false);
-			map.put("data",data);
-		} else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(3))<0) {
-			data.setAmountType(1);
-			data.setDurationMax(BigDecimal.valueOf(15));
-			if (actualDuration.compareTo(data.getDurationMax())<1){
-				map.put("code",true);
-				map.put("data",null);
+		//获取年份
+		List<OrderYearMaxDuration> yearMaxDurationList = orderYearMaxDurationMapper.selectByOrderNo(in.getOrderNo());
+		int year = LocalDate.now().getYear();
+		OrderYearMaxDuration useOyd = null;
+		for (int i = 0; i < yearMaxDurationList.size(); i++) {
+			OrderYearMaxDuration oyd = yearMaxDurationList.get(i);
+			//年份为0不是会员直接获取跳出循环,否则获取当前年份,获取不到获取最后一年
+			if (oyd.getYear()==0){
+				useOyd=oyd;
+				break;
 			}else {
-				map.put("code",false);
-				map.put("data",data);
+				if (oyd.getYear().equals(year)){
+					useOyd = oyd;
+					break;
+				}
+				if(i==yearMaxDurationList.size()-1&&useOyd==null){
+					useOyd = yearMaxDurationList.get(i);
+				}
 			}
-		} else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(5))<0) {
-			data.setAmountType(2);
-			data.setDurationMax(BigDecimal.valueOf(45));
-			if (actualDuration.compareTo(data.getDurationMax())<1){
-				map.put("code",true);
-				map.put("data",null);
-			}else {
-				map.put("code",false);
-				map.put("data",data);
+
+		}
+		data.setDurationMax(useOyd.getMaxDuration());
+		TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(in.getOrderNo());
+		List<TTaskMember> tTaskMembers = tTaskMemberMapper.selectByOrderNo(tOrderNew.getOrderNo());
+		String amountName=null;
+		String amountType=null;
+		if (tTaskMembers.size()<1){
+			if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(1))<0){
+				amountName="本合同低于1万";
+				amountType="原则上技术人员不可下户";
+			}else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(3))<0){
+				amountName="本合同在1~3万";
+				amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
+			}else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(5))<0){
+				amountName="本合同在3~5万";
+				amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
+			}else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(10))<0){
+				amountName="本合同在5~10万";
+				amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
+			}
+		}else {
+			int yearSum=0;
+			for (TTaskMember tTaskMember : tTaskMembers) {
+				if (tTaskMember.getYearSum()!=null&&tTaskMember.getYearSum()>yearSum){
+					yearSum=tTaskMember.getYearSum();
+				}
 			}
-		} else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(10))<0) {
-			data.setAmountType(3);
-			data.setDurationMax(BigDecimal.valueOf(120));
+			BigDecimal divide = tOrderNew.getTotalAmount().divide(BigDecimal.valueOf(yearSum),  BigDecimal.ROUND_HALF_UP);
+			if (divide.compareTo(BigDecimal.valueOf(1))<0){
+				amountName="此会员订单,本年度金额低于1万";
+				amountType="原则上技术人员不可下户";
+			}else if (divide.compareTo(BigDecimal.valueOf(3))<0){
+				amountName="此会员订单,本年度金额1~3万";
+				amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
+			}else if (divide.compareTo(BigDecimal.valueOf(5))<0){
+				amountName="此会员订单,本年度金额3~5万";
+				amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
+			}else if (divide.compareTo(BigDecimal.valueOf(10))<0){
+				amountName="此会员订单,本年度金额5~10万";
+				amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
+			}
+		}
+		data.setAmountName(amountName);
+		data.setAmountType(amountType);
+		if(useOyd.getStatus()==1){
+			map.put("code",true);
+			map.put("data",null);
+		}else {
+
 			if (actualDuration.compareTo(data.getDurationMax())<1){
 				map.put("code",true);
 				map.put("data",null);
@@ -1936,11 +1969,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				map.put("code",false);
 				map.put("data",data);
 			}
-		} else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(10))>=0) {
-			data.setAmountType(4);
-			map.put("code",true);
-			map.put("data",null);
 		}
+
 		return map;
 
 
@@ -2029,9 +2059,38 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					e.setExceedType(1);
 				}
 			}
-			if (e.getMaxDuration()!=null){
-				if(e.getMaxDuration().equals("-1")){
+			//获取年份
+			if (StringUtils.isNotEmpty(e.getOrderNo())){
+				List<OrderYearMaxDuration> yearMaxDurationList = orderYearMaxDurationMapper.selectByOrderNo(e.getOrderNo());
+				int year = LocalDate.now().getYear();
+				OrderYearMaxDuration useOyd = null;
+				for (int i = 0; i < yearMaxDurationList.size(); i++) {
+					OrderYearMaxDuration oyd = yearMaxDurationList.get(i);
+					//年份为0不是会员直接获取跳出循环,否则获取当前年份,获取不到获取最后一年
+					if (oyd.getYear()==0){
+						useOyd=oyd;
+						break;
+					}else {
+						if (oyd.getYear().equals(year)){
+							useOyd = oyd;
+							break;
+						}
+						if(i==yearMaxDurationList.size()-1&&useOyd==null){
+							useOyd = yearMaxDurationList.get(i);
+						}
+					}
+
+				}
+				if(useOyd.getStatus()==1){
 					e.setMaxDuration("不限制");
+					e.setExceedDuration("0");
+				}else {
+					e.setMaxDuration(useOyd.getMaxDuration().toString());
+					if (useOyd.getMaxDuration().compareTo(new BigDecimal(e.getActualDuration()))>=0){
+						e.setExceedDuration("0");
+					}else {
+						e.setExceedDuration(new BigDecimal(e.getActualDuration()).subtract(useOyd.getMaxDuration()).toString());
+					}
 				}
 			}
 		});

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

@@ -1,8 +1,8 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 
-static.host=//static.jishutao.com/1.3.18
-#static.host=//172.16.1.187/1.3.18
+static.host=//static.jishutao.com/1.3.19
+#static.host=//172.16.1.187/1.3.19
 
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20240430?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false

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

@@ -1,5 +1,5 @@
 dev.name=test
-static.host=//static.jishutao.com/1.3.18
+static.host=//static.jishutao.com/1.3.19
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 jdbc.url=jdbc:mysql://127.0.0.1:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false