chenyuesheng 2 年 前
コミット
3896f2dfed

+ 43 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementBusinessTwoController.java

@@ -0,0 +1,43 @@
+package com.jeeplus.test.reimbursementAccountant.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
+import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessTwoService;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/accountant/reimbursementBusinessTwo")
+public class AccountantReimbursementBusinessTwoController {
+
+    @Autowired
+    private AccountantReimbursementBusinessTwoService accountantReimbursementBusinessTwoService;
+
+    @ApiLog("查询五票报销列表")
+    @RequestMapping("findListPage")
+    public ResponseEntity findListPage(AccountantReimbursementBusinessTwoDTO accountantReimbursementBusinessTwoDTO,Page<AccountantReimbursementBusinessTwoDTO> page){
+        IPage<AccountantReimbursementBusinessTwoDTO> listPage = accountantReimbursementBusinessTwoService.findListPage(page, accountantReimbursementBusinessTwoDTO);
+        return ResponseEntity.ok(listPage);
+    }
+
+    @ApiLog("根据id物理删除")
+    @RequestMapping("delById/{id}")
+    public ResponseEntity delById(@PathVariable("id")String id){
+        accountantReimbursementBusinessTwoService.delPhysicsById(id);
+        return ResponseEntity.ok("删除成功!");
+    }
+
+    @ApiLog("新增")
+    @RequestMapping("addData")
+    public ResponseEntity addData(@RequestBody AccountantReimbursementBusinessTwoDTO accountantReimbursementBusinessTwoDTO){
+        accountantReimbursementBusinessTwoService.addData(accountantReimbursementBusinessTwoDTO);
+        return ResponseEntity.ok("添加成功");
+    }
+}

+ 31 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementBusinessTwoDTO.java

@@ -0,0 +1,31 @@
+package com.jeeplus.test.reimbursementAccountant.domain.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Getter
+@Setter
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@TableName("zs_reimbursement_business_accountant_info")
+public class AccountantReimbursementBusinessTwoDTO extends BaseEntity {
+
+    private String businessCode;  //业务编号
+    private String businessCodeId;  //业务编号Id
+    private String userId;  //报销人id
+    private String userName;  //报销人
+    private String year;    //报销年份
+    private String reimbursementQuota;  //年报销额度
+    private String reimbursementQuotaDay;  //日报销额度
+    private String reimbursementDay;  //报销天数
+    private String surplusReimbursementDay;  //剩余报销天数
+    private String reimbursementType;  //报销类型(1:正常报销;2:补差)
+    private String reimbursementAmount;  //报销额度
+    private String remainReimbursementAmount;  //剩余报销额度
+    private String remarks; //备注
+}

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/AccountantReimbursementBusinessTwoMapper.java

@@ -0,0 +1,34 @@
+package com.jeeplus.test.reimbursementAccountant.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+
+@Mapper
+public interface AccountantReimbursementBusinessTwoMapper extends BaseMapper<AccountantReimbursementBusinessTwoDTO> {
+
+    /**
+     * 分页查询
+     */
+    IPage<AccountantReimbursementBusinessTwoDTO> findListPage(Page<AccountantReimbursementBusinessTwoDTO> page,
+                                                              @Param("accountantReimbursementBusiness")AccountantReimbursementBusinessTwoDTO accountantReimbursementBusiness);
+
+    /**
+     * 物理删除
+     * @param id
+     */
+    void delPhysicsById(@Param("id")String id);
+
+    /**
+     * 新增
+     */
+    void insertAccountantReimbursementBusiness(AccountantReimbursementBusinessTwoDTO accountantReimbursementBusiness);
+
+
+
+
+}

+ 96 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementBusinessTwoMapper.xml

@@ -0,0 +1,96 @@
+<?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.jeeplus.test.reimbursementAccountant.mapper.AccountantReimbursementBusinessTwoMapper">
+    <sql id="zsReimbursementBusinessAccountantInfoColumns">
+        a.id as 'id',
+        a.create_by as 'createBy',
+        a.create_date as 'createDate',
+        a.update_by as 'updateBy',
+        a.update_date as 'updateDate',
+        a.remarks as 'remarks',
+        a.del_flag as 'delFlag',
+        a.business_code_id as 'businessCodeId',
+        a.user_id as 'userId',
+        a.year as 'year',
+        a.reimbursement_day as 'reimbursementDay',
+        a.reimbursement_amount as 'reimbursementAmount',
+        a.reimbursement_type as 'reimbursementType'
+    </sql>
+    <sql id="joinZsReimbursementBusinessAccountantInfoColumns">
+        a.id as 'id',
+        a.create_by as 'createBy',
+        a.create_date as 'createDate',
+        a.update_by as 'updateBy',
+        a.update_date as 'updateDate',
+        a.remarks as 'remarks',
+        a.del_flag as 'delFlag',
+        a.business_code_id as 'businessCodeId',
+        a.user_id as 'userId',
+        a.year as 'year',
+        a.reimbursement_day as 'reimbursementDay',
+        a.reimbursement_amount as 'reimbursementAmount',
+        a.reimbursement_type as 'reimbursementType',
+        su.name as 'userName'
+    </sql>
+    <sql id="reimbursementUserJoinColumns">
+        left join sys_user su on su.id = a.user_id
+    </sql>
+    <insert id="insertAccountantReimbursementBusiness">
+        insert into zs_reimbursement_business_accountant_info
+        (
+                    id,
+            create_by,
+            create_date,
+            update_by,
+            update_date,
+            remarks,
+            del_flag,
+            business_code_id,
+            user_id,
+            year,
+            reimbursement_day,
+            reimbursement_amount,
+            reimbursement_type
+        )
+        values
+        (
+                    #{id},
+            #{createBy},
+            #{createDate},
+            #{updateBy},
+            #{updateDate},
+            #{remarks},
+            #{delFlag},
+            #{businessCodeId},
+            #{userId},
+            #{year},
+            #{reimbursementDay},
+            #{reimbursementAmount},
+            #{reimbursementType}
+        )
+    </insert>
+
+    <select id="findListPage"
+            resultType="com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO">
+        select
+        <include refid="joinZsReimbursementBusinessAccountantInfoColumns"/>
+        from zs_reimbursement_business_accountant_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0 and (a.business_code_id='' or a.business_code_id=null)
+            <if test="accountantReimbursementBusiness.year != null and accountantReimbursementBusiness.year != ''">
+                and a.year like concat('%',#{accountantReimbursementBusiness.year},'%')
+            </if>
+            <if test="accountantReimbursementBusiness.userId != null and accountantReimbursementBusiness.userId != ''">
+                and a.user_id = #{accountantReimbursementBusiness.userId}
+            </if>
+        </where>
+        order by a.update_date desc,a.year desc, a.user_id asc
+    </select>
+
+    <update id="delPhysicsById">
+        update zs_reimbursement_business_accountant_info
+        set del_flag = 1
+        where id = #{id}
+    </update>
+</mapper>

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/AccountantReimbursementBusinessTwoService.java

@@ -0,0 +1,14 @@
+package com.jeeplus.test.reimbursementAccountant.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
+
+public interface AccountantReimbursementBusinessTwoService {
+    IPage<AccountantReimbursementBusinessTwoDTO> findListPage(Page<AccountantReimbursementBusinessTwoDTO> page,
+                                                              AccountantReimbursementBusinessTwoDTO accountantReimbursementBusiness);
+
+    void delPhysicsById(String id);
+
+    void addData(AccountantReimbursementBusinessTwoDTO accountantReimbursementBusinessTwoDTO);
+}

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/impl/AccountantReimbursementBusinessTwoServiceImpl.java

@@ -0,0 +1,36 @@
+package com.jeeplus.test.reimbursementAccountant.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
+import com.jeeplus.test.reimbursementAccountant.mapper.AccountantReimbursementBusinessTwoMapper;
+import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessTwoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional(readOnly = true)
+public class AccountantReimbursementBusinessTwoServiceImpl implements AccountantReimbursementBusinessTwoService {
+
+    @Autowired
+    private AccountantReimbursementBusinessTwoMapper accountantReimbursementBusinessTwoMapper;
+
+    @Override
+    public IPage<AccountantReimbursementBusinessTwoDTO> findListPage(Page<AccountantReimbursementBusinessTwoDTO> page, AccountantReimbursementBusinessTwoDTO accountantReimbursementBusiness) {
+        return accountantReimbursementBusinessTwoMapper.findListPage(page,accountantReimbursementBusiness);
+    }
+
+    @Transactional(readOnly = false)
+    @Override
+    public void delPhysicsById(String id) {
+        accountantReimbursementBusinessTwoMapper.delPhysicsById(id);
+    }
+
+    @Transactional(readOnly = false)
+    @Override
+    public void addData(AccountantReimbursementBusinessTwoDTO accountantReimbursementBusinessTwoDTO) {
+        accountantReimbursementBusinessTwoDTO.preInsert();
+        accountantReimbursementBusinessTwoMapper.insertAccountantReimbursementBusiness(accountantReimbursementBusinessTwoDTO);
+    }
+}