Browse Source

Merge branch 'test' into prod

anderx 5 months ago
parent
commit
7ed288a92b

+ 9 - 0
README.md

@@ -1 +1,10 @@
 #AFT
+科德业务管理系统
+</br>
+tomcat:
+</br>
+-Dprofiles.activation="local" -Djdbc.worker.id="1001"
+</br>
+打包:
+</br>
+mvn clean install -P aft_test

+ 1 - 118
kede-server.iml

@@ -1,125 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+<module version="4">
   <component name="FacetManager">
-    <facet type="web" name="Web">
-      <configuration>
-        <descriptors>
-          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
-        </descriptors>
-        <webroots>
-          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
-          <root url="file://$MODULE_DIR$/src/main/resources" relative="WEB-INF/classes" />
-        </webroots>
-        <sourceRoots>
-          <root url="file://$MODULE_DIR$/src/main/java" />
-          <root url="file://$MODULE_DIR$/src/main/resources" />
-        </sourceRoots>
-      </configuration>
-    </facet>
     <facet type="Spring" name="Spring">
       <configuration />
     </facet>
   </component>
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
-    <output url="file://$MODULE_DIR$/target/classes" />
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
-      <excludeFolder url="file://$MODULE_DIR$/target" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-websocket:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:1.8.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:1.2.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.13.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.3.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring4:3.0.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.3.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.4.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:2.2.1" level="project" />
-    <orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.4.6" level="project" />
-    <orderEntry type="library" name="Maven: nz.net.ultraq.thymeleaf:thymeleaf-expression-processor:1.1.2" level="project" />
-    <orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:2.0.0" level="project" />
-    <orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.2.8" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.2.2" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.2" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.2" level="project" />
-    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.40" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.21" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.21" level="project" />
-    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
-    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
-    <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.1" level="project" />
-    <orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" />
-    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:1.8.5" level="project" />
-    <orderEntry type="library" name="Maven: javax.transaction:jta:1.1" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.3.2" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.3.2" level="project" />
-    <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-quartz:1.3.2" level="project" />
-    <orderEntry type="library" name="Maven: org.opensymphony.quartz:quartz:1.6.1" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.3.2" level="project" />
-    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
-    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
-    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.2.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.31" level="project" />
-    <orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.6.10" level="project" />
-    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.6.10" level="project" />
-    <orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.2.4.Final" level="project" />
-    <orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
-    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.2.1.Final" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.1.0" level="project" />
-    <orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
-    <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
-    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
-    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-dysmsapi:1.0.0" level="project" />
-    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:3.5.0" level="project" />
-    <orderEntry type="library" name="Maven: org.json:json:20170516" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.3" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.6" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
-    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
-    <orderEntry type="library" name="Maven: cn.jpush.api:jiguang-common:1.0.8" level="project" />
-    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.3.1" level="project" />
-    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.8.0" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-all:4.1.6.Final" level="project" />
-    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.3" level="project" />
-    <orderEntry type="library" name="Maven: javax.mail:mail:1.4.7" level="project" />
-    <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
-    <orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" />
-    <orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
-    <orderEntry type="library" name="Maven: org.ehcache:ehcache:3.4.0" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.7" level="project" />
-  </component>
 </module>

+ 4 - 4
pom.xml

@@ -413,11 +413,11 @@
 			<artifactId>mybatis-generator-core</artifactId>
 			<version>1.3.7</version>
 		</dependency>
+		<!-- pdf文档操作 -->
 		<dependency>
-			<groupId>ch.codeblock.qrinvoice.pdfbox</groupId>
-			<artifactId>qrinvoice-pdfbox</artifactId>
-			<version>1.9</version>
-			<type>pom</type>
+			<groupId>org.apache.pdfbox</groupId>
+			<artifactId>pdfbox</artifactId>
+			<version>2.0.19</version>
 		</dependency>
 		<!--word文档操作-->
 		<dependency>

+ 9 - 3
src/main/java/com/goafanti/admin/service/impl/AdminStatisticsServiceImpl.java

@@ -55,9 +55,15 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
         }else {
             //从客户中计算再添加到adminStatisticsBo
             AdminStatisticsBo ListCount = adminMapper.selectUserCount(aid, null, null);
-            adminStatisticsBo.setPrivateSum(ListCount.getPrivateSum());
-            adminStatisticsBo.setSignSum(ListCount.getSignSum());
-            adminStatisticsBo.setChannelSum(ListCount.getChannelSum());
+            if (ListCount==null){
+                adminStatisticsBo.setPrivateSum(0);
+                adminStatisticsBo.setSignSum(0);
+                adminStatisticsBo.setChannelSum(0);
+            }else {
+                adminStatisticsBo.setPrivateSum(ListCount.getPrivateSum());
+                adminStatisticsBo.setSignSum(ListCount.getSignSum());
+                adminStatisticsBo.setChannelSum(ListCount.getChannelSum());
+            }
             //计算公出次数
             Integer publicSum = publicReleaseMapper.selectCountByaidAndDate(aid, null, null);
             adminStatisticsBo.setPublicReleaseSum(publicSum);

+ 76 - 11
src/main/java/com/goafanti/common/dao/PublicReleaseClockMapper.java

@@ -1,28 +1,93 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PublicReleaseClock;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 /**
-* @author Administrator
-* @description 针对表【public_release_clock(公出打卡表)】的数据库操作Mapper
-* @createDate 2024-04-19 14:56:48
-* @Entity com.goafanti.common.model.PublicReleaseClock
-*/
+ * 公出打卡表(PublicReleaseClock)表数据库访问层
+ *
+ * @author makejava
+ * @since 2025-08-27 11:44:45
+ */
 public interface PublicReleaseClockMapper {
 
-    int deleteByPrimaryKey(Integer id);
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    PublicReleaseClock selectById(Integer id);
 
-    int insert(PublicReleaseClock record);
 
-    int insertSelective(PublicReleaseClock record);
+    /**
+     * 查询指定行数据
+     *
+     * @param publicReleaseClock 查询条件
+     * @param pageable           分页对象
+     * @return 对象列表
+     */
+    List<PublicReleaseClock> findPublicReleaseClockList(PublicReleaseClock publicReleaseClock);
+
+    /**
+     * 统计总行数
+     *
+     * @param publicReleaseClock 查询条件
+     * @return 总行数
+     */
+    int findPublicReleaseClockCount(PublicReleaseClock publicReleaseClock);
+
+    /**
+     * 新增数据
+     *
+     * @param publicReleaseClock 实例对象
+     * @return 影响行数
+     */
+    int insert(PublicReleaseClock publicReleaseClock);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<PublicReleaseClock> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<PublicReleaseClock> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<PublicReleaseClock> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<PublicReleaseClock> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param publicReleaseClock 实例对象
+     * @return 影响行数
+     */
+    int update(PublicReleaseClock publicReleaseClock);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
 
-    PublicReleaseClock selectByPrimaryKey(Integer id);
 
-    int updateByPrimaryKeySelective(PublicReleaseClock record);
 
-    int updateByPrimaryKey(PublicReleaseClock record);
+
+
+    int insertSelective(PublicReleaseClock record);
+
 
     List<PublicReleaseClock> selectList(List<Integer> list);
+
 }
+

+ 4 - 3
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -8,7 +8,6 @@ import com.goafanti.common.model.PublicReleaseDetails;
 import com.goafanti.customer.bo.MyUserDetailsBo;
 import com.goafanti.weChat.bo.*;
 import org.apache.ibatis.annotations.Param;
-import org.springframework.data.domain.Pageable;
 
 import java.time.LocalDate;
 import java.util.Date;
@@ -18,7 +17,7 @@ import java.util.List;
  * 公出表(PublicRelease)表数据库访问层
  *
  * @author makejava
- * @since 2024-08-07 09:49:48
+ * @since 2025-09-02 11:22:46
  */
 public interface PublicReleaseMapper {
 
@@ -38,7 +37,7 @@ public interface PublicReleaseMapper {
      * @param pageable      分页对象
      * @return 对象列表
      */
-    List<PublicRelease> findPublicReleaseList(PublicRelease publicRelease, @Param("pageable") Pageable pageable);
+    List<PublicRelease> findPublicReleaseList(PublicRelease publicRelease);
 
     /**
      * 统计总行数
@@ -55,6 +54,7 @@ public interface PublicReleaseMapper {
      * @return 影响行数
      */
     int insert(PublicRelease publicRelease);
+
     int insertSelective(PublicRelease publicRelease);
 
     /**
@@ -89,6 +89,7 @@ public interface PublicReleaseMapper {
      * @return 影响行数
      */
     int deleteById(Integer id);
+
     int deleteByMainId(Integer id);
 
     OutPublicRelease selectDtails(@Param("id") Integer id);

+ 186 - 70
src/main/java/com/goafanti/common/mapper/PublicReleaseClockMapper.xml

@@ -1,102 +1,218 @@
 <?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.PublicReleaseClockMapper">
 
-    <resultMap id="BaseResultMap" type="com.goafanti.common.model.PublicReleaseClock">
-            <id property="id" column="id" jdbcType="INTEGER"/>
-            <result property="prid" column="prid" jdbcType="INTEGER"/>
-            <result property="prdid" column="prdid" jdbcType="INTEGER"/>
-            <result property="photoUrl" column="photo_url" jdbcType="VARCHAR"/>
-            <result property="clockInTime" column="clock_in_time" jdbcType="TIMESTAMP"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    <resultMap type="com.goafanti.common.model.PublicReleaseClock" id="PublicReleaseClockMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="prid" column="prid" jdbcType="INTEGER"/>
+        <result property="prdid" column="prdid" jdbcType="INTEGER"/>
+        <result property="photoUrl" column="photo_url" jdbcType="VARCHAR"/>
+        <result property="clockInTime" column="clock_in_time" jdbcType="TIMESTAMP"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="longitude" column="longitude" jdbcType="VARCHAR"/>
+        <result property="latitude" column="latitude" jdbcType="VARCHAR"/>
+        <result property="districtName" column="district_name" jdbcType="VARCHAR"/>
     </resultMap>
 
-    <sql id="Base_Column_List">
-        id,prid,prdid,
-        photo_url,clock_in_time,create_time
+    <sql id="PublicReleaseClockAllSql">
+        id, prid, prdid, photo_url, clock_in_time, create_time, longitude, latitude, district_name
     </sql>
 
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--查询单个-->
+    <select id="selectById" resultMap="PublicReleaseClockMap">
         select
-        <include refid="Base_Column_List" />
+        <include refid="PublicReleaseClockAllSql"/>
         from public_release_clock
-        where  id = #{id,jdbcType=INTEGER} 
+        where id = #{id}
     </select>
 
-
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-        delete from public_release_clock
-        where  id = #{id,jdbcType=INTEGER} 
-    </delete>
-    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseClock" useGeneratedKeys="true">
-        insert into public_release_clock
-        ( id,prid,prdid
-        ,photo_url,clock_in_time,create_time
-        )
-        values (#{id,jdbcType=INTEGER},#{prid,jdbcType=INTEGER},#{prdid,jdbcType=INTEGER}
-        ,#{photoUrl,jdbcType=VARCHAR},#{clockInTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP}
-        )
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into public_release_clock(prid, prdid, photo_url, clock_in_time, create_time, longitude, latitude,
+                                         district_name)
+        values (#{prid}, #{prdid}, #{photoUrl}, #{clockInTime}, #{createTime}, #{longitude}, #{latitude},
+                #{districtName})
     </insert>
+
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseClock" useGeneratedKeys="true">
         insert into public_release_clock
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                <if test="id != null">id,</if>
-                <if test="prid != null">prid,</if>
-                <if test="prdid != null">prdid,</if>
-                <if test="photoUrl != null">photo_url,</if>
-                <if test="clockInTime != null">clock_in_time,</if>
-                <if test="createTime != null">create_time,</if>
+            <if test="id != null">id,</if>
+            <if test="prid != null">prid,</if>
+            <if test="prdid != null">prdid,</if>
+            <if test="photoUrl != null">photo_url,</if>
+            <if test="clockInTime != null">clock_in_time,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="longitude != null">longitude,</if>
+            <if test="latitude != null">latitude,</if>
+            <if test="districtName != null">district_name,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                <if test="id != null">#{id,jdbcType=INTEGER},</if>
-                <if test="prid != null">#{prid,jdbcType=INTEGER},</if>
-                <if test="prdid != null">#{prdid,jdbcType=INTEGER},</if>
-                <if test="photoUrl != null">#{photoUrl,jdbcType=VARCHAR},</if>
-                <if test="clockInTime != null">#{clockInTime,jdbcType=TIMESTAMP},</if>
-                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+            <if test="id != null">#{id,jdbcType=INTEGER},</if>
+            <if test="prid != null">#{prid,jdbcType=INTEGER},</if>
+            <if test="prdid != null">#{prdid,jdbcType=INTEGER},</if>
+            <if test="photoUrl != null">#{photoUrl,jdbcType=VARCHAR},</if>
+            <if test="clockInTime != null">#{clockInTime,jdbcType=TIMESTAMP},</if>
+            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+            <if test="longitude != null">#{longitude,jdbcType=VARCHAR},</if>
+            <if test="latitude != null">#{latitude,jdbcType=VARCHAR},</if>
+            <if test="districtName != null">#{districtName,jdbcType=VARCHAR},</if>
         </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseClock">
+
+    <insert id="insertBatch">
+        insert into public_release_clock(prid, prdid, photo_url, clock_in_time, create_time, longitude, latitude,
+        district_name)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.prid}, #{entity.prdid}, #{entity.photoUrl}, #{entity.clockInTime}, #{entity.createTime},
+            #{entity.longitude}, #{entity.latitude}, #{entity.districtName})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into public_release_clock(prid, prdid, photo_url, clock_in_time, create_time, longitude, latitude,
+        district_name)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.prid}, #{entity.prdid}, #{entity.photoUrl}, #{entity.clockInTime}, #{entity.createTime},
+            #{entity.longitude}, #{entity.latitude}, #{entity.districtName})
+        </foreach>
+        on duplicate key update
+        prid = values(prid),
+        prdid = values(prdid),
+        photo_url = values(photo_url),
+        clock_in_time = values(clock_in_time),
+        create_time = values(create_time),
+        longitude = values(longitude),
+        latitude = values(latitude),
+        district_name = values(district_name)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
         update public_release_clock
         <set>
-                <if test="prid != null">
-                    prid = #{prid,jdbcType=INTEGER},
-                </if>
-                <if test="prdid != null">
-                    prdid = #{prdid,jdbcType=INTEGER},
-                </if>
-                <if test="photoUrl != null">
-                    photo_url = #{photoUrl,jdbcType=VARCHAR},
-                </if>
-                <if test="clockInTime != null">
-                    clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
-                </if>
-                <if test="createTime != null">
-                    create_time = #{createTime,jdbcType=TIMESTAMP},
-                </if>
+            <if test="prid != null">
+                prid = #{prid},
+            </if>
+            <if test="prdid != null">
+                prdid = #{prdid},
+            </if>
+            <if test="photoUrl != null and photoUrl != ''">
+                photo_url = #{photoUrl},
+            </if>
+            <if test="clockInTime != null">
+                clock_in_time = #{clockInTime},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="longitude != null and longitude != ''">
+                longitude = #{longitude},
+            </if>
+            <if test="latitude != null and latitude != ''">
+                latitude = #{latitude},
+            </if>
+            <if test="districtName != null and districtName != ''">
+                district_name = #{districtName},
+            </if>
         </set>
-        where   id = #{id,jdbcType=INTEGER} 
-    </update>
-    <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicReleaseClock">
-        update public_release_clock
-        set 
-            prid =  #{prid,jdbcType=INTEGER},
-            prdid =  #{prdid,jdbcType=INTEGER},
-            photo_url =  #{photoUrl,jdbcType=VARCHAR},
-            clock_in_time =  #{clockInTime,jdbcType=TIMESTAMP},
-            create_time =  #{createTime,jdbcType=TIMESTAMP}
-        where   id = #{id,jdbcType=INTEGER} 
+        where id = #{id}
     </update>
 
-    <select id="selectList" resultMap="BaseResultMap">
+    <!--查询指定行数据-->
+    <select id="findPublicReleaseClockList" resultMap="PublicReleaseClockMap">
         select
-        <include refid="Base_Column_List" />
+        <include refid="PublicReleaseClockAllSql"/>
+
+        from public_release_clock
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="prid != null">
+                and prid = #{prid}
+            </if>
+            <if test="prdid != null">
+                and prdid = #{prdid}
+            </if>
+            <if test="photoUrl != null and photoUrl != ''">
+                and photo_url = #{photoUrl}
+            </if>
+            <if test="clockInTime != null">
+                and clock_in_time = #{clockInTime}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="longitude != null and longitude != ''">
+                and longitude = #{longitude}
+            </if>
+            <if test="latitude != null and latitude != ''">
+                and latitude = #{latitude}
+            </if>
+            <if test="districtName != null and districtName != ''">
+                and district_name = #{districtName}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findPublicReleaseClockCount" resultType="java.lang.Integer">
+        select count(1)
+        from public_release_clock
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="prid != null">
+                and prid = #{prid}
+            </if>
+            <if test="prdid != null">
+                and prdid = #{prdid}
+            </if>
+            <if test="photoUrl != null and photoUrl != ''">
+                and photo_url = #{photoUrl}
+            </if>
+            <if test="clockInTime != null">
+                and clock_in_time = #{clockInTime}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="longitude != null and longitude != ''">
+                and longitude = #{longitude}
+            </if>
+            <if test="latitude != null and latitude != ''">
+                and latitude = #{latitude}
+            </if>
+            <if test="districtName != null and districtName != ''">
+                and district_name = #{districtName}
+            </if>
+        </where>
+    </select>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from public_release_clock
+        where id = #{id}
+    </delete>
+
+
+    <select id="selectList" resultMap="PublicReleaseClockMap">
+        select
+        <include refid="PublicReleaseClockAllSql" />
         from public_release_clock
         where prid in
         <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
             #{item}
         </foreach>
     </select>
+
 </mapper>
+

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

@@ -186,7 +186,7 @@
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="listPublicReleaseLog" resultType="com.goafanti.weChat.bo.outPublicReleaseLog">
-  select a.id,a.aid ,a.prid ,a.remarks ,a.status ,b.name aname,a.photo_url photoUrl,
+  select a.id,a.aid ,a.prid ,a.remarks ,a.status ,b.name aname,a.photo_url photoUrl,a.create_time createTime,
 	date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes
 	from public_release_log a left join admin b on a.aid =b.id
 	left  join public_release pr  on a.prid =pr.id

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

@@ -44,10 +44,11 @@
         <result property="addressName" column="address_name" jdbcType="VARCHAR"/>
         <result property="assistProcess" column="assist_process" jdbcType="INTEGER"/>
         <result property="alone" column="alone" jdbcType="INTEGER"/>
+        <result property="processStatus" column="process_status" jdbcType="INTEGER"/>
     </resultMap>
 
     <sql id="PublicReleaseAllSql">
-        id, aid, release_start, release_end, remarks, annex_url, status, create_time, pname, duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type, order_no, update_time, update_status, assist, assist_aid, assist_aid_name, main_id, main_name, reject_name, assistant_aid, assistant_name, public_again, audit_time, new_user, sign_sum, user_names, object_type, public_type, district_name, clock_in, tech_start_process, address_name, assist_process, alone
+        id, aid, release_start, release_end, remarks, annex_url, status, create_time, pname, duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type, order_no, update_time, update_status, assist, assist_aid, assist_aid_name, main_id, main_name, reject_name, assistant_aid, assistant_name, public_again, audit_time, new_user, sign_sum, user_names, object_type, public_type, district_name, clock_in, tech_start_process, address_name, assist_process, alone, process_status
     </sql>
 
     <!--查询单个-->
@@ -65,13 +66,13 @@
                                    order_no, update_time, update_status, assist, assist_aid, assist_aid_name, main_id,
                                    main_name, reject_name, assistant_aid, assistant_name, public_again, audit_time,
                                    new_user, sign_sum, user_names, object_type, public_type, district_name, clock_in,
-                                   tech_start_process, address_name, assist_process, alone)
+                                   tech_start_process, address_name, assist_process, alone, process_status)
         values (#{aid}, #{releaseStart}, #{releaseEnd}, #{remarks}, #{annexUrl}, #{status}, #{createTime}, #{pname},
                 #{duration}, #{validDate}, #{supplement}, #{auditInfo}, #{plan}, #{expectedEffect}, #{nextPlan},
                 #{type}, #{orderNo}, #{updateTime}, #{updateStatus}, #{assist}, #{assistAid}, #{assistAidName},
                 #{mainId}, #{mainName}, #{rejectName}, #{assistantAid}, #{assistantName}, #{publicAgain}, #{auditTime},
                 #{newUser}, #{signSum}, #{userNames}, #{objectType}, #{publicType}, #{districtName}, #{clockIn},
-                #{techStartProcess}, #{addressName}, #{assistProcess}, #{alone})
+                #{techStartProcess}, #{addressName}, #{assistProcess}, #{alone}, #{processStatus})
     </insert>
 
     <insert id="insertBatch">
@@ -79,7 +80,7 @@
         duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type, order_no, update_time,
         update_status, assist, assist_aid, assist_aid_name, main_id, main_name, reject_name, assistant_aid,
         assistant_name, public_again, audit_time, new_user, sign_sum, user_names, object_type, public_type,
-        district_name, clock_in, tech_start_process, address_name, assist_process, alone)
+        district_name, clock_in, tech_start_process, address_name, assist_process, alone, process_status)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.aid}, #{entity.releaseStart}, #{entity.releaseEnd}, #{entity.remarks}, #{entity.annexUrl},
@@ -90,7 +91,7 @@
             #{entity.assistantAid}, #{entity.assistantName}, #{entity.publicAgain}, #{entity.auditTime},
             #{entity.newUser}, #{entity.signSum}, #{entity.userNames}, #{entity.objectType}, #{entity.publicType},
             #{entity.districtName}, #{entity.clockIn}, #{entity.techStartProcess}, #{entity.addressName},
-            #{entity.assistProcess}, #{entity.alone})
+            #{entity.assistProcess}, #{entity.alone}, #{entity.processStatus})
         </foreach>
     </insert>
 
@@ -99,7 +100,7 @@
         duration, valid_date, supplement, audit_info, plan, expected_effect, next_plan, type, order_no, update_time,
         update_status, assist, assist_aid, assist_aid_name, main_id, main_name, reject_name, assistant_aid,
         assistant_name, public_again, audit_time, new_user, sign_sum, user_names, object_type, public_type,
-        district_name, clock_in, tech_start_process, address_name, assist_process, alone)
+        district_name, clock_in, tech_start_process, address_name, assist_process, alone, process_status)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.aid}, #{entity.releaseStart}, #{entity.releaseEnd}, #{entity.remarks}, #{entity.annexUrl},
@@ -110,7 +111,7 @@
             #{entity.assistantAid}, #{entity.assistantName}, #{entity.publicAgain}, #{entity.auditTime},
             #{entity.newUser}, #{entity.signSum}, #{entity.userNames}, #{entity.objectType}, #{entity.publicType},
             #{entity.districtName}, #{entity.clockIn}, #{entity.techStartProcess}, #{entity.addressName},
-            #{entity.assistProcess}, #{entity.alone})
+            #{entity.assistProcess}, #{entity.alone}, #{entity.processStatus})
         </foreach>
         on duplicate key update
         aid = values(aid),
@@ -152,7 +153,8 @@
         tech_start_process = values(tech_start_process),
         address_name = values(address_name),
         assist_process = values(assist_process),
-        alone = values(alone)
+        alone = values(alone),
+        process_status = values(process_status)
     </insert>
 
     <!--通过主键修改数据-->
@@ -279,6 +281,9 @@
             <if test="alone != null">
                 alone = #{alone},
             </if>
+            <if test="processStatus != null">
+                process_status = #{processStatus},
+            </if>
         </set>
         where id = #{id}
     </update>
@@ -413,6 +418,9 @@
             <if test="alone != null">
                 and alone = #{alone}
             </if>
+            <if test="processStatus != null">
+                and process_status = #{processStatus}
+            </if>
         </where>
         <if test="page_sql != null">
             ${page_sql}
@@ -547,6 +555,9 @@
             <if test="alone != null">
                 and alone = #{alone}
             </if>
+            <if test="processStatus != null">
+                and process_status = #{processStatus}
+            </if>
         </where>
     </select>
 
@@ -557,7 +568,6 @@
         where id = #{id}
     </delete>
 
-
     <delete id="deleteByMainId">
         delete from public_release where main_id = #{id}
     </delete>
@@ -608,6 +618,7 @@
             <if test="addressName != null">address_name,</if>
             <if test="assistProcess != null">assist_process,</if>
             <if test="alone != null">alone,</if>
+            <if test="processStatus != null">process_status,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id,jdbcType=INTEGER},</if>
@@ -651,6 +662,7 @@
             <if test="addressName != null">#{addressName,jdbcType=VARCHAR},</if>
             <if test="assistProcess != null">#{assistProcess,jdbcType=INTEGER},</if>
             <if test="alone != null">#{alone,jdbcType=INTEGER},</if>
+            <if test="processStatus != null">#{processStatus,jdbcType=INTEGER},</if>
         </trim>
     </insert>
 
@@ -664,7 +676,7 @@
 
     <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
         select a.id ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.aid,a.public_type publicType,a.order_no orderNo,
-        ton.contract_no contractNo,
+        ton.contract_no contractNo,a.process_status processStatus,
         date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
         date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,a.district_name districtName,
         a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
@@ -682,7 +694,7 @@
             left join public_release_details b on a.id=b.prid
             left join user e on b.uid=e.id  left join admin ad on e.aid=ad.id
         </if>
-            left join t_order_new ton on a.order_no =ton.order_no
+        left join t_order_new ton on a.order_no =ton.order_no
         <if test="type==5">
             left join t_order_mid tom on a.order_no=tom.order_no
         </if>
@@ -731,12 +743,15 @@
             and a.assist in(0,1)
             and a.tech_start_process in (0,2)
             and a.assist_process in (0,1,2,3,4)
-            and apr.reviewer_id = #{aid} and apr.type=0
             <if test="status == 1">
                 and a.status = #{status} and  a.assist_process in (0,1)
+                and ((apr.type=0 and a.process_status in (0,1)) or(apr.type=4 and a.process_status in (2)))
+                and apr.reviewer_id = #{aid}
             </if>
             <if test="status == 2">
-                and a.status = #{status} and  a.assist_process in (2,3,4)
+                and a.status in(1,2) and  a.assist_process in (0,2,3,4)
+                and ((apr.type=0 and a.process_status in (0,4)) or(apr.type=4 and a.process_status in (0,4)))
+                and apr.reviewer_id = #{aid}
             </if>
         </if>
         <if test="type==2">
@@ -825,7 +840,7 @@
     </select>
 
     <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
-        select  a.id,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.update_time updateTime,a.user_names userNames,
+        select  a.id,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.update_time updateTime,a.user_names userNames,a.process_status processStatus,
         date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,a.assist_process assistProcess,
         a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.aid ,c.superior_id suprId,a.tech_start_process techStartProcess,a.alone,
         a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,c.reviewer,a.type,a.order_no orderNo,d.contract_no contractNo,a.address_name addressName,

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

@@ -258,7 +258,7 @@
             <if test="settlementTime != null">
                 settlement_time = #{settlementTime},
             </if>
-            <if test="contractPictureUrl != null and contractPictureUrl != ''">
+            <if test="contractPictureUrl != null ">
                 contract_picture_url = #{contractPictureUrl},
             </if>
             <if test="contractNo != null and contractNo != ''">
@@ -309,13 +309,13 @@
             <if test="backStatus != null">
                 back_status = #{backStatus},
             </if>
-            <if test="agreementUrl != null and agreementUrl != ''">
+            <if test="agreementUrl != null ">
                 agreement_url = #{agreementUrl},
             </if>
             <if test="newUser != null">
                 new_user = #{newUser},
             </if>
-            <if test="serviceContent != null and serviceContent != ''">
+            <if test="serviceContent != null ">
                 service_content = #{serviceContent},
             </if>
             <if test="salesType != null">

+ 14 - 2
src/main/java/com/goafanti/common/model/PublicRelease.java

@@ -8,10 +8,10 @@ import java.util.Date;
  * 公出表(PublicRelease)实体类
  *
  * @author makejava
- * @since 2025-04-17 14:41:21
+ * @since 2025-09-02 11:22:46
  */
 public class PublicRelease implements Serializable {
-    private static final long serialVersionUID = 706163335403356351L;
+    private static final long serialVersionUID = 633295198365381700L;
 
     private Integer id;
     /**
@@ -174,6 +174,10 @@ public class PublicRelease implements Serializable {
      * 协单业务公出 0否 1是
      */
     private Integer alone;
+    /**
+     * 0=无需多级审核,1=1级审核,2=2级审核,4=完成审核
+     */
+    private Integer processStatus;
 
 
     public Integer getId() {
@@ -504,5 +508,13 @@ public class PublicRelease implements Serializable {
         this.alone = alone;
     }
 
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
 }
 

+ 46 - 51
src/main/java/com/goafanti/common/model/PublicReleaseClock.java

@@ -1,129 +1,124 @@
 package com.goafanti.common.model;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
-
 import java.io.Serializable;
 import java.util.Date;
 
+
 /**
- * 公出打卡表
- * @TableName public_release_clock
+ * 公出打卡表(PublicReleaseClock)实体类
+ *
+ * @author makejava
+ * @since 2025-08-27 11:44:45
  */
 public class PublicReleaseClock implements Serializable {
-    /**
-     * 
-     */
-    private Integer id;
+    private static final long serialVersionUID = -21241622729243982L;
 
+    private Integer id;
     /**
      * 公出编号
      */
     private Integer prid;
-
     /**
      * 公出详情编号
      */
     private Integer prdid;
-
     /**
      * 附件
      */
     private String photoUrl;
-
     /**
      * 打卡时间
      */
     private Date clockInTime;
-
     /**
      * 发起时间
      */
     private Date createTime;
-
-    private static final long serialVersionUID = 1L;
-
     /**
-     * 
+     * 经度
+     */
+    private String longitude;
+    /**
+     * 纬度
+     */
+    private String latitude;
+    /**
+     * 公出企业地址
      */
+    private String districtName;
+
+
     public Integer getId() {
         return id;
     }
 
-    /**
-     * 
-     */
     public void setId(Integer id) {
         this.id = id;
     }
 
-    /**
-     * 公出编号
-     */
     public Integer getPrid() {
         return prid;
     }
 
-    /**
-     * 公出编号
-     */
     public void setPrid(Integer prid) {
         this.prid = prid;
     }
 
-    /**
-     * 公出详情编号
-     */
     public Integer getPrdid() {
         return prdid;
     }
 
-    /**
-     * 公出详情编号
-     */
     public void setPrdid(Integer prdid) {
         this.prdid = prdid;
     }
 
-    /**
-     * 附件
-     */
     public String getPhotoUrl() {
         return photoUrl;
     }
 
-    /**
-     * 附件
-     */
     public void setPhotoUrl(String photoUrl) {
         this.photoUrl = photoUrl;
     }
 
-    /**
-     * 打卡时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     public Date getClockInTime() {
         return clockInTime;
     }
 
-    /**
-     * 打卡时间
-     */
     public void setClockInTime(Date clockInTime) {
         this.clockInTime = clockInTime;
     }
 
-    /**
-     * 发起时间
-     */
     public Date getCreateTime() {
         return createTime;
     }
 
-    /**
-     * 发起时间
-     */
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
-}
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public String getDistrictName() {
+        return districtName;
+    }
+
+    public void setDistrictName(String districtName) {
+        this.districtName = districtName;
+    }
+
+}
+

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

@@ -740,6 +740,12 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 //			}
 		}else {
 			list = userMapper.findCustomerContacts(uid, null);
+			for (OrganizationContactBook ob : list) {
+				if (!ob.getAid().equals(TokenManager.getAdminId())){
+					ob.setName("***");
+					ob.setMobile("***");
+				}
+			}
 		}
 
 		return list;

+ 9 - 0
src/main/java/com/goafanti/weChat/bo/OutPublicReleaseList.java

@@ -43,6 +43,15 @@ public class OutPublicReleaseList {
 	private Integer publicAssistAdvice;
 	private Integer assistProcess;
 	private Integer alone;
+	private Integer processStatus;
+
+	public Integer getProcessStatus() {
+		return processStatus;
+	}
+
+	public void setProcessStatus(Integer processStatus) {
+		this.processStatus = processStatus;
+	}
 
 	public String getContractNo() {
 		return contractNo;

+ 206 - 72
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -125,6 +125,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 //			in.setAssistAidName(getAssistAidName(in.getAssistAid()));
 			in.setMainName(my.getName());
 			in.setAssistProcess(1);
+
 		}
 		if (in.getType() == 1) {
 			//技术公出
@@ -136,6 +137,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				in.setTechStartProcess(1);
 			}
 		}
+		in.setProcessStatus(1);
 		publicReleaseMapper.insertSelective(in);
 		if (in.getType()==1&&in.getOrderNo()!=null){
 			TOrderNew tOrderNew = tOrderNewMapper.queryById(in.getOrderNo());
@@ -153,10 +155,32 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		updateName.setUserNames(userNames);
 		publicReleaseMapper.update(updateName);
 		addpublicLog(in.getId(), PublicReleaseLog.states.fq.getCode(), "发起外出申请");
+		//公出信息抄送
 		pushPublicCarbonCopy(in, my, userNames);
+		//协单抄送
+		if (in.getAssist()==1){
+			pushPublicAssistCarbonCopy(in, my, userNames);
+
+		}
 		return (Map<String, Object>) addPublicReleaseLog(my, in,userNames,date,users,checkOrderNo);
 	}
 
+	private void pushPublicAssistCarbonCopy(InputPublicRelease in, AdminListBo my, String userNames) {
+		String[] split = in.getAssistAid().split(",");
+		for (String aid2 : split) {
+			AdminListBo my2 = adminMapper.getDeptNameByAid(aid2);
+			PublicRelease p=new PublicRelease();
+			p.setId(in.getId());
+			p.setAid(aid2);
+			p.setReleaseStart(in.getReleaseStart());
+			p.setReleaseEnd(in.getReleaseEnd());
+			p.setPlan(in.getPlan());
+			p.setType(3);
+			pushPublicCarbonCopy(p, my2, userNames);
+		}
+	}
+
+
 	private void pushUserArchivesInterview(InputPublicRelease in) {
 		if (in.getUids()!=null){
 			String[] split1 = in.getUais().split(",");
@@ -252,36 +276,52 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			publicReleaseDetailsMapper.insertBatch(prdList);
 		}
 	}
-
-	private void pushPublicCarbonCopy(InputPublicRelease in, AdminListBo my, String userNames) {
+	private void pushPublicCarbonCopy(PublicRelease p, AdminListBo my, String userNames) {
 		List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(my.getId())
 				.stream().filter(e -> e.getType() == 3).collect(Collectors.toList());
 		if (adminPublicReviewerBos.size()>0){
 			for (AdminPublicReviewerBo e : adminPublicReviewerBos) {
+				//公出信息
 				if (StringUtils.isNotEmpty(e.getReviewerId())){
-					String startTime = DateUtils.formatDateChineseYYYYMMddHH(in.getReleaseStart());
-					String endTime = DateUtils.formatDateChineseYYYYMMddHH(in.getReleaseEnd());
+					String startTime = DateUtils.formatDateChineseYYYYMMddHH(p.getReleaseStart());
+					String endTime = DateUtils.formatDateChineseYYYYMMddHH(p.getReleaseEnd());
 					//分类 0业务 1技术 2行政 3 技术协单 4 技术助手
 					String typeName=null;
-					if(in.getType()==0)typeName="业务公出";
-					else if(in.getType()==1)typeName="技术公出";
-					else if(in.getType()==2)typeName="行政公出";
-					String str2=String.format("营销员%s,%s - %s,将公出%s,请知悉!", my.getName(),
+					if(p.getType()==0)typeName="业务公出";
+					else if(p.getType()==1)typeName="技术公出";
+					else if(p.getType()==2)typeName="行政公出";
+					else if(p.getType()==3)typeName="技术协单";
+					String str=String.format("%s,%s - %s,将公出%s,请知悉!", my.getName(),
 							startTime,
 							endTime,
 							userNames);
+					String str2=String.format("协单%s,请知悉!",
+							userNames);
 					asyncUtils.addNoticAndEmail(NoticeStatus.PUBLIC_CARBON_COPY.getCode(), e.getReviewerId()
-							,str2);
-					asyncUtils.sendCarbonCopyWeChat(e.getReviewerId(), in.getId(),
+							,str);
+					asyncUtils.sendCarbonCopyWeChat(e.getReviewerId(), p.getId(),
 							my.getName(), startTime,
 							endTime,
 							typeName,
-							in.getPlan());
+							str2);
 				}
+
 			}
 		}
 
 
+
+	}
+
+	private void pushPublicCarbonCopy(InputPublicRelease in, AdminListBo my, String userNames) {
+		PublicRelease p=new PublicRelease();
+		p.setId(in.getId());
+		p.setAid(in.getAid());
+		p.setReleaseStart(in.getReleaseStart());
+		p.setReleaseEnd(in.getReleaseEnd());
+		p.setPlan(in.getPlan());
+		p.setType(in.getType());
+		pushPublicCarbonCopy(p, my, userNames);
 	}
 
 
@@ -334,6 +374,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 //			Admin a=adminMapper.selectById(my.getReviewer());
 			//订单审核换成多人
 			List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(in.getAid());
+			adminPublicReviewerBos=adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
 			String str="["+my.getName()+"]发起["+nickname+"]的外出申请,请及时审核。";
 			//默认上级审核
 			AtomicReference<Integer> status= new AtomicReference<>(1);
@@ -442,8 +483,15 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	 * @param map 返回实体
 	 */
 	private void pushNoticeAndSoucketAndEmail(AdminListBo my, PublicRelease in, Date date, Admin a,  String str, Map<String, Object> map) {
+		System.out.println("================================="+1);
 		sendNoticeAndSoucket(a.getId(),1, str);
 		if (a.getOpenId() !=null) {
+			//间隔一秒发送
+			try {
+				Thread.sleep(1000);
+			} catch (InterruptedException e) {
+				Thread.currentThread().interrupt();
+			}
 			Integer res= weChatUtils.addNotice(a.getOpenId(), in.getStatus(), in.getId(), date, my.getName(),"["+ my.getName()+"]发起外出申请");
 			if (res!=0) {
 				sendEmail(my, a,1);
@@ -600,6 +648,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}
 		addPublicReleaseDateClock(in);
 		publicReleaseLogMapper.insertSelective(log);
+		//设置回不需要审核,理论上按流程变更
+		in.setProcessStatus(0);
 		publicReleaseMapper.update(in);
 		if (in.getOrderNo()!=null){
 			TOrderNew tOrderNew = tOrderNewMapper.queryById(in.getOrderNo());
@@ -685,6 +735,21 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 //			}
 		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 		pushPublicCarbonCopy( in,  my,  userNames);
+		if (in.getAssist()==1){
+			String[] split2 = in.getAssistAid().split(",");
+			for (String aid2 : split2) {
+				AdminListBo my2 = adminMapper.getDeptNameByAid(aid2);
+				PublicRelease p=new PublicRelease();
+				p.setId(in.getId());
+				p.setAid(aid2);
+				p.setReleaseStart(in.getReleaseStart());
+				p.setReleaseEnd(in.getReleaseEnd());
+				p.setPlan(in.getPlan());
+				p.setType(3);
+				pushPublicCarbonCopy(p, my2, userNames);
+			}
+
+		}
 		//重新发起
 		addPublicReleaseLog(my, in, in.getUserNames(), date, uses, checkOrderNo);
 	}
@@ -932,10 +997,16 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 						){
 							StringBuffer str =new StringBuffer();
 							adminPublicReviewerBos= adminPublicReviewerMapper.selectByAid(e.getAid());
-							for (AdminPublicReviewerBo ap : adminPublicReviewerBos) {
-								if(ap.getType()==0)str=str.append(ap.getReviewerName()+",");
+							if (e.getProcessStatus()==0||e.getProcessStatus()==1){
+								for (AdminPublicReviewerBo ap : adminPublicReviewerBos) {
+									if(ap.getType()==0)str=str.append(ap.getReviewerName()+",");
+								}
+							}else if (e.getProcessStatus()==2){
+								for (AdminPublicReviewerBo ap : adminPublicReviewerBos) {
+									if(ap.getType()==4)str=str.append(ap.getReviewerName()+",");
+								}
 							}
-							e.setAdminExamine(str.substring(0,str.length()-1)+" 未审核");
+							if (str.length()>1)e.setAdminExamine(str.substring(0,str.length()-1)+" 未审核");
 						}else if (e.getType()==0&&e.getAssistProcess()==2){
 							//获取技术协单
 							List<PublicRelease> publicReleases = publicReleaseMapper.selectByMainId(e.getId(), null, null);
@@ -959,16 +1030,19 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					e.setAdminExamine("");
 				}else {
 					if (!publicExamines.isEmpty()){
-						StringBuffer str =new StringBuffer();
-						for (PublicExamine pe : publicExamines) {
-							if (e.getId().equals(pe.getPrid())){
-								str=str.append(pe.getAname());
-								if (pe.getStatus()==0)str=str.append(" 未审核,");
-								if (pe.getStatus()==1)str=str.append(" 已审核,");
+						if (e.getStatus()==2){
+							e.setAdminExamine("");
+						}else{
+							StringBuffer str =new StringBuffer();
+							for (PublicExamine pe : publicExamines) {
+								if (e.getId().equals(pe.getPrid())){
+									str=str.append(pe.getAname());
+									if (pe.getStatus()==0)str=str.append(" 未审核,");
+									if (pe.getStatus()==1)str=str.append(" 已审核,");
+								}
+								if (str.length()>1) e.setAdminExamine(str.substring(0,str.length()-1));
 							}
-							if (str.length()>1) e.setAdminExamine(str.substring(0,str.length()-1));
 						}
-
 					}
 				}
 				if(e.getType()==3){
@@ -1000,7 +1074,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	 * @param id
 	 * @param status 状态 0驳回 1发起 2同意 3 撤销 4技术驳回
 	 * @param remarks
-	 * @param examineType 0上级审核 1营销员审核 2技术审核
+	 * @param examineType 0上级审核 1营销员审核 2技术审核 3二级审核
 	 * @param evaluateType 0不存指导意见 1存指导意见
 	 * @return
 	 */
@@ -1031,44 +1105,76 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		//上级审核
 		if(examineType==0){
 			p.setStatus(status);
-			if (status==0){
-				addpublicLog(id, status, remarks);
-				str=str.append("驳回,");
-				if (use.getAssist()==2){
-					content=content.append("技术协单被[").append(ad.getName()).append("]拒绝!");
-				}else {
-					content=content.append("未通过公出审核!");
-				}
-				if(use.getPublicType()>1){
-					p.setPublicType(1);
-					PublicExamine inpe=new PublicExamine();
-					inpe.setStatus(0);
-					inpe.setPrid(use.getId());
-					publicExamineMapper.updateStatusByPrid(inpe);
-				}
-			}else if(status==2){
-				str=str.append("同意,");
-				addpublicLog(id, status, remarks);
-				//如果是协单公出主公出,在审核通过
-				if (use.getAssist()==1){
-					pushPublicReleaseAssist(use, p, date, a);
-
-				}else if (use.getAssist()==0){
-					publicReleaseMapper.updateStatusByMainId(3,use.getId(),null,null);
-				}
-				content=content.append("已通过审核!");
-			}
-			str=str.append(remarks);
-			p.setAuditInfo(str.toString());
-			p.setAuditTime(date);
-			p.setRejectName(ad.getName());
-			sendNoticeAndSoucket(a.getId(),status,content.toString());
-			List<OutPublicReleaseDetails> outPublicReleaseDetails = publicReleaseDetailsMapper.selectByPrid(id);
-			//添加上级评价
-			if (evaluateType==1){
-				addUserSuperEvaluate(remarks, outPublicReleaseDetails, date);
-			}
-
+				if (status==0){
+					addpublicLog(id, status, remarks);
+					str=str.append("驳回,");
+					if (use.getAssist()==2){
+						content=content.append("技术协单被[").append(ad.getName()).append("]拒绝!");
+					}else {
+						content=content.append("未通过公出审核!");
+					}
+					if(use.getPublicType()>1){
+						p.setPublicType(1);
+						PublicExamine inpe=new PublicExamine();
+						inpe.setStatus(0);
+						inpe.setPrid(use.getId());
+						publicExamineMapper.updateStatusByPrid(inpe);
+					}
+				}else if(status==2){//同意区分是1级审核还是二级审核
+					str=str.append("同意,");
+					addpublicLog(id, status, remarks);
+					content=content.append("已通过审核!");
+					//新增二级审核
+					List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(use.getAid());
+					adminPublicReviewerBos=adminPublicReviewerBos.stream().filter(e -> e.getType() == 4).collect(Collectors.toList());
+					if (adminPublicReviewerBos.isEmpty()){
+						p.setStatus(2);
+						p.setProcessStatus(3);
+						//如果是协单公出主公出,在审核通过
+						if (use.getAssist()==1){
+							pushPublicReleaseAssist(use, p, date, a);
+						}else if (use.getAssist()==0){
+							publicReleaseMapper.updateStatusByMainId(3,use.getId(),null,null);
+						}
+						addpublicLog(id, status, "无需二级审核直接通过");
+					}else {
+						if(use.getProcessStatus()==0||use.getProcessStatus()==1){
+							p.setStatus(1);
+							p.setProcessStatus(2);
+							str=str.append(remarks);
+							p.setAuditInfo(str.toString());
+							p.setAuditTime(date);
+							p.setRejectName(ad.getName());
+							for (AdminPublicReviewerBo e : adminPublicReviewerBos) {
+								sendNoticeAndSoucket(e.getReviewerId(),status,content.toString());
+							}
+						}else if (use.getProcessStatus()==2){
+							p.setStatus(2);
+							p.setProcessStatus(3);
+							//如果是协单公出主公出,在审核通过
+							if (use.getAssist()==1){
+								pushPublicReleaseAssist(use, p, date, a);
+							}else if (use.getAssist()==0){
+								publicReleaseMapper.updateStatusByMainId(3,use.getId(),null,null);
+							}
+							str=str.append(remarks);
+							p.setAuditInfo(str.toString());
+							p.setAuditTime(date);
+							p.setRejectName(ad.getName());
+							sendNoticeAndSoucket(a.getId(),status,content.toString());
+						}
+					}
+				}
+				str=str.append(remarks);
+				p.setAuditInfo(str.toString());
+				p.setAuditTime(date);
+				p.setRejectName(ad.getName());
+				sendNoticeAndSoucket(a.getId(),status,content.toString());
+				List<OutPublicReleaseDetails> outPublicReleaseDetails = publicReleaseDetailsMapper.selectByPrid(id);
+				//添加上级评价
+				if (use.getProcessStatus()==1&&evaluateType==1){
+					addUserSuperEvaluate(remarks, outPublicReleaseDetails, date);
+				}
 			//营销员审核
 		}else if (examineType==1){
 			//通知公出人切换成公出人审核人
@@ -1116,6 +1222,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				sendNoticeAndSoucket(a.getId(),status,content.toString());
 			}
 		}else if (examineType==2){
+			//技术审核
 			if (status==2){//审核通过
 				str=str.append("同意公出我的企业,").append(remarks);
 				content=content.append("已通过审核,请尽快审核。");
@@ -1904,8 +2011,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					){
 						StringBuffer str =new StringBuffer();
 						adminPublicReviewerBos= adminPublicReviewerMapper.selectByAid(e.getAid());
+
 						for (AdminPublicReviewerBo ap : adminPublicReviewerBos) {
-							if(ap.getType()==0)str=str.append(ap.getReviewerName()+",");
+							if((e.getProcessStatus()==0||e.getProcessStatus()==1)&&ap.getType()==0)str=str.append(ap.getReviewerName()+",");
+							if((e.getProcessStatus()==2)&&ap.getType()==4)str=str.append(ap.getReviewerName()+",");
 						}
 						if(str.length()>1){
 							outPublicReleaseLog.setAname(str.substring(0,str.length()-1));
@@ -1971,6 +2080,9 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			if (prd.getUid().equals(uid)){
 				String aid = TokenManager.getAdminId();
 				pc.setPrdid(prd.getId());
+				pc.setLatitude(prd.getLatitude());
+				pc.setLongitude(prd.getLongitude());
+				pc.setDistrictName(prd.getDistrictName());
 				prd.setClockInRemarks(clockInRemarks);
 				prd.setPhotoUrl(photoUrl);
 				prd.setClockInTime(date);
@@ -2091,18 +2203,32 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				if (adminPublicReviewerBos==null)adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(out.getAid());
 				//判定是否是上级审核人
 				boolean myFlag = false;
+				List<AdminPublicReviewerBo> collect = new ArrayList<>();
+				if (out.getProcessStatus()==0||out.getProcessStatus()==1){
+					collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
+				}else if (out.getProcessStatus()==2){
+					 collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 4).collect(Collectors.toList());
+					 //逻辑未完成先搁置
+				}
 				//如果是审核人可以查看
-					List<AdminPublicReviewerBo> collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
-					for (AdminPublicReviewerBo e : collect) {
-						if (e.getReviewerId().equals(aid)){
-							flag=true;
-							if (out.getType()==0){
-								flag2=true;
-							}
-							myFlag=true;
-							break;
+				for (AdminPublicReviewerBo e : collect) {
+					if (e.getReviewerId().equals(aid)){
+						flag=true;
+						if (out.getType()==0){
+							flag2=true;
 						}
+						myFlag=true;
+						break;
 					}
+				}
+				//新增所有审核人就是查看权限
+				for (AdminPublicReviewerBo e : adminPublicReviewerBos) {
+					if ((e.getType()==0||e.getType()==4)
+							&&aid.equals(e.getReviewerId())){
+						flag=true;
+						flag2=true;
+					}
+				}
 				//判定是否是上级审核状态
 				if((out.getPublicType()==0|| out.getPublicType()==2)&&
 						(out.getTechStartProcess()==0|| out.getTechStartProcess()==2)&&
@@ -2275,10 +2401,18 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 //				}
 			} else {
 				//业务公出,且协单审核完成?
-				List<AdminPublicReviewerBo> collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
+				List<AdminPublicReviewerBo> collect=new ArrayList<>();
+				if (out.getProcessStatus()==0||out.getProcessStatus()==1){
+					collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
+				}else {
+					collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 4).collect(Collectors.toList());
+				}
 				for (AdminPublicReviewerBo e : collect) {
 					str.append(e.getReviewerName()+",");
 				}
+
+
+
 			}
 
 

+ 6 - 0
src/main/resources/log4j.properties

@@ -3,6 +3,9 @@ log4j.appender.Console=org.apache.log4j.ConsoleAppender
 log4j.appender.Console.Target=System.out
 log4j.appender.Console.layout=org.apache.log4j.PatternLayout
 log4j.appender.Console.layout.ConversionPattern=[%p][%d{yyyy-MM-dd HH\:mm\:ss,SSS}][%c]%m%n
+log4j.appender.console.encoding=UTF-8
+log4j.appender.file.encoding=UTF-8
+
 
 log4j.logger.com.springframework=ERROR
 log4j.logger.com.ibatis=ERROR  
@@ -13,6 +16,9 @@ log4j.logger.java.sql.Connection=ERROR
 log4j.logger.java.sql.Statement=ERROR  
 log4j.logger.java.sql.PreparedStatement=ERROR  
 log4j.logger.java.sql.ResultSet=ERROR
+#\u8BBE\u7F6E\u5B57\u4F53
+
+
 
 # Druid
 log4j.logger.druid.sql=ERROR

+ 1 - 0
src/main/resources/mybatis-config.xml

@@ -7,6 +7,7 @@
 	</properties>  
   <settings>		
     <setting name="defaultExecutorType" value="REUSE" />
+<!--      <setting name="logImpl" value="STDOUT_LOGGING" />-->
   </settings>
  
   <typeAliases>