优化体验
This commit is contained in:
parent
1cc282975f
commit
75be542bd1
|
@ -102,4 +102,8 @@ public class ReportProd extends BaseEntity
|
|||
@ApiModelProperty("总价")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Excel(name = "工序代码")
|
||||
@ApiModelProperty("工序代码")
|
||||
private String priceCode;
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
brp.deleted,
|
||||
brp.price_type,
|
||||
brp.remark,
|
||||
brp.price_code,
|
||||
brp.total_amount,
|
||||
bp.dept_id as price_dept_id,
|
||||
br.status as report_status,
|
||||
|
@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.deleted == null">and brp.deleted = false</if>
|
||||
<if test="query.deleted != null">and brp.deleted = #{deleted}</if>
|
||||
<if test="query.reportStatus != null and query.reportStatus != ''">and br.status = #{query.reportStatus}</if>
|
||||
<if test="query.priceCode != null and query.priceCode != ''">and brp.price_code like concat('%', #{query.priceCode}, '%')</if>
|
||||
<if test="query.reportIds != null and query.reportIds.size() > 0">
|
||||
and brp.report_id in
|
||||
<foreach collection="query.reportIds" item="item" open="(" close=")" separator=",">
|
||||
|
@ -101,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="priceType != null and priceType != ''">price_type,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="totalAmount != null">total_amount,</if>
|
||||
<if test="priceCode != null">price_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">#{reportId},</if>
|
||||
|
@ -121,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="priceType != null and priceType != ''">#{priceType},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="totalAmount != null">#{totalAmount},</if>
|
||||
<if test="priceCode != null">#{priceCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -143,7 +147,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
price_quantity_denominator,
|
||||
price_type,
|
||||
remark,
|
||||
total_amount
|
||||
total_amount,
|
||||
price_code
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="i" separator=",">
|
||||
|
@ -184,6 +189,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="i.remark == null">default,</if>
|
||||
<if test="i.totalAmount != null">#{i.totalAmount},</if>
|
||||
<if test="i.totalAmount == null">default,</if>
|
||||
<if test="i.priceCode != null">#{i.priceCode},</if>
|
||||
<if test="i.priceCode == null">default,</if>
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
@ -215,6 +222,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.priceType != null and data.priceType != ''">price_type = #{data.priceType},</if>
|
||||
<if test="data.remark != null and data.remark != ''">remark = #{data.remark},</if>
|
||||
<if test="data.totalAmount != null">total_amount = #{data.totalAmount},</if>
|
||||
<if test="data.priceCode != null">price_code = #{data.priceCode},</if>
|
||||
</sql>
|
||||
|
||||
<update id="batchUpdate">
|
||||
|
@ -400,6 +408,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="price_code = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.priceCode != null">
|
||||
WHEN #{item.id} THEN #{item.priceCode}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `price_code`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||
|
|
|
@ -52,6 +52,7 @@ public class ReportProdConverterImpl implements ReportProdConverter {
|
|||
bo.setPriceType(vo.getPriceType());
|
||||
bo.setRemark(vo.getRemark());
|
||||
bo.setDefectNum(vo.getDefectNum());
|
||||
bo.setPriceCode(vo.getPriceCode());
|
||||
bo.setTotalAmount(vo.getPricePrice().multiply(vo.getNum().add(vo.getDefectNum())));
|
||||
|
||||
// 用户产量明细
|
||||
|
@ -102,6 +103,7 @@ public class ReportProdConverterImpl implements ReportProdConverter {
|
|||
bo.setPriceType(vo.getPriceType());
|
||||
bo.setRemark(vo.getRemark());
|
||||
bo.setDefectNum(vo.getDefectNum());
|
||||
bo.setPriceCode(vo.getPriceCode());
|
||||
bo.setTotalAmount(vo.getPricePrice().multiply(vo.getNum().add(vo.getDefectNum())));
|
||||
|
||||
// 用户产量明细
|
||||
|
|
|
@ -5,7 +5,6 @@ import lombok.Data;
|
|||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -32,4 +31,8 @@ public class ReportUserProdQuery extends ReportUserProdVO {
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate endDate;
|
||||
|
||||
@ApiModelProperty("报表日期范围")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private List<LocalDate> reportDateRange;
|
||||
|
||||
}
|
||||
|
|
|
@ -45,4 +45,12 @@ public class ReportUserProdVO extends ReportUserProd {
|
|||
@Excel(name = "工资(元)")
|
||||
@ApiModelProperty("工资")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Excel(name = "部门")
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Excel(name = "工序代码")
|
||||
@ApiModelProperty("工序代码")
|
||||
private String priceCode;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
brp.report_id as report_id,
|
||||
br.report_date as report_date,
|
||||
br.status as report_status,
|
||||
brp.price_price * brup.num as total_price
|
||||
brp.price_price * brup.num as total_price,
|
||||
brp.price_code as price_code,
|
||||
sd.dept_name as dept_name
|
||||
from bst_report_user_prod brup
|
||||
left join sys_user su on su.user_id = brup.user_id
|
||||
left join bst_report_prod brp on brp.id = brup.prod_id
|
||||
|
@ -48,6 +50,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.reportDateRange != null and query.reportDateRange.size() > 1">
|
||||
and date(br.report_date) >= #{query.reportDateRange[0]}
|
||||
and date(br.report_date) <= #{query.reportDateRange[1]}
|
||||
</if>
|
||||
${query.params.dataScope}
|
||||
</sql>
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.web.yh;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
@ -34,6 +35,7 @@ public class ReportUserProdController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:reportUserProd:list')")
|
||||
@GetMapping("/list")
|
||||
@DataScope(deptAlias = "sd")
|
||||
public TableDataInfo list(ReportUserProdQuery query)
|
||||
{
|
||||
startPage();
|
||||
|
|
Loading…
Reference in New Issue
Block a user