结算表开发
This commit is contained in:
parent
bc2a08303e
commit
6b1ebf97c5
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.bonus.material.lease.controller;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementRecord;
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementSlt;
|
||||||
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
|
import com.bonus.material.lease.service.ILeaseAgreementRecordService;
|
||||||
|
import com.bonus.material.lease.service.ILeaseAgreementSltService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目领退Controller
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2024-10-16
|
||||||
|
*/
|
||||||
|
@Api(tags = "结算列表接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/lease_agreement_slt")
|
||||||
|
public class LeaseAgreementSltController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ILeaseAgreementSltService leaseAgreementSltService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询列表")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(LeaseAgreementSlt leaseAgreementSlt) {
|
||||||
|
startPage();
|
||||||
|
List<LeaseAgreementSlt> list = leaseAgreementSltService.selectLeaseAgreementSltList(leaseAgreementSlt);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单据详细信息
|
||||||
|
* @param leaseAgreementSlt
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取单据详细信息")
|
||||||
|
//@RequiresPermissions("lease:info:query")
|
||||||
|
@GetMapping(value = "/getInfo")
|
||||||
|
public AjaxResult getInfo(LeaseAgreementSlt leaseAgreementSlt) {
|
||||||
|
return success(leaseAgreementSltService.getInfo(leaseAgreementSlt));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改数据")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
//@RequiresPermissions("lease:info:edit")
|
||||||
|
@PostMapping(value = "/updateInfo")
|
||||||
|
public AjaxResult edit(@RequestBody @NotNull LeaseAgreementSlt leaseAgreementSlt) {
|
||||||
|
try {
|
||||||
|
return toAjax(leaseAgreementSltService.updateLeaseSltInfo(leaseAgreementSlt));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("系统错误, " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
package com.bonus.material.lease.domain;
|
||||||
|
|
||||||
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目领退对象 lease_agreement_record
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2024-10-16
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class LeaseAgreementSlt extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 协议ID */
|
||||||
|
@Excel(name = "协议ID")
|
||||||
|
@ApiModelProperty(value = "协议ID")
|
||||||
|
private Long agreementId;
|
||||||
|
|
||||||
|
/** 机具规格ID */
|
||||||
|
@Excel(name = "机具规格ID")
|
||||||
|
@ApiModelProperty(value = "机具规格ID")
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
/** 机具ID */
|
||||||
|
@Excel(name = "机具ID")
|
||||||
|
@ApiModelProperty(value = "机具ID")
|
||||||
|
private Long maId;
|
||||||
|
|
||||||
|
/** 数量 */
|
||||||
|
@Excel(name = "数量")
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
private BigDecimal num;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@Excel(name = "状态")
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 领料时间 */
|
||||||
|
@ApiModelProperty(value = "领料时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "领料时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date outTime;
|
||||||
|
|
||||||
|
/** 领料任务 */
|
||||||
|
@Excel(name = "领料任务")
|
||||||
|
@ApiModelProperty(value = "领料任务")
|
||||||
|
private Long pickId;
|
||||||
|
|
||||||
|
/** 退料时间 */
|
||||||
|
@ApiModelProperty(value = "退料时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "退料时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date backTime;
|
||||||
|
|
||||||
|
/** 退料任务 */
|
||||||
|
@Excel(name = "退料任务")
|
||||||
|
@ApiModelProperty(value = "退料任务")
|
||||||
|
private Long backId;
|
||||||
|
|
||||||
|
/** 是否结算 */
|
||||||
|
@Excel(name = "是否结算")
|
||||||
|
@ApiModelProperty(value = "是否结算")
|
||||||
|
private String isSlt;
|
||||||
|
|
||||||
|
/** 结算时间 */
|
||||||
|
@ApiModelProperty(value = "结算时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "结算时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date sltTime;
|
||||||
|
|
||||||
|
/** 数据所属组织 */
|
||||||
|
@Excel(name = "数据所属组织")
|
||||||
|
@ApiModelProperty(value = "数据所属组织")
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/** 数量 */
|
||||||
|
@Excel(name = "租赁单价")
|
||||||
|
@ApiModelProperty(value = "租赁单价")
|
||||||
|
private BigDecimal leasePrice;
|
||||||
|
|
||||||
|
/** 操作标识 */
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "操作标识")
|
||||||
|
private String optFlag;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.bonus.material.lease.mapper;
|
||||||
|
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementRecord;
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementSlt;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目领退Mapper接口
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2024-10-16
|
||||||
|
*/
|
||||||
|
public interface LeaseAgreementSltMapper {
|
||||||
|
|
||||||
|
List<LeaseAgreementSlt> selectLeaseAgreementSltList(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
|
||||||
|
LeaseAgreementSlt getInfo(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
|
||||||
|
int updateLeaseSltInfo(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
|
||||||
|
int deleteLeaseSltInfo(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
|
||||||
|
int insertLeaseSltInfo(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.bonus.material.lease.service;
|
||||||
|
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementRecord;
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementSlt;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目领退Service接口
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2024-10-16
|
||||||
|
*/
|
||||||
|
public interface ILeaseAgreementSltService {
|
||||||
|
|
||||||
|
List<LeaseAgreementSlt> selectLeaseAgreementSltList(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
|
||||||
|
LeaseAgreementSlt getInfo(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
|
||||||
|
int updateLeaseSltInfo(LeaseAgreementSlt leaseAgreementSlt);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.bonus.material.lease.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementRecord;
|
||||||
|
import com.bonus.material.lease.domain.LeaseAgreementSlt;
|
||||||
|
import com.bonus.material.lease.mapper.LeaseAgreementRecordMapper;
|
||||||
|
import com.bonus.material.lease.mapper.LeaseAgreementSltMapper;
|
||||||
|
import com.bonus.material.lease.service.ILeaseAgreementRecordService;
|
||||||
|
import com.bonus.material.lease.service.ILeaseAgreementSltService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目领退Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2024-10-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LeaseAgreementSltServiceImpl implements ILeaseAgreementSltService {
|
||||||
|
@Autowired
|
||||||
|
private LeaseAgreementSltMapper leaseAgreementSltMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LeaseAgreementSlt> selectLeaseAgreementSltList(LeaseAgreementSlt leaseAgreementSlt) {
|
||||||
|
return leaseAgreementSltMapper.selectLeaseAgreementSltList(leaseAgreementSlt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LeaseAgreementSlt getInfo(LeaseAgreementSlt leaseAgreementSlt) {
|
||||||
|
return leaseAgreementSltMapper.getInfo(leaseAgreementSlt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateLeaseSltInfo(LeaseAgreementSlt leaseAgreementSlt) {
|
||||||
|
try {
|
||||||
|
String optFlag = leaseAgreementSlt.getOptFlag();
|
||||||
|
if ("update".equals(optFlag)) {
|
||||||
|
leaseAgreementSlt.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return leaseAgreementSltMapper.updateLeaseSltInfo(leaseAgreementSlt);
|
||||||
|
}
|
||||||
|
if ("delete".equals(optFlag)) {
|
||||||
|
leaseAgreementSlt.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return leaseAgreementSltMapper.deleteLeaseSltInfo(leaseAgreementSlt);
|
||||||
|
}
|
||||||
|
if ("insert".equals(optFlag)) {
|
||||||
|
leaseAgreementSlt.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return leaseAgreementSltMapper.insertLeaseSltInfo(leaseAgreementSlt);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException("系统错误, " + e.getMessage());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,140 @@
|
||||||
|
<?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.bonus.material.lease.mapper.LeaseAgreementSltMapper">
|
||||||
|
<resultMap type="com.bonus.material.lease.domain.LeaseAgreementSlt" id="LeaseAgreementRecordResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="agreementId" column="agreement_id" />
|
||||||
|
<result property="typeId" column="type_id" />
|
||||||
|
<result property="maId" column="ma_id" />
|
||||||
|
<result property="num" column="num" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="outTime" column="out_time" />
|
||||||
|
<result property="pickId" column="pick_id" />
|
||||||
|
<result property="backTime" column="back_time" />
|
||||||
|
<result property="backId" column="back_id" />
|
||||||
|
<result property="isSlt" column="is_slt" />
|
||||||
|
<result property="sltTime" column="slt_time" />
|
||||||
|
<result property="companyId" column="company_id" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectLeaseAgreementSltList" resultType="com.bonus.material.lease.domain.LeaseAgreementSlt">
|
||||||
|
SELECT
|
||||||
|
sai.id as id,
|
||||||
|
sai.agreement_id as agreementId,
|
||||||
|
sai.type_id as typeId,
|
||||||
|
sai.ma_id as maId,
|
||||||
|
sai.num as num,
|
||||||
|
sai.start_time as outTime,
|
||||||
|
sai.end_time as backTime,
|
||||||
|
sai.`status` as status,
|
||||||
|
sai.lease_id as pickId,
|
||||||
|
sai.back_id as backId,
|
||||||
|
sai.lease_price as leasePrice,
|
||||||
|
sai.is_slt as isSlt,
|
||||||
|
sai.slt_time as sltTime
|
||||||
|
FROM
|
||||||
|
slt_agreement_info sai
|
||||||
|
where 1=1
|
||||||
|
<if test="agreementId != null and agreementId != ''">
|
||||||
|
and sai.agreement_id = #{agreementId}
|
||||||
|
</if>
|
||||||
|
<if test="typeId != null and typeId != ''">
|
||||||
|
and sai.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
<if test="maId != null and maId != ''">
|
||||||
|
and sai.ma_id = #{maId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getInfo" resultType="com.bonus.material.lease.domain.LeaseAgreementSlt">
|
||||||
|
SELECT
|
||||||
|
sai.id as id,
|
||||||
|
sai.agreement_id as agreementId,
|
||||||
|
sai.type_id as typeId,
|
||||||
|
sai.ma_id as maId,
|
||||||
|
sai.num as num,
|
||||||
|
sai.start_time as outTime,
|
||||||
|
sai.end_time as backTime,
|
||||||
|
sai.`status` as status,
|
||||||
|
sai.lease_id as pickId,
|
||||||
|
sai.back_id as backId,
|
||||||
|
sai.lease_price as leasePrice,
|
||||||
|
sai.is_slt as isSlt,
|
||||||
|
sai.slt_time as sltTime
|
||||||
|
FROM
|
||||||
|
slt_agreement_info sai
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateLeaseSltInfo">
|
||||||
|
update slt_agreement_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="agreementId != null">agreement_id = #{agreementId},</if>
|
||||||
|
<if test="typeId != null">type_id = #{typeId},</if>
|
||||||
|
<if test="maId != null">ma_id = #{maId},</if>
|
||||||
|
<if test="num != null">num = #{num},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="outTime != null">start_time = #{outTime},</if>
|
||||||
|
<if test="pickId != null">lease_id = #{pickId},</if>
|
||||||
|
<if test="backTime != null">end_time = #{backTime},</if>
|
||||||
|
<if test="backId != null">back_id = #{backId},</if>
|
||||||
|
<if test="isSlt != null">is_slt = #{isSlt},</if>
|
||||||
|
<if test="leasePrice != null">lease_price = #{leasePrice},</if>
|
||||||
|
<if test="sltTime != null">slt_time = #{sltTime},</if>
|
||||||
|
<if test="companyId != null">company_id = #{companyId},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteLeaseSltInfo">
|
||||||
|
delete from slt_agreement_info where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="insertLeaseSltInfo">
|
||||||
|
|
||||||
|
insert into slt_agreement_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="agreementId != null">agreement_id,</if>
|
||||||
|
<if test="typeId != null">type_id,</if>
|
||||||
|
<if test="maId != null">ma_id,</if>
|
||||||
|
<if test="num != null">num,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="outTime != null">start_time,</if>
|
||||||
|
<if test="pickId != null">lease_id,</if>
|
||||||
|
<if test="backTime != null">end_time,</if>
|
||||||
|
<if test="backId != null">back_id,</if>
|
||||||
|
<if test="isSlt != null">is_slt,</if>
|
||||||
|
<if test="leasePrice != null">lease_price,</if>
|
||||||
|
<if test="sltTime != null">slt_time,</if>
|
||||||
|
<if test="companyId != null">company_id,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="agreementId != null">#{agreementId},</if>
|
||||||
|
<if test="typeId != null">#{typeId},</if>
|
||||||
|
<if test="maId != null">#{maId},</if>
|
||||||
|
<if test="num != null">#{num},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="outTime != null">#{outTime},</if>
|
||||||
|
<if test="pickId != null">#{pickId},</if>
|
||||||
|
<if test="backTime != null">#{backTime},</if>
|
||||||
|
<if test="backId != null">#{backId},</if>
|
||||||
|
<if test="isSlt != null">#{isSlt},</if>
|
||||||
|
<if test="leasePrice != null">#{leasePrice},</if>
|
||||||
|
<if test="sltTime != null">#{sltTime},</if>
|
||||||
|
<if test="companyId != null">#{companyId},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue