Browse Source

Merge branch 'test' into dev

anderx 3 years ago
parent
commit
36255414d7

+ 39 - 0
src/main/java/com/goafanti/ambSystem/bo/InputAmbPayment.java

@@ -0,0 +1,39 @@
+package com.goafanti.ambSystem.bo;
+
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.model.AmbPaymentApplication;
+import com.goafanti.common.utils.Param;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+public class InputAmbPayment extends AmbPaymentApplication {
+
+    @Param(name="付款类型")
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private Integer type;
+
+    @Param(name="付款金额")
+    @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+    private BigDecimal totalAmount;
+
+    @Override
+    public Integer getType() {
+        return type;
+    }
+
+    @Override
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    @Override
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    @Override
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+}

+ 30 - 0
src/main/java/com/goafanti/ambSystem/controller/AmbApiController.java

@@ -20,6 +20,12 @@ public class AmbApiController extends CertifyApiController {
 	@Autowired
 	private AmbService ambService;
 
+	/**
+	 * 新增巴
+	 * @param in
+	 * @param bindingResult
+	 * @return
+	 */
 	@RequestMapping(value="/add",method = RequestMethod.POST)
 	public Result addAmb(@Validated InputAmb in,BindingResult bindingResult){
 		Result res =new Result();
@@ -37,6 +43,11 @@ public class AmbApiController extends CertifyApiController {
 		return res;
 	}
 
+	/**
+	 * 修改巴
+	 * @param in
+	 * @return
+	 */
 	@RequestMapping(value="/update",method = RequestMethod.POST)
 	public Result updateAmb( InputAmb in){
 		Result res =new Result();
@@ -48,6 +59,11 @@ public class AmbApiController extends CertifyApiController {
 		return res;
 	}
 
+	/**
+	 * 删除巴
+	 * @param in
+	 * @return
+	 */
 	@RequestMapping(value="/delete",method = RequestMethod.POST)
 	public Result deleteAmb( InputAmb in){
 		Result res =new Result();
@@ -64,6 +80,11 @@ public class AmbApiController extends CertifyApiController {
 		return res;
 	}
 
+	/**
+	 * 巴详情
+	 * @param in
+	 * @return
+	 */
 	@RequestMapping(value="/details",method = RequestMethod.GET)
 	public Result detailsAmb( InputAmb in){
 		Result res =new Result();
@@ -75,6 +96,11 @@ public class AmbApiController extends CertifyApiController {
 		return res;
 	}
 
+	/**
+	 * 巴列表
+	 * @param in
+	 * @return
+	 */
 	@RequestMapping(value="/select",method = RequestMethod.GET)
 	public Result selectAmb( InputAmb in){
 		Result res =new Result();
@@ -82,6 +108,10 @@ public class AmbApiController extends CertifyApiController {
 		return res;
 	}
 
+	/**
+	 * 下拉把列表
+	 * @return
+	 */
 	@RequestMapping(value="/selectAll",method = RequestMethod.GET)
 	public Result selectAll( ){
 		Result res =new Result();

+ 100 - 0
src/main/java/com/goafanti/ambSystem/controller/AmbPaymentApiController.java

@@ -0,0 +1,100 @@
+package com.goafanti.ambSystem.controller;
+
+import com.goafanti.ambSystem.bo.InputAmb;
+import com.goafanti.ambSystem.bo.InputAmbPayment;
+import com.goafanti.ambSystem.service.AmbPaymentService;
+import com.goafanti.ambSystem.service.AmbService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.utils.ParamUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+@RequestMapping(value = "/api/admin/ambPayment")
+public class AmbPaymentApiController extends CertifyApiController {
+	@Autowired
+	private AmbPaymentService ambPaymentService;
+
+	/**
+	 * 新增巴付款
+	 * @param in
+	 * @param bindingResult
+	 * @return
+	 */
+	@RequestMapping(value="/add",method = RequestMethod.POST)
+	public Result addAmb(@Validated InputAmbPayment in, BindingResult bindingResult){
+		Result res =new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
+			return res;
+		}
+		int i=ambPaymentService.checkAmbPayment(in);
+		if (i==-1){
+			res.getError().add(buildError(String.format("[%s]已存在,请确认后再新增",in.getName())));
+			return res;
+		}
+		res.data(ambService.addAmb(in));
+		return res;
+	}
+
+	@RequestMapping(value="/update",method = RequestMethod.POST)
+	public Result updateAmb( InputAmb in){
+		Result res =new Result();
+		if (in.getId()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"巴编号"));
+			return res;
+		}
+		res.data(ambService.updateAmb(in));
+		return res;
+	}
+
+	@RequestMapping(value="/delete",method = RequestMethod.POST)
+	public Result deleteAmb( InputAmb in){
+		Result res =new Result();
+		if (in.getId()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"巴编号"));
+			return res;
+		}
+		int i=ambService.checkAmb(in,2);
+		if (i==-1){
+			res.getError().add(buildError("巴存在子项目,请先删除所有子项"));
+			return res;
+		}
+		res.data(ambService.deleteAmb(in));
+		return res;
+	}
+
+	@RequestMapping(value="/details",method = RequestMethod.GET)
+	public Result detailsAmb( InputAmb in){
+		Result res =new Result();
+		if (in.getId()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"巴编号"));
+			return res;
+		}
+		res.data(ambService.detailsAmb(in));
+		return res;
+	}
+
+	@RequestMapping(value="/select",method = RequestMethod.GET)
+	public Result selectAmb( InputAmb in){
+		Result res =new Result();
+		res.data(ambService.selectAmb(in));
+		return res;
+	}
+
+	@RequestMapping(value="/selectAll",method = RequestMethod.GET)
+	public Result selectAll( ){
+		Result res =new Result();
+		res.data(ambService.selectAll());
+		return res;
+	}
+
+}

+ 7 - 0
src/main/java/com/goafanti/ambSystem/service/AmbPaymentService.java

@@ -0,0 +1,7 @@
+package com.goafanti.ambSystem.service;
+
+import com.goafanti.ambSystem.bo.InputAmbPayment;
+
+public interface AmbPaymentService {
+    int checkAmbPayment(InputAmbPayment in);
+}

+ 23 - 0
src/main/java/com/goafanti/ambSystem/service/Impl/AmbPaymentServiceImpl.java

@@ -0,0 +1,23 @@
+package com.goafanti.ambSystem.service.Impl;
+
+import com.goafanti.ambSystem.bo.InputAmbPayment;
+import com.goafanti.ambSystem.service.AmbPaymentService;
+import com.goafanti.common.dao.AmbPaymentApplicationMapper;
+import com.goafanti.common.dao.AmbSystemMapper;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AmbPaymentServiceImpl extends BaseMybatisDao<AmbPaymentApplicationMapper> implements AmbPaymentService {
+    @Autowired
+    private AmbPaymentApplicationMapper ambPaymentApplicationMapper;
+    @Autowired
+    private AmbSystemMapper ambSystemMapper;
+
+    @Override
+    public int checkAmbPayment(InputAmbPayment in) {
+
+        return 0;
+    }
+}

+ 17 - 0
src/main/java/com/goafanti/common/dao/AmbPaymentApplicationMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.AmbPaymentApplication;
+
+public interface AmbPaymentApplicationMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(AmbPaymentApplication record);
+
+    int insertSelective(AmbPaymentApplication record);
+
+    AmbPaymentApplication selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(AmbPaymentApplication record);
+
+    int updateByPrimaryKey(AmbPaymentApplication record);
+}

+ 182 - 0
src/main/java/com/goafanti/common/mapper/AmbPaymentApplicationMapper.xml

@@ -0,0 +1,182 @@
+<?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.AmbPaymentApplicationMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.AmbPaymentApplication">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
+    <result column="content" jdbcType="VARCHAR" property="content" />
+    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="annex_url" jdbcType="VARCHAR" property="annexUrl" />
+    <result column="process_status" jdbcType="INTEGER" property="processStatus" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="payment_amb_id" jdbcType="VARCHAR" property="paymentAmbId" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, `type`, total_amount, content, remarks, annex_url, process_status, `status`, 
+    create_by, create_time, update_by, update_time, payment_amb_id
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from amb_payment_application
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from amb_payment_application
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbPaymentApplication" useGeneratedKeys="true">
+    insert into amb_payment_application (`type`, total_amount, content, 
+      remarks, annex_url, process_status, 
+      `status`, create_by, create_time, 
+      update_by, update_time, payment_amb_id
+      )
+    values (#{type,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL}, #{content,jdbcType=VARCHAR}, 
+      #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, #{processStatus,jdbcType=INTEGER}, 
+      #{status,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{paymentAmbId,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbPaymentApplication" useGeneratedKeys="true">
+    insert into amb_payment_application
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="totalAmount != null">
+        total_amount,
+      </if>
+      <if test="content != null">
+        content,
+      </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
+      <if test="annexUrl != null">
+        annex_url,
+      </if>
+      <if test="processStatus != null">
+        process_status,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="paymentAmbId != null">
+        payment_amb_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="totalAmount != null">
+        #{totalAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="content != null">
+        #{content,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="annexUrl != null">
+        #{annexUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="processStatus != null">
+        #{processStatus,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createBy != null">
+        #{createBy,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="paymentAmbId != null">
+        #{paymentAmbId,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbPaymentApplication">
+    update amb_payment_application
+    <set>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="totalAmount != null">
+        total_amount = #{totalAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="content != null">
+        content = #{content,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="annexUrl != null">
+        annex_url = #{annexUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="processStatus != null">
+        process_status = #{processStatus,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="paymentAmbId != null">
+        payment_amb_id = #{paymentAmbId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AmbPaymentApplication">
+    update amb_payment_application
+    set `type` = #{type,jdbcType=INTEGER},
+      total_amount = #{totalAmount,jdbcType=DECIMAL},
+      content = #{content,jdbcType=VARCHAR},
+      remarks = #{remarks,jdbcType=VARCHAR},
+      annex_url = #{annexUrl,jdbcType=VARCHAR},
+      process_status = #{processStatus,jdbcType=INTEGER},
+      `status` = #{status,jdbcType=INTEGER},
+      create_by = #{createBy,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_by = #{updateBy,jdbcType=VARCHAR},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      payment_amb_id = #{paymentAmbId,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 179 - 0
src/main/java/com/goafanti/common/model/AmbPaymentApplication.java

@@ -0,0 +1,179 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * amb_payment_application
+ * @author 
+ */
+public class AmbPaymentApplication implements Serializable {
+    private Long id;
+
+    /**
+     * 类型 0=其他费用,1=内部结算,2=差旅(公对私报销),3=招待费,4=借款,5=工资奖金
+     */
+    private Integer type;
+
+    /**
+     * 金额
+     */
+    private BigDecimal totalAmount;
+
+    /**
+     * 内容及说明
+     */
+    private String content;
+
+    /**
+     * 内容及说明
+     */
+    private String remarks;
+
+    /**
+     * 附件地址
+     */
+    private String annexUrl;
+
+    /**
+     * 审核流程 0=发起,1=本巴主,2=付款巴主,3=付款事业部总,4=财务总监,5=集团副总,
+     */
+    private Integer processStatus;
+
+    /**
+     * 审核状态 0=审核,1=通过,2=拒绝
+     */
+    private Integer status;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新者
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 付款巴编号
+     */
+    private String paymentAmbId;
+
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getAnnexUrl() {
+        return annexUrl;
+    }
+
+    public void setAnnexUrl(String annexUrl) {
+        this.annexUrl = annexUrl;
+    }
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getPaymentAmbId() {
+        return paymentAmbId;
+    }
+
+    public void setPaymentAmbId(String paymentAmbId) {
+        this.paymentAmbId = paymentAmbId;
+    }
+}

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

@@ -52,7 +52,7 @@ yxjl_max=100
 amb.maxLvl=6
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.52
+static.host=//static.jishutao.com/1.2.53
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.27
 #static.host=http://172.16.1.187/prod/1.2.25

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

@@ -49,7 +49,7 @@ yxjl_max=100
 
 amb.maxLvl=6
 
-static.host=//static.jishutao.com/1.2.52
+static.host=//static.jishutao.com/1.2.53
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload