Explorar el Código

非公出协单开发

anderx hace 2 semanas
padre
commit
1385860765

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

@@ -9,7 +9,7 @@ import java.util.List;
  * 公出协单详情表(PublicAssistDetails)表数据库访问层
  *
  * @author makejava
- * @since 2026-01-19 15:02:01
+ * @since 2026-01-22 08:46:31
  */
 public interface PublicAssistDetailsMapper {
 
@@ -81,5 +81,7 @@ public interface PublicAssistDetailsMapper {
     int deleteById(Integer id);
 
     PublicAssistDetails selectByPrid(Integer id);
+
+    void deeleteByPrid(Integer id);
 }
 

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

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.PublicReleaseContentType;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 公出内容表(查询列表多选使用)(PublicReleaseContentType)表数据库访问层
+ *
+ * @author makejava
+ * @since 2026-01-22 08:43:11
+ */
+public interface PublicReleaseContentTypeMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    PublicReleaseContentType selectById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param publicReleaseContentType 查询条件
+     * @param pageable                 分页对象
+     * @return 对象列表
+     */
+    List<PublicReleaseContentType> findPublicReleaseContentTypeList(PublicReleaseContentType publicReleaseContentType);
+
+    /**
+     * 统计总行数
+     *
+     * @param publicReleaseContentType 查询条件
+     * @return 总行数
+     */
+    int findPublicReleaseContentTypeCount(PublicReleaseContentType publicReleaseContentType);
+
+    /**
+     * 新增数据
+     *
+     * @param publicReleaseContentType 实例对象
+     * @return 影响行数
+     */
+    int insert(PublicReleaseContentType publicReleaseContentType);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<PublicReleaseContentType> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<PublicReleaseContentType> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<PublicReleaseContentType> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<PublicReleaseContentType> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param publicReleaseContentType 实例对象
+     * @return 影响行数
+     */
+    int update(PublicReleaseContentType publicReleaseContentType);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    void deleteByPrid(Integer id);
+}
+

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

@@ -6,7 +6,7 @@
         <result property="id" column="id" jdbcType="INTEGER"/>
         <result property="prid" column="prid" jdbcType="INTEGER"/>
         <result property="type" column="type" jdbcType="VARCHAR"/>
-        <result property="contentType" column="content_type" jdbcType="INTEGER"/>
+        <result property="contentType" column="content_type" jdbcType="VARCHAR"/>
         <result property="content" column="content" jdbcType="VARCHAR"/>
     </resultMap>
 
@@ -59,7 +59,7 @@
             <if test="type != null and type != ''">
                 type = #{type},
             </if>
-            <if test="contentType != null">
+            <if test="contentType != null and contentType != ''">
                 content_type = #{contentType},
             </if>
             <if test="content != null and content != ''">
@@ -85,7 +85,7 @@
             <if test="type != null and type != ''">
                 and type = #{type}
             </if>
-            <if test="contentType != null">
+            <if test="contentType != null and contentType != ''">
                 and content_type = #{contentType}
             </if>
             <if test="content != null and content != ''">
@@ -111,7 +111,7 @@
             <if test="type != null and type != ''">
                 and type = #{type}
             </if>
-            <if test="contentType != null">
+            <if test="contentType != null and contentType != ''">
                 and content_type = #{contentType}
             </if>
             <if test="content != null and content != ''">
@@ -127,12 +127,18 @@
         where id = #{id}
     </delete>
 
+
     <select id="selectByPrid" resultMap="PublicAssistDetailsMap">
         select
         <include refid="PublicAssistDetailsAllSql"/>
         from public_assist_details
         where prid = #{id}
     </select>
+    <delete id="deeleteByPrid">
+        delete
+        from public_assist_details
+        where prid = #{id}
+    </delete>
 
 </mapper>
 

+ 114 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseContentTypeMapper.xml

@@ -0,0 +1,114 @@
+<?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.PublicReleaseContentTypeMapper">
+
+    <resultMap type="com.goafanti.common.model.PublicReleaseContentType" id="PublicReleaseContentTypeMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="prid" column="prid" jdbcType="INTEGER"/>
+        <result property="type" column="type" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="PublicReleaseContentTypeAllSql">
+        id, prid, type
+    </sql>
+
+    <!--查询单个-->
+    <select id="selectById" resultMap="PublicReleaseContentTypeMap">
+        select
+        <include refid="PublicReleaseContentTypeAllSql"/>
+        from public_release_content_type
+        where id = #{id}
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into public_release_content_type(prid, type)
+        values (#{prid}, #{type})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into public_release_content_type(prid, type)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.prid}, #{entity.type})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into public_release_content_type(prid, type)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.prid}, #{entity.type})
+        </foreach>
+        on duplicate key update
+        prid = values(prid),
+        type = values(type)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update public_release_content_type
+        <set>
+            <if test="prid != null">
+                prid = #{prid},
+            </if>
+            <if test="type != null and type != ''">
+                type = #{type},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--查询指定行数据-->
+    <select id="findPublicReleaseContentTypeList" resultMap="PublicReleaseContentTypeMap">
+        select
+        <include refid="PublicReleaseContentTypeAllSql"/>
+
+        from public_release_content_type
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="prid != null">
+                and prid = #{prid}
+            </if>
+            <if test="type != null and type != ''">
+                and type = #{type}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findPublicReleaseContentTypeCount" resultType="java.lang.Integer">
+        select count(1)
+        from public_release_content_type
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="prid != null">
+                and prid = #{prid}
+            </if>
+            <if test="type != null and type != ''">
+                and type = #{type}
+            </if>
+        </where>
+    </select>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from public_release_content_type
+        where id = #{id}
+    </delete>
+    <delete id="deleteByPrid">
+        delete
+        from public_release_content_type
+        where prid = #{prid}
+    </delete>
+
+</mapper>
+

+ 5 - 5
src/main/java/com/goafanti/common/model/PublicAssistDetails.java

@@ -7,10 +7,10 @@ import java.io.Serializable;
  * 公出协单详情表(PublicAssistDetails)实体类
  *
  * @author makejava
- * @since 2026-01-19 15:02:01
+ * @since 2026-01-22 08:46:31
  */
 public class PublicAssistDetails implements Serializable {
-    private static final long serialVersionUID = 271449998375743409L;
+    private static final long serialVersionUID = -41238799072140202L;
 
     private Integer id;
     /**
@@ -24,7 +24,7 @@ public class PublicAssistDetails implements Serializable {
     /**
      * 内容 0=其他,1=会议,2=写方案,3=接待
      */
-    private Integer contentType;
+    private String contentType;
     /**
      * 内容说明
      */
@@ -55,11 +55,11 @@ public class PublicAssistDetails implements Serializable {
         this.type = type;
     }
 
-    public Integer getContentType() {
+    public String getContentType() {
         return contentType;
     }
 
-    public void setContentType(Integer contentType) {
+    public void setContentType(String contentType) {
         this.contentType = contentType;
     }
 

+ 51 - 0
src/main/java/com/goafanti/common/model/PublicReleaseContentType.java

@@ -0,0 +1,51 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+
+
+/**
+ * 公出内容表(查询列表多选使用)(PublicReleaseContentType)实体类
+ *
+ * @author makejava
+ * @since 2026-01-22 08:43:12
+ */
+public class PublicReleaseContentType implements Serializable {
+    private static final long serialVersionUID = -40950203601730541L;
+
+    private Integer id;
+    /**
+     * 公出详情编号
+     */
+    private Integer prid;
+    /**
+     * 内容
+     */
+    private String type;
+
+
+    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 String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+}
+

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

@@ -184,7 +184,6 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		}
 		t.setReceiverName(a.getName());
 		tOrderTaskMapper.update(t);
-
 		projectDistributionAsyncService.pushProjectDistribution(taskId, taskReceiverId, type, t, tn, date, a);
 		return 1;
 	}

+ 3 - 3
src/main/java/com/goafanti/weChat/bo/InputPublicRelease.java

@@ -68,7 +68,7 @@ public class InputPublicRelease extends PublicRelease {
 	private String uais;
 
 	private String assistType;
-	private Integer assistContentType;
+	private String assistContentType;
 	private String assistContent;
 
 	private String pid;
@@ -89,11 +89,11 @@ public class InputPublicRelease extends PublicRelease {
 		this.assistType = assistType;
 	}
 
-	public Integer getAssistContentType() {
+	public String getAssistContentType() {
 		return assistContentType;
 	}
 
-	public void setAssistContentType(Integer assistContentType) {
+	public void setAssistContentType(String assistContentType) {
 		this.assistContentType = assistContentType;
 	}
 

+ 42 - 8
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -76,6 +76,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	private final PublicAssistDetailsMapper publicAssistDetailsMapper;
 	private final PublicReleaseTypeMapper publicReleaseTypeMapper;
 	private final UserMidMapper userMidMapper;
+	private final PublicReleaseContentTypeMapper publicReleaseContentTypeMapper;
 
 	public PublicReleaseServiceImpl(
 			PublicReleaseMapper publicReleaseMapper,
@@ -111,7 +112,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			UserInterviewProjectMapper userInterviewProjectMapper,
 			PublicAssistDetailsMapper publicAssistDetailsMapper,
 			PublicReleaseTypeMapper publicReleaseTypeMapper,
-			UserMidMapper userMidMapper
+			UserMidMapper userMidMapper,
+			PublicReleaseContentTypeMapper publicReleaseContentTypeMapper
 	) {
 		super();
 		this.publicReleaseMapper = publicReleaseMapper;
@@ -148,6 +150,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		this.publicAssistDetailsMapper = publicAssistDetailsMapper;
 		this.publicReleaseTypeMapper = publicReleaseTypeMapper;
 		this.userMidMapper = userMidMapper;
+		this.publicReleaseContentTypeMapper = publicReleaseContentTypeMapper;
 	}
 
 
@@ -186,15 +189,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		publicReleaseMapper.insertSelective(in);
 		//如果是非公出协单添加协单信息
 		if (in.getType()==5){
-			PublicAssistDetails pad=new PublicAssistDetails();
-			pad.setPrid(in.getId());
-			pad.setType(in.getAssistType());
-			pad.setContentType(in.getAssistContentType());
-			pad.setContent(in.getAssistContent());
-			publicAssistDetailsMapper.insert(pad);
-			if (in.getAssistType().contains(",")){
+			addPublicAssistType(in);
+			if (StringUtils.isNotBlank(in.getAssistType())){
 				addPublicReleaseType(in.getId(),in.getAssistType());
 			}
+			if (StringUtils.isNotBlank(in.getAssistContent())){
+				addPublicCotentType(in.getId(),in.getAssistContentType());
+			}
 		}
 		if (in.getType()==1&&in.getOrderNo()!=null){
 			TOrderNew tOrderNew = tOrderNewMapper.queryById(in.getOrderNo());
@@ -223,6 +224,27 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return (Map<String, Object>) addPublicReleaseLog(my, in,userNames,date,users,checkOrderNo);
 	}
 
+	private void addPublicCotentType(Integer id,String type) {
+		String[] split = type.split(",");
+		List<PublicReleaseContentType> list =new ArrayList<>();
+		for (String s : split) {
+			PublicReleaseContentType pct=new PublicReleaseContentType();
+			pct.setPrid(id);
+			pct.setType(s);
+			list.add(pct);
+		}
+			publicReleaseContentTypeMapper.insertBatch(list);
+	}
+
+	private void addPublicAssistType(InputPublicRelease in) {
+		PublicAssistDetails pad=new PublicAssistDetails();
+		pad.setPrid(in.getId());
+		pad.setType(in.getAssistType());
+		pad.setContentType(in.getAssistContentType());
+		pad.setContent(in.getAssistContent());
+		publicAssistDetailsMapper.insert(pad);
+	}
+
 	private void addPublicReleaseType(Integer id,String type) {
 		String[] split = type.split(",");
 		List<PublicReleaseType> list =new ArrayList<>();
@@ -742,6 +764,18 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			in.setProcessStatus(0);
 		}
 		publicReleaseMapper.update(in);
+		//如果是非公出协单添加协单信息
+		if (in.getType()==5){
+			addPublicAssistType(in);
+			if (StringUtils.isNotBlank(in.getAssistType())){
+				publicAssistDetailsMapper.deeleteByPrid(in.getId());
+				addPublicReleaseType(in.getId(),in.getAssistType());
+			}
+			if (StringUtils.isNotBlank(in.getAssistContent())){
+				publicReleaseContentTypeMapper.deleteByPrid(in.getId());
+				addPublicCotentType(in.getId(),in.getAssistContentType());
+			}
+		}
 		if (in.getOrderNo()!=null){
 			TOrderNew tOrderNew = tOrderNewMapper.queryById(in.getOrderNo());
 			orderNewService.pushOrderPublicReleaseCount(tOrderNew);