Browse Source

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

anderx 1 year ago
parent
commit
62d1ec9555

+ 2 - 3
src/main/java/com/goafanti/RD/controller/RDContorller.java

@@ -11,7 +11,6 @@ import com.goafanti.common.utils.excel.FileUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.MediaType;
-import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -22,7 +21,7 @@ import javax.servlet.http.HttpServletResponse;
 
 @RestController
 @RequestMapping(value = "/api/admin/RD")
-public class RDContorller extends BaseApiController {
+public class RDController extends BaseApiController {
 
     @Autowired
     private RDService rdService;
@@ -41,7 +40,7 @@ public class RDContorller extends BaseApiController {
 
 
     @RequestMapping(value="/update",method = RequestMethod.POST)
-    public Result update( InputRdDetails in ,BindingResult bindingResult) {
+    public Result update( InputRdDetails in) {
         Result res= new Result();
         res.data(rdService.update(in));
         return res;

+ 5 - 0
src/main/java/com/goafanti/common/bo/Result.java

@@ -5,6 +5,11 @@ import org.apache.shiro.SecurityUtils;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
+
+/**
+ *
+ * @param <T> 在Controller里面设置返回对象就可以用apipost读取到
+ */
 public class Result<T> {
 	private T data;
 	private List<Error>	error	= new ArrayList<Error>();

+ 4 - 0
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -49,6 +49,10 @@ public class WebpageController extends BaseController {
 	public String adminLogin(HttpServletRequest request, ModelAndView modelview) {
 		return "/admin/login";
 	}
+	@RequestMapping(value = "/admin/standard", method = RequestMethod.GET)
+	public String adminStandard(HttpServletRequest request, ModelAndView modelview) {
+		return "/admin/standard";
+	}
 
 
 	@RequestMapping(value = "/RD/admin/login", method = RequestMethod.GET)

+ 27 - 0
src/main/java/com/goafanti/common/dao/StandardDocumentMapper.java

@@ -0,0 +1,27 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.StandardDocument;
+import com.goafanti.standard.bo.OutStandardDocument;
+
+/**
+* @author Administrator
+* @description 针对表【standard_document(标准文档列表)】的数据库操作Mapper
+* @createDate 2024-05-08 17:19:34
+* @Entity com.goafanti.common.model.StandardDocument
+*/
+public interface StandardDocumentMapper {
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(StandardDocument record);
+
+    int insertSelective(StandardDocument record);
+
+    StandardDocument selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(StandardDocument record);
+
+    int updateByPrimaryKey(StandardDocument record);
+
+    OutStandardDocument selectDetailsById(Integer id);
+}

+ 3 - 1
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -57,7 +57,9 @@ public enum AttachmentType {
 	VARIETIES_PICTURE("varieties_picture","业务品类图片"),
 	ORGANIZATION_APPLICATION("organization_application","企业申报书"),
 	DUN_LOG_ATTACHMENT("dun_log_attachment","催款日志附件"),
-	LEGAL_LOG_ATTACHMENT("legal_log_attachment","催款日志附件");
+	LEGAL_LOG_ATTACHMENT("legal_log_attachment","催款日志附件"),
+	STANDARD_DOCUMENT("standard_document","标准文档");
+
 
 
 	private AttachmentType(String code, String desc) {

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

@@ -787,6 +787,7 @@
         <if test="allStatus == 2">
             and toc.exceed_duration >0
         </if>
+        order by contract_no desc
     </select>
 </mapper>
 

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

@@ -0,0 +1,186 @@
+<?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.StandardDocumentMapper">
+
+    <resultMap id="BaseResultMap" type="com.goafanti.common.model.StandardDocument">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="url" column="url" jdbcType="VARCHAR"/>
+            <result property="serialNumber" column="serial_number" jdbcType="VARCHAR"/>
+            <result property="name" column="name" jdbcType="VARCHAR"/>
+            <result property="reference" column="reference" jdbcType="VARCHAR"/>
+            <result property="depId" column="dep_id" jdbcType="VARCHAR"/>
+            <result property="aid" column="aid" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="INTEGER"/>
+            <result property="type" column="type" jdbcType="INTEGER"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,url,serial_number,
+        name,reference,dep_id,
+        aid,status,type,
+        create_time,update_time
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from standard_document
+        where  id = #{id,jdbcType=INTEGER} 
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from standard_document
+        where  id = #{id,jdbcType=INTEGER} 
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.StandardDocument" useGeneratedKeys="true">
+        insert into standard_document
+        ( id,url,serial_number
+        ,name,reference,dep_id
+        ,aid,status,type
+        ,create_time,update_time)
+        values (#{id,jdbcType=INTEGER},#{url,jdbcType=VARCHAR},#{serialNumber,jdbcType=VARCHAR}
+        ,#{name,jdbcType=VARCHAR},#{reference,jdbcType=VARCHAR},#{depId,jdbcType=VARCHAR}
+        ,#{aid,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{type,jdbcType=INTEGER}
+        ,#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.StandardDocument" useGeneratedKeys="true">
+        insert into standard_document
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="url != null">url,</if>
+                <if test="serialNumber != null">serial_number,</if>
+                <if test="name != null">name,</if>
+                <if test="reference != null">reference,</if>
+                <if test="depId != null">dep_id,</if>
+                <if test="aid != null">aid,</if>
+                <if test="status != null">status,</if>
+                <if test="type != null">type,</if>
+                <if test="createTime != null">create_time,</if>
+                <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=INTEGER},</if>
+                <if test="url != null">#{url,jdbcType=VARCHAR},</if>
+                <if test="serialNumber != null">#{serialNumber,jdbcType=VARCHAR},</if>
+                <if test="name != null">#{name,jdbcType=VARCHAR},</if>
+                <if test="reference != null">#{reference,jdbcType=VARCHAR},</if>
+                <if test="depId != null">#{depId,jdbcType=VARCHAR},</if>
+                <if test="aid != null">#{aid,jdbcType=VARCHAR},</if>
+                <if test="status != null">#{status,jdbcType=INTEGER},</if>
+                <if test="type != null">#{type,jdbcType=INTEGER},</if>
+                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+                <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.StandardDocument">
+        update standard_document
+        <set>
+                <if test="url != null">
+                    url = #{url,jdbcType=VARCHAR},
+                </if>
+                <if test="serialNumber != null">
+                    serial_number = #{serialNumber,jdbcType=VARCHAR},
+                </if>
+                <if test="name != null">
+                    name = #{name,jdbcType=VARCHAR},
+                </if>
+                <if test="reference != null">
+                    reference = #{reference,jdbcType=VARCHAR},
+                </if>
+                <if test="depId != null">
+                    dep_id = #{depId,jdbcType=VARCHAR},
+                </if>
+                <if test="aid != null">
+                    aid = #{aid,jdbcType=VARCHAR},
+                </if>
+                <if test="status != null">
+                    status = #{status,jdbcType=INTEGER},
+                </if>
+                <if test="type != null">
+                    type = #{type,jdbcType=INTEGER},
+                </if>
+                <if test="createTime != null">
+                    create_time = #{createTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="updateTime != null">
+                    update_time = #{updateTime,jdbcType=TIMESTAMP},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.StandardDocument">
+        update standard_document
+        set 
+            url =  #{url,jdbcType=VARCHAR},
+            serial_number =  #{serialNumber,jdbcType=VARCHAR},
+            name =  #{name,jdbcType=VARCHAR},
+            reference =  #{reference,jdbcType=VARCHAR},
+            dep_id =  #{depId,jdbcType=VARCHAR},
+            aid =  #{aid,jdbcType=VARCHAR},
+            status =  #{status,jdbcType=INTEGER},
+            type =  #{type,jdbcType=INTEGER},
+            create_time =  #{createTime,jdbcType=TIMESTAMP},
+            update_time =  #{updateTime,jdbcType=TIMESTAMP}
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+
+    <resultMap id="DetailsMap" type="com.goafanti.standard.bo.OutStandardDocument">
+        <id property="id" column="id" jdbcType="INTEGER"/>
+        <result property="url" column="url" jdbcType="VARCHAR"/>
+        <result property="serialNumber" column="serial_number" jdbcType="VARCHAR"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="reference" column="reference" jdbcType="VARCHAR"/>
+        <result property="depId" column="dep_id" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="type" column="type" jdbcType="INTEGER"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="adminName" column="adminName" jdbcType="VARCHAR"/>
+        <result property="depName" column="depName" jdbcType="VARCHAR"/>
+    </resultMap>
+    <select id="selectDetailsById"  resultMap="DetailsMap">
+        select
+            a.*,b.name adminName,c.name depName
+        from standard_document a left join admin b on a.aid=b.id
+        left join department c on a.dep_id=c.id
+        where  a.id = #{id,jdbcType=INTEGER}
+    </select>
+    <select id="standardList"  resultMap="DetailsMap">
+        select
+            a.*,b.name adminName,c.name depName
+        from standard_document a left join admin b on a.aid=b.id
+                                 left join department c on a.dep_id=c.id
+        where  1=1
+        <include refid="standardSql"/>
+    </select>
+    <sql id="standardSql">
+        <if test="status !=null">
+            and a.status = #{status,jdbcType=INTEGER}
+        </if>
+        <if  test="startTime !=null and endTime !=null">
+            and a.update_time between #{startTime,jdbcType=TIMESTAMP} and #{endTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="depId !=null">
+            and a.dep_id = #{depId,jdbcType=VARCHAR}
+        </if>
+        <if test="name !=null">
+            and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
+        </if>
+    </sql>
+
+    <select id="standardCount"  resultType="java.lang.Integer">
+        select
+            count(*)
+        from standard_document a
+        where  1=1
+        <include refid="standardSql"/>
+    </select>
+
+
+
+</mapper>

+ 225 - 0
src/main/java/com/goafanti/common/model/StandardDocument.java

@@ -0,0 +1,225 @@
+package com.goafanti.common.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 标准文档列表
+ * @TableName standard_document
+ */
+public class StandardDocument implements Serializable {
+    /**
+     * 
+     */
+    private Integer id;
+
+    /**
+     * 附件
+     */
+    private String url;
+
+    /**
+     * 标准编号
+     */
+    private String serialNumber;
+
+    /**
+     * 标准名称
+     */
+    private String name;
+
+    /**
+     * 参考
+     */
+    private String reference;
+
+    /**
+     * 订单部门
+     */
+    private String depId;
+
+    /**
+     * 负责人
+     */
+    private String aid;
+
+    /**
+     * 状态 0=关闭,1=开启
+     */
+    private Integer status;
+
+    /**
+     * 0=国家标准,1=行业标准,2=地方标准,3=团体标准,4=国际标准
+     */
+    private Integer type;
+
+    /**
+     * 发起时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 附件
+     */
+    public String getUrl() {
+        return url;
+    }
+
+    /**
+     * 附件
+     */
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    /**
+     * 标准编号
+     */
+    public String getSerialNumber() {
+        return serialNumber;
+    }
+
+    /**
+     * 标准编号
+     */
+    public void setSerialNumber(String serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    /**
+     * 标准名称
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * 标准名称
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 参考
+     */
+    public String getReference() {
+        return reference;
+    }
+
+    /**
+     * 参考
+     */
+    public void setReference(String reference) {
+        this.reference = reference;
+    }
+
+    /**
+     * 订单部门
+     */
+    public String getDepId() {
+        return depId;
+    }
+
+    /**
+     * 订单部门
+     */
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    /**
+     * 负责人
+     */
+    public String getAid() {
+        return aid;
+    }
+
+    /**
+     * 负责人
+     */
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    /**
+     * 状态 0=关闭,1=开启
+     */
+    public Integer getStatus() {
+        return status;
+    }
+
+    /**
+     * 状态 0=关闭,1=开启
+     */
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    /**
+     * 0=国家标准,1=行业标准,2=地方标准,3=团体标准,4=国际标准
+     */
+    public Integer getType() {
+        return type;
+    }
+
+    /**
+     * 0=国家标准,1=行业标准,2=地方标准,3=团体标准,4=国际标准
+     */
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    /**
+     * 发起时间
+     */
+    @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;
+    }
+}

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

@@ -111,7 +111,7 @@ public class FileUtils {
 			if (uniq) {
 				fileName = path + uid + "/" + System.nanoTime() + "_" + sign + suffix;
 			} else {
-				fileName = path + uid + "/" +  sign + suffix;
+				fileName = path + uid + "/"  +  sign + suffix;
 			}
 		} else {
 			fileName = path + uid + "/" + System.nanoTime() + suffix;

+ 2 - 2
src/main/java/com/goafanti/core/mybatis/page/Pagination.java

@@ -9,7 +9,7 @@ public class Pagination<T> extends SimplePage implements java.io.Serializable, P
 	/**
 	 * 当前页的数据
 	 */
-	private List<?> list = new ArrayList<>();
+	private List<T> list = new ArrayList<>();
 
 	public Pagination() {
 	}
@@ -31,7 +31,7 @@ public class Pagination<T> extends SimplePage implements java.io.Serializable, P
 		return list;
 	}
 
-	public void setList(List<?> list) {
+	public void setList(List list) {
 		this.list = list;
 	}
 

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

@@ -340,7 +340,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 		订单列表导出文件
+	 * 		订单列表导出文件(压缩包)
 	 *  specially 0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询 6客服查询 7统计签单订单 8客户订单列表 9 复审订单 10 营销经理
 	 *  distribution (咨询师管理列表 0 未分配 1部分 2全部
 	 *  amountStatus  0 10万元以下 1 10万~20万 2 20万~30万 3 30万~40万  4 40万以上

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

@@ -0,0 +1,88 @@
+package com.goafanti.standard.bo;
+
+public class InputStandardList {
+    /**
+     * 分页
+     */
+    private Integer pageNo;
+    /**
+     * 每页显示条数
+     */
+    private Integer pageSize;
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 部门
+     */
+    private String depId;
+    /**
+     * 状态 null=全部 0=关闭  1=开启
+     */
+    private Integer status;
+    /**
+     * 开始时间
+     */
+    private String startTime;
+    /**
+     * 结束时间
+     */
+    private String endTime;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    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;
+    }
+}

+ 26 - 0
src/main/java/com/goafanti/standard/bo/OutStandardDocument.java

@@ -0,0 +1,26 @@
+package com.goafanti.standard.bo;
+
+import com.goafanti.common.model.StandardDocument;
+
+public class OutStandardDocument extends StandardDocument {
+
+    private String adminName;
+    private String depName;
+
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+}

+ 104 - 0
src/main/java/com/goafanti/standard/controller/StandardApiController.java

@@ -0,0 +1,104 @@
+package com.goafanti.standard.controller;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.model.StandardDocument;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.standard.bo.InputStandardList;
+import com.goafanti.standard.bo.OutStandardDocument;
+import com.goafanti.standard.service.StandardService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+@RequestMapping(value = "/api/admin/standard")
+public class StandardApiController extends CertifyApiController {
+
+    @Resource
+    private StandardService standardService;
+
+    /**
+     * 标准列表
+     */
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public Result list(InputStandardList in) {
+        Result res = new Result<Pagination<OutStandardDocument>>();
+        return res.data(standardService.list(in));
+    }
+    /**
+     * 标准详情
+     */
+    @RequestMapping(value = "/get", method = RequestMethod.GET)
+    public Result get(StandardDocument in) {
+        Result res = res();
+        return res.data(standardService.get(in));
+    }
+
+    /**
+     * 新增标准
+     */
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    public Result add(StandardDocument in) {
+        Result res = res();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+            res.error(buildError("操作权限不正确。"));
+            return res;
+        }
+        return res.data(standardService.add(in));
+    }
+
+    /**
+     * 删除标准
+     */
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public Result delete(StandardDocument in) {
+        Result res = res();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+            res.error(buildError("操作权限不正确。"));
+            return res;
+        }
+        return res.data(standardService.delete(in));
+    }
+
+    /**
+     * 更新标准
+     */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    public Result update(StandardDocument in) {
+        Result res = res();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+            res.error(buildError("操作权限不正确。"));
+            return res;
+        }
+        return res.data(standardService.update(in));
+    }
+
+    /**
+     * 图片上传
+     */
+    @RequestMapping(value = "/uploadPicture", method = RequestMethod.POST)
+    public Result uploadPicture(HttpServletRequest req, String sign) {
+        Result res = new Result();
+        AttachmentType attachmentType = AttachmentType.getField(sign);
+
+        if (attachmentType == AttachmentType.STANDARD_DOCUMENT
+        ) {
+            res.setData(handleFiles(res, "/standard/", false, req, sign, ""));
+        } else {
+            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "图片"));
+        }
+        return res;
+    }
+
+
+
+
+}

+ 18 - 0
src/main/java/com/goafanti/standard/service/StandardService.java

@@ -0,0 +1,18 @@
+package com.goafanti.standard.service;
+
+import com.goafanti.common.model.StandardDocument;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.standard.bo.InputStandardList;
+import com.goafanti.standard.bo.OutStandardDocument;
+
+public interface StandardService {
+    Object add(StandardDocument in);
+
+    Object delete(StandardDocument in);
+
+    Object update(StandardDocument in);
+
+    Pagination<OutStandardDocument> list(InputStandardList in);
+
+    Object get(StandardDocument in);
+}

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

@@ -0,0 +1,107 @@
+package com.goafanti.standard.service.impl;
+
+import com.goafanti.common.dao.StandardDocumentMapper;
+import com.goafanti.common.model.StandardDocument;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.standard.bo.InputStandardList;
+import com.goafanti.standard.bo.OutStandardDocument;
+import com.goafanti.standard.service.StandardService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class StandardServiceImpl extends BaseMybatisDao<StandardDocumentMapper> implements StandardService {
+    @Autowired
+    private StandardDocumentMapper standardDocumentMapper;
+    @Value("${upload.path}")
+    private String uploadPath;
+
+    @Override
+    public Object add(StandardDocument in) {
+        return standardDocumentMapper.insertSelective(in);
+    }
+
+    @Override
+    public Object delete(StandardDocument in) {
+        Long id = Long.valueOf(in.getId());
+        StandardDocument use = standardDocumentMapper.selectByPrimaryKey(id);
+        if (StringUtils.isNotEmpty(in.getUrl())){
+            deleteFile(use.getUrl());
+        }
+        return standardDocumentMapper.deleteByPrimaryKey(id);
+    }
+
+    private void deleteFile( String url) {
+        if (url.contains(",")){
+            String[] split = url.split(",");
+            for (String s : split) {
+                String filePath = uploadPath + "/" + s;
+                com.goafanti.common.utils.excel.FileUtils.deleteFile(filePath);
+            }
+        }else {
+            String filePath = uploadPath + "/" + url;
+            com.goafanti.common.utils.excel.FileUtils.deleteFile(filePath);
+        }
+
+    }
+
+    private void deleteFile(String url, String newURL) {
+        if(StringUtils.isBlank(newURL)){
+         deleteFile(url);
+        }else {
+            String[] newU = newURL.split(",");
+            String[] useU = url.split(",");
+            for (String s : useU) {
+                boolean flag = false;
+                for (String s1 : newU) {
+                    if (s.equals(s1)){
+                        flag = true;
+                        break;
+                    }
+                }
+                if (!flag){
+                    deleteFile(s);
+                }
+            }
+        }
+
+    }
+
+    @Override
+    public Object update(StandardDocument in) {
+        Long id = Long.valueOf(in.getId());
+        in.setUpdateTime(new Date());
+        StandardDocument use = standardDocumentMapper.selectByPrimaryKey(id);
+        if (StringUtils.isNotEmpty(use.getUrl())&&
+                use.getUrl().equals(in.getUrl())){
+            deleteFile(use.getUrl(),in.getUrl());
+        }
+        return standardDocumentMapper.updateByPrimaryKeySelective(in);
+    }
+
+
+
+    @Override
+    public Pagination<OutStandardDocument> list(InputStandardList in) {
+        Map<String,Object> params = new HashMap();
+        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");
+        if (in.getDepId()!=null)params.put("depId",in.getDepId());
+        if (in.getName()!=null)params.put("name",in.getName());
+        return (Pagination<OutStandardDocument>) findPage("standardList","standardCount",params,in.getPageNo(),in.getPageSize());
+    }
+
+    @Override
+    public Object get(StandardDocument in) {
+        return standardDocumentMapper.selectDetailsById(in.getId());
+
+    }
+}

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

@@ -1,16 +1,16 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 
-static.host=//static.jishutao.com/1.3.14
-#static.host=//172.16.1.187/1.3.14
+static.host=//static.jishutao.com/1.3.15
+#static.host=//172.16.1.187/1.3.15
 
-jdbc.url=jdbc\:mysql://localhost:3306/aft20240430?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#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
-jdbc.username=root
-jdbc.password=123456
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20
@@ -56,9 +56,9 @@ yxjl_max=100
 amb.maxLvl=6
 
 
-#avatar.host=//172.16.0.255:3000
+avatar.host=//172.16.1.199:3000
 #static.host=//172.16.0.255:3000/1.2.62
-avatar.host=//static.jishutao.com
+#avatar.host=//static.jishutao.com
 rd.static.host=//static.jishutao.com/RD/1.0.03
 
 #\u5FAE\u4FE1\u6253\u5361\u5C0F\u7A0B\u5E8F

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

@@ -1,5 +1,5 @@
 dev.name=test
-static.host=//static.jishutao.com/1.3.14
+static.host=//static.jishutao.com/1.3.15
 #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

+ 18 - 0
src/main/webapp/WEB-INF/views/admin/standard.html

@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org">
+<head th:replace="common::header(~{::title},~{::link})">
+	<title>科技成果页</title>
+	<link th:href="${staticHost+'/dll/dll.css'}" rel="stylesheet">
+	<link th:href="${staticHost+'/admin/standard.css'}" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	
+	<div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${staticHost+'/vendors.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/dll/dll.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/admin/standard.js'}"></script>
+	</div>
+</body>
+</html>