优化
This commit is contained in:
parent
ee640b2921
commit
53336a573a
|
@ -1,11 +1,13 @@
|
|||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 登录用户身份权限
|
||||
|
@ -132,6 +134,11 @@ public class LoginUser implements UserDetails
|
|||
return user.getUserName();
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
{
|
||||
return user.getNickName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 账户是否未过期,过期无法验证
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,8 @@ public enum LogBizType {
|
|||
PROD_ORDER("3", "生产订单" ),
|
||||
MATERIAL("4", "物料"),
|
||||
UNIT("5", "单位"),
|
||||
SHIFT("6", "调班");
|
||||
SHIFT("6", "调班"),
|
||||
REPORT_PROD("7", "报表产量");
|
||||
|
||||
private final String type;
|
||||
private final String msg;
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.ruoyi.dashboard.report.domain.dailyProd;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 工序每日产量VO
|
||||
*/
|
||||
@Data
|
||||
public class DailyProdVO {
|
||||
|
||||
@ApiModelProperty("工序")
|
||||
private String priceName;
|
||||
|
||||
@ApiModelProperty("类别")
|
||||
private String priceCategory;
|
||||
|
||||
@ApiModelProperty("大小")
|
||||
private String priceSize;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
private String priceUnit;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
private LocalDate reportDate;
|
||||
|
||||
@ApiModelProperty("产量")
|
||||
private BigDecimal totalNum;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.ruoyi.dashboard.report.domain.dailySalary;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户每日工资VO
|
||||
*/
|
||||
@Data
|
||||
public class UserDailySalaryVO {
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("用户名称")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("工号")
|
||||
private String userNo;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
private LocalDate reportDate;
|
||||
|
||||
@ApiModelProperty("总工资")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
}
|
|
@ -1,10 +1,14 @@
|
|||
package com.ruoyi.dashboard.report.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.dashboard.report.domain.dailyProd.DailyProdVO;
|
||||
import com.ruoyi.dashboard.report.domain.sum.ReportProdSumVO;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProdQuery;
|
||||
import com.ruoyi.yh.reportProd.mapper.ReportProdMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ReportProdDashboardService {
|
||||
|
@ -15,4 +19,8 @@ public class ReportProdDashboardService {
|
|||
public ReportProdSumVO selectSum(ReportProdQuery query) {
|
||||
return reportProdMapper.selectSum(query);
|
||||
}
|
||||
|
||||
public List<DailyProdVO> selectDailyProd(ReportProdQuery query) {
|
||||
return reportProdMapper.selectDailyProd(query);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package com.ruoyi.dashboard.report.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.dashboard.report.domain.dailySalary.UserDailySalaryVO;
|
||||
import com.ruoyi.dashboard.report.domain.sum.ReportUserProdSumVO;
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery;
|
||||
import com.ruoyi.yh.reportUserProd.mapper.ReportUserProdMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ReportUserProdDashboardService {
|
||||
|
@ -15,4 +19,11 @@ public class ReportUserProdDashboardService {
|
|||
public ReportUserProdSumVO selectSum(ReportUserProdQuery query) {
|
||||
return reportUserProdMapper.selectSum(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户工资统计
|
||||
*/
|
||||
public List<UserDailySalaryVO> selectDailySalary(ReportUserProdQuery query) {
|
||||
return reportUserProdMapper.selectDailySalary(query);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package com.ruoyi.yh.material.utils;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.yh.material.domain.vo.MaterialNumberSplitVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.yh.material.domain.vo.MaterialNumberSplitVO;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 物料工具类
|
||||
* @author wjh
|
||||
|
@ -43,13 +44,7 @@ public class MaterialUtil {
|
|||
vo.setCategory(split[3]);
|
||||
}
|
||||
if (split.length > 4) {
|
||||
String sizeString = split[4];
|
||||
try {
|
||||
vo.setSize(String.valueOf(Integer.parseInt(sizeString)));
|
||||
} catch (Exception e) {
|
||||
vo.setSize(sizeString);
|
||||
log.error("sizeString 转换异常", e);
|
||||
}
|
||||
vo.setSize(split[4]);
|
||||
}
|
||||
if (split.length > 5) {
|
||||
vo.setSurface(split[5]);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.ruoyi.yh.price.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/10/17
|
||||
|
@ -23,6 +23,9 @@ public class PriceQuery extends PriceVO {
|
|||
@ApiModelProperty("排除的单价ID列表")
|
||||
private List<Long> excludePriceIds;
|
||||
|
||||
@ApiModelProperty("排除的单价ID")
|
||||
private Long excludePriceId;
|
||||
|
||||
@ApiModelProperty("关键词")
|
||||
private String keyword;
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.yh.price.domain.dto;
|
||||
|
||||
import com.ruoyi.common.xss.Xss;
|
||||
import com.ruoyi.yh.price.domain.PriceQuery;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PricePropertyQuery extends PriceQuery {
|
||||
|
||||
@ApiModelProperty("属性")
|
||||
@Xss
|
||||
private String prop;
|
||||
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
package com.ruoyi.yh.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.ruoyi.yh.price.domain.Price;
|
||||
import com.ruoyi.yh.price.domain.PriceQuery;
|
||||
import com.ruoyi.yh.price.domain.PriceVO;
|
||||
import com.ruoyi.yh.price.domain.dto.PricePropertyQuery;
|
||||
import com.ruoyi.yh.price.domain.vo.PriceColumnCountVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单价Mapper接口
|
||||
|
@ -78,4 +80,14 @@ public interface PriceMapper
|
|||
* 批量审核
|
||||
*/
|
||||
int batchVerify(@Param("list") List<Price> list, @Param("query") PriceQuery query);
|
||||
|
||||
/**
|
||||
* 查询数量
|
||||
*/
|
||||
int selectCount(@Param("query") PriceQuery query);
|
||||
|
||||
/**
|
||||
* 查询属性值
|
||||
*/
|
||||
List<Object> selectProperty(@Param("query") PricePropertyQuery query);
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.eqCategory != null and query.eqCategory != ''"> and bp.category = #{query.eqCategory}</if>
|
||||
<if test="query.eqSize != null and query.eqSize != ''"> and bp.size = #{query.eqSize}</if>
|
||||
<if test="query.eqPattern != null and query.eqPattern != ''"> and bp.pattern = #{query.eqPattern}</if>
|
||||
<if test="query.excludePriceId != null"> and bp.price_id != #{query.excludePriceId}</if>
|
||||
<if test="query.needAllMatch != null and query.needAllMatch == true">
|
||||
<if test="query.eqName == null or query.eqName == ''">
|
||||
and (bp.name is null or bp.name = '')
|
||||
|
@ -341,4 +342,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="searchCondition"/>
|
||||
</update>
|
||||
|
||||
<!-- selectCount -->
|
||||
|
||||
<select id="selectCount">
|
||||
select count(bp.price_id)
|
||||
from bst_price bp
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- selectProperty -->
|
||||
|
||||
<select id="selectProperty">
|
||||
select distinct bp.${query.prop}
|
||||
from bst_price bp
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package com.ruoyi.yh.price.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.yh.price.domain.Price;
|
||||
import com.ruoyi.yh.price.domain.PriceQuery;
|
||||
import com.ruoyi.yh.price.domain.PriceVO;
|
||||
import com.ruoyi.yh.price.domain.dto.PriceImportParams;
|
||||
import com.ruoyi.yh.price.domain.dto.PricePropertyQuery;
|
||||
import com.ruoyi.yh.price.domain.dto.PriceVerifyDTO;
|
||||
import com.ruoyi.yh.price.domain.vo.PriceSearchConditionVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单价Service接口
|
||||
*
|
||||
|
@ -132,4 +133,9 @@ public interface PriceService
|
|||
* 查询一个
|
||||
*/
|
||||
PriceVO selectOne(PriceQuery query);
|
||||
|
||||
/**
|
||||
* 查询属性值
|
||||
*/
|
||||
List<Object> selectProperty(PricePropertyQuery query);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.ruoyi.yh.price.service;
|
||||
|
||||
import com.ruoyi.yh.price.domain.PriceVO;
|
||||
|
||||
public interface PriceValidator {
|
||||
|
||||
/**
|
||||
* 验证是否重复启用
|
||||
* @param vo
|
||||
*/
|
||||
void validateRepeatEnabled(PriceVO vo);
|
||||
|
||||
}
|
|
@ -1,5 +1,12 @@
|
|||
package com.ruoyi.yh.price.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
|
@ -10,12 +17,6 @@ import com.ruoyi.yh.price.domain.dto.PriceVerifyDTO;
|
|||
import com.ruoyi.yh.price.domain.dto.PriceVerifyPriceDTO;
|
||||
import com.ruoyi.yh.price.domain.enums.PriceStatus;
|
||||
import com.ruoyi.yh.price.service.PriceConverter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
|
@ -50,7 +51,7 @@ public class PriceConverterImpl implements PriceConverter {
|
|||
po.setCreateId(loginUser.getUserId());
|
||||
po.setQuantityDenominator(data.getQuantityDenominator());
|
||||
po.setQuantityNumerator(data.getQuantityNumerator());
|
||||
po.setCreateBy(loginUser.getUsername());
|
||||
po.setCreateBy(loginUser.getNickName());
|
||||
po.setRemark(data.getRemark());
|
||||
po.setSurface(data.getSurface());
|
||||
po.setCode(MaterialUtil.parseToCode(po.getCategory(), po.getSize(), po.getSurface(), po.getPattern()));
|
||||
|
@ -80,7 +81,7 @@ public class PriceConverterImpl implements PriceConverter {
|
|||
po.setQuantityDenominator(data.getQuantityDenominator());
|
||||
po.setQuantityNumerator(data.getQuantityNumerator());
|
||||
po.setUpdateId(loginUser.getUserId());
|
||||
po.setUpdateBy(loginUser.getUsername());
|
||||
po.setUpdateBy(loginUser.getNickName());
|
||||
po.setRemark(data.getRemark());
|
||||
po.setCode(MaterialUtil.parseToCode(po.getCategory(), po.getSize(), po.getSurface(), po.getPattern()));
|
||||
return po;
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
package com.ruoyi.yh.price.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.validation.Validator;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
@ -23,6 +37,7 @@ import com.ruoyi.yh.price.domain.Price;
|
|||
import com.ruoyi.yh.price.domain.PriceQuery;
|
||||
import com.ruoyi.yh.price.domain.PriceVO;
|
||||
import com.ruoyi.yh.price.domain.dto.PriceImportParams;
|
||||
import com.ruoyi.yh.price.domain.dto.PricePropertyQuery;
|
||||
import com.ruoyi.yh.price.domain.dto.PriceVerifyDTO;
|
||||
import com.ruoyi.yh.price.domain.dto.PriceVerifyPriceDTO;
|
||||
import com.ruoyi.yh.price.domain.enums.PriceColumn;
|
||||
|
@ -31,22 +46,12 @@ import com.ruoyi.yh.price.domain.vo.PriceSearchConditionVO;
|
|||
import com.ruoyi.yh.price.mapper.PriceMapper;
|
||||
import com.ruoyi.yh.price.service.PriceConverter;
|
||||
import com.ruoyi.yh.price.service.PriceService;
|
||||
import com.ruoyi.yh.price.service.PriceValidator;
|
||||
import com.ruoyi.yh.reportProd.domain.dto.ReportProdNewPriceDTO;
|
||||
import com.ruoyi.yh.reportProd.service.ReportProdConverter;
|
||||
import com.ruoyi.yh.reportProd.service.ReportProdService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import javax.validation.Validator;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 单价Service业务层处理
|
||||
|
@ -91,6 +96,9 @@ public class PriceServiceImpl implements PriceService
|
|||
@Autowired
|
||||
private PriceConverter priceConverter;
|
||||
|
||||
@Autowired
|
||||
private PriceValidator priceValidator;
|
||||
|
||||
/**
|
||||
* 查询单价
|
||||
*
|
||||
|
@ -125,7 +133,17 @@ public class PriceServiceImpl implements PriceService
|
|||
public int insertPrice(Price price)
|
||||
{
|
||||
price.setCreateTime(DateUtils.getNowDate());
|
||||
return priceMapper.insertPrice(price);
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
int insert = priceMapper.insertPrice(price);
|
||||
ServiceUtil.assertion(insert != 1, "新增单价失败");
|
||||
|
||||
// 判断是否有重复的单价
|
||||
PriceVO vo = selectPriceByPriceId(price.getPriceId());
|
||||
priceValidator.validateRepeatEnabled(vo);
|
||||
|
||||
return insert;
|
||||
});
|
||||
return result == null ? 0 : result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,6 +167,10 @@ public class PriceServiceImpl implements PriceService
|
|||
int update = this.updateByQuery(data, query);
|
||||
ServiceUtil.assertion(update != 1, "修改单价失败,当前单价已发生变化,请刷新后重试");
|
||||
|
||||
// 判断是否有重复的单价
|
||||
PriceVO vo = selectPriceByPriceId(data.getPriceId());
|
||||
priceValidator.validateRepeatEnabled(vo);
|
||||
|
||||
return update;
|
||||
});
|
||||
|
||||
|
@ -262,10 +284,16 @@ public class PriceServiceImpl implements PriceService
|
|||
int update = priceMapper.batchVerify(priceList, query);
|
||||
|
||||
if (pass && update > 0) {
|
||||
// 判断是否有重复的单价
|
||||
for (PriceVO vo : oldList) {
|
||||
priceValidator.validateRepeatEnabled(vo);
|
||||
}
|
||||
|
||||
// 若审核通过,则将通过的单价对应的报表中的单价更新
|
||||
List<PriceVO> passList = selectPassListByIds(priceIds);
|
||||
List<ReportProdNewPriceDTO> newPriceList = reportProdConverter.toNewPriceDTO(passList);
|
||||
reportProdService.batchUpdatePrice(newPriceList);
|
||||
|
||||
}
|
||||
|
||||
return update;
|
||||
|
@ -332,6 +360,10 @@ public class PriceServiceImpl implements PriceService
|
|||
int update = this.updateByQuery(data, query);
|
||||
ServiceUtil.assertion(update != 1, "启用单价失败,当前状态已发生变化,请刷新后重试");
|
||||
|
||||
// 判断是否有重复的单价
|
||||
PriceVO vo = selectPriceByPriceId(priceId);
|
||||
priceValidator.validateRepeatEnabled(vo);
|
||||
|
||||
return update;
|
||||
});
|
||||
|
||||
|
@ -484,4 +516,12 @@ public class PriceServiceImpl implements PriceService
|
|||
List<PriceVO> list = priceMapper.selectPriceList(query);
|
||||
return CollectionUtils.firstElement(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> selectProperty(PricePropertyQuery query) {
|
||||
if (query.getProp() == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return priceMapper.selectProperty(query);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package com.ruoyi.yh.price.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.yh.price.domain.PriceQuery;
|
||||
import com.ruoyi.yh.price.domain.PriceVO;
|
||||
import com.ruoyi.yh.price.domain.enums.PriceStatus;
|
||||
import com.ruoyi.yh.price.mapper.PriceMapper;
|
||||
import com.ruoyi.yh.price.service.PriceValidator;
|
||||
|
||||
@Service
|
||||
public class PriceValidatorImpl implements PriceValidator {
|
||||
|
||||
@Autowired
|
||||
private PriceMapper priceMapper;
|
||||
|
||||
@Override
|
||||
public void validateRepeatEnabled(PriceVO vo) {
|
||||
if (vo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
PriceQuery query = new PriceQuery();
|
||||
query.setStatus(PriceStatus.PASS.getStatus());
|
||||
query.setDisabled(false);
|
||||
query.setExcludePriceId(vo.getPriceId());
|
||||
query.setNeedAllMatch(true);
|
||||
query.setEqName(vo.getName());
|
||||
query.setEqCategory(vo.getCategory());
|
||||
query.setEqSize(vo.getSize());
|
||||
query.setEqPattern(vo.getPattern());
|
||||
|
||||
int count = priceMapper.selectCount(query);
|
||||
ServiceUtil.assertion(count > 0,
|
||||
"当前有重复的单价已启用,请检查。工序:%s,分类:%s,大小:%s,图案:%s",
|
||||
vo.getName(), vo.getCategory(), vo.getSize(), vo.getPattern()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,11 @@
|
|||
package com.ruoyi.yh.prodOrder.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/10/29
|
||||
|
@ -36,4 +37,7 @@ public class ProdOrderQuery extends ProdOrderVO {
|
|||
@ApiModelProperty("关键词")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("订单进度")
|
||||
private List<BigDecimal> progressRange;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.ruoyi.yh.prodOrder.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -15,4 +18,8 @@ public class ProdOrderVO extends ProdOrder {
|
|||
@ApiModelProperty("生产车间名称")
|
||||
private String workShopName;
|
||||
|
||||
@Excel(name = "订单进度")
|
||||
@ApiModelProperty("订单进度")
|
||||
private BigDecimal progress;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package com.ruoyi.yh.prodOrder.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.ruoyi.yh.prodOrder.domain.ProdOrder;
|
||||
import com.ruoyi.yh.prodOrder.domain.ProdOrderQuery;
|
||||
import com.ruoyi.yh.prodOrder.domain.ProdOrderVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产订单Mapper接口
|
||||
|
@ -71,6 +72,13 @@ public interface ProdOrderMapper
|
|||
*/
|
||||
int addVerifiedBaseNum(@Param("orderId") Long orderId, @Param("num") BigDecimal num);
|
||||
|
||||
/**
|
||||
* 减少已审核通过的基础数量
|
||||
* @param orderId 订单ID
|
||||
* @param num 基础数量
|
||||
*/
|
||||
int subtractVerifiedBaseNum(@Param("orderId") Long orderId, @Param("num") BigDecimal num);
|
||||
|
||||
/**
|
||||
* 查询简单列表
|
||||
*/
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
<resultMap type="ProdOrderVO" id="ProdOrderResult" autoMapping="true">
|
||||
<result property="matchPrices" column="match_prices" typeHandler="com.ruoyi.common.mybatis.typehandler.StringSplitListTypeHandler"/>
|
||||
<result property="progress" column="progress" typeHandler="com.ruoyi.common.mybatis.typehandler.NonNullDecimalTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProdOrderVo">
|
||||
|
@ -48,6 +49,7 @@
|
|||
bpo.erp_mto_no,
|
||||
bpo.faux_prop_id,
|
||||
bpo.faux_prop,
|
||||
(bpo.verified_base_num / bpo.erp_base_unit_qty) * 100 as progress,
|
||||
sd.dept_name as work_shop_name
|
||||
from bst_prod_order bpo
|
||||
left join sys_dept sd on sd.dept_id = bpo.dept_id
|
||||
|
@ -74,6 +76,12 @@
|
|||
<if test="query.erpMtoNo != null and query.erpMtoNo != ''"> and bpo.erp_mto_no = #{query.erpMtoNo}</if>
|
||||
<if test="query.fauxPropId != null and query.fauxPropId != ''"> and bpo.faux_prop_id = #{query.fauxPropId}</if>
|
||||
<if test="query.fauxProp != null and query.fauxProp != ''"> and bpo.faux_prop like concat('%', #{query.fauxProp}, '%')</if>
|
||||
<if test="query.progressRange != null and query.progressRange.size() > 0 and query.progressRange[0] != null">
|
||||
and (bpo.verified_base_num / bpo.erp_base_unit_qty) * 100 >= #{query.progressRange[0]}
|
||||
</if>
|
||||
<if test="query.progressRange != null and query.progressRange.size() > 1 and query.progressRange[1] != null">
|
||||
and (bpo.verified_base_num / bpo.erp_base_unit_qty) * 100 <= #{query.progressRange[1]}
|
||||
</if>
|
||||
<if test="query.materialNumber != null and query.materialNumber != ''">
|
||||
and bpo.material_number like concat('%',#{query.materialNumber},'%')
|
||||
</if>
|
||||
|
@ -245,6 +253,12 @@
|
|||
where id = #{orderId}
|
||||
</update>
|
||||
|
||||
<update id="subtractVerifiedBaseNum">
|
||||
update bst_prod_order
|
||||
set verified_base_num = verified_base_num - #{num}
|
||||
where id = #{orderId} and verified_base_num >= #{num}
|
||||
</update>
|
||||
|
||||
<update id="updateProdOrder" parameterType="ProdOrder">
|
||||
update bst_prod_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.ruoyi.yh.prodOrder.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.yh.prodOrder.domain.ProdOrder;
|
||||
import com.ruoyi.yh.prodOrder.domain.ProdOrderQuery;
|
||||
import com.ruoyi.yh.prodOrder.domain.ProdOrderVO;
|
||||
import com.ruoyi.yh.prodOrder.domain.dto.ProdOrderSyncQuery;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产订单Service接口
|
||||
*
|
||||
|
@ -88,6 +88,13 @@ public interface ProdOrderService
|
|||
*/
|
||||
int addVerifiedBaseNum(Long orderId, BigDecimal num);
|
||||
|
||||
/**
|
||||
* 减少已审核的基本单位数量
|
||||
* @param orderId 订单ID
|
||||
* @param num 减少数量
|
||||
*/
|
||||
int subtractVerifiedBaseNum(Long orderId, BigDecimal num);
|
||||
|
||||
/**
|
||||
* 查询简单列表
|
||||
*
|
||||
|
|
|
@ -270,13 +270,26 @@ public class ProdOrderServiceImpl implements ProdOrderService
|
|||
*/
|
||||
@Override
|
||||
public int addVerifiedBaseNum(Long orderId, BigDecimal num) {
|
||||
if (orderId == null || num == null) {
|
||||
if (orderId == null || num == null || num.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return 0;
|
||||
}
|
||||
return prodOrderMapper.addVerifiedBaseNum(orderId, num);
|
||||
}
|
||||
|
||||
/**
|
||||
* 减少已审核的基本单位数量
|
||||
*
|
||||
* @param orderId 订单ID
|
||||
* @param num 减少数量
|
||||
*/
|
||||
@Override
|
||||
public int subtractVerifiedBaseNum(Long orderId, BigDecimal num) {
|
||||
if (orderId == null || num == null || num.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return 0;
|
||||
}
|
||||
return prodOrderMapper.subtractVerifiedBaseNum(orderId, num);
|
||||
}
|
||||
|
||||
public List<ProdOrderVO> selectSimpleList(ProdOrderQuery query, String ...fields) {
|
||||
if (fields == null) {
|
||||
return Collections.emptyList();
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.ruoyi.yh.report.domain.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/10/31
|
||||
|
@ -16,9 +16,10 @@ import java.util.stream.Collectors;
|
|||
public enum ReportStatus {
|
||||
|
||||
WAIT_SUBMIT("1", "待提交"),
|
||||
WAIT_VERIFY("2", "待审核"),
|
||||
WAIT_VERIFY("2", "主管审核中"),
|
||||
PASS("3", "已通过"),
|
||||
REJECT("4", "未通过");
|
||||
REJECT("4", "未通过"),
|
||||
WAIT_FINANCE_VERIFY("5", "财务审核中");
|
||||
|
||||
private final String status;
|
||||
private final String msg;
|
||||
|
@ -28,12 +29,19 @@ public enum ReportStatus {
|
|||
}
|
||||
|
||||
/**
|
||||
* 允许审核的状态
|
||||
* 允许主管审核的状态
|
||||
*/
|
||||
public static List<String> canVerify() {
|
||||
return asList(WAIT_VERIFY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 允许财务审核的状态
|
||||
*/
|
||||
public static List<String> canFinanceVerify() {
|
||||
return asList(WAIT_FINANCE_VERIFY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 允许取消审核的状态
|
||||
*/
|
||||
|
@ -68,4 +76,11 @@ public enum ReportStatus {
|
|||
public static List<String> canDel() {
|
||||
return asList(WAIT_SUBMIT, REJECT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 允许反审核的状态
|
||||
*/
|
||||
public static List<String> canUnVerify() {
|
||||
return asList(WAIT_FINANCE_VERIFY, PASS);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.ruoyi.yh.report.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.yh.report.domain.Report;
|
||||
import com.ruoyi.yh.report.domain.ReportQuery;
|
||||
import com.ruoyi.yh.report.domain.ReportVO;
|
||||
import com.ruoyi.yh.report.domain.bo.ReportBO;
|
||||
import com.ruoyi.yh.report.domain.dto.ReportVerifyDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报表Service接口
|
||||
*
|
||||
|
@ -108,4 +108,17 @@ public interface ReportService
|
|||
* @param priceIds 单价ID列表
|
||||
*/
|
||||
int recalculateReportTotalAmountByPriceId(List<Long> priceIds);
|
||||
|
||||
/**
|
||||
* 反审核
|
||||
* @param reportId 报表ID
|
||||
*/
|
||||
int unVerify(Long reportId);
|
||||
|
||||
/**
|
||||
* 财务审核
|
||||
* @param dto 审核参数
|
||||
* @param userId 审核人ID
|
||||
*/
|
||||
int financeVerify(ReportVerifyDTO dto, Long userId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
package com.ruoyi.yh.report.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
|
@ -30,16 +40,10 @@ import com.ruoyi.yh.reportUserProd.domain.ReportUserProd;
|
|||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdVO;
|
||||
import com.ruoyi.yh.reportUserProd.domain.bo.ReportUserProdBO;
|
||||
import com.ruoyi.yh.reportUserProd.service.ReportUserProdService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import com.ruoyi.yh.verify.domain.Verify;
|
||||
import com.ruoyi.yh.verify.domain.enums.VerifyBstType;
|
||||
import com.ruoyi.yh.verify.domain.enums.VerifyStatus;
|
||||
import com.ruoyi.yh.verify.service.VerifyService;
|
||||
|
||||
/**
|
||||
* 报表Service业务层处理
|
||||
|
@ -77,6 +81,9 @@ public class ReportServiceImpl implements ReportService
|
|||
@Autowired
|
||||
private ReportAssembler reportAssembler;
|
||||
|
||||
@Autowired
|
||||
private VerifyService verifyService;
|
||||
|
||||
/**
|
||||
* 查询报表
|
||||
*
|
||||
|
@ -343,35 +350,82 @@ public class ReportServiceImpl implements ReportService
|
|||
|
||||
ReportVO report = selectReportByReportId(dto.getReportId());
|
||||
ServiceUtil.assertion(report == null, "待审核的报表不存在");
|
||||
ServiceUtil.assertion(!ReportStatus.canVerify().contains(report.getStatus()), "当前报表状态不允许审核,请刷新后重试");
|
||||
ServiceUtil.assertion(!ReportStatus.canVerify().contains(report.getStatus()), "当前报表状态不允许主管审核,请刷新后重试");
|
||||
// 拼接报表订单数据
|
||||
reportAssembler.assembleProductList(Collections.singletonList(report), false, false);
|
||||
|
||||
// 检查是否有无单价的产品
|
||||
List<ReportProdVO> prodList = report.getProductList();
|
||||
if (CollectionUtils.isNotEmptyElement(prodList)) {
|
||||
for (ReportProdVO prod : prodList) {
|
||||
ServiceUtil.assertion(prod.getPriceId() == null, "报表中存在无单价的工序,请先设置单价");
|
||||
}
|
||||
}
|
||||
|
||||
// 修改数据库
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
// 修改主表
|
||||
Report data = new Report();
|
||||
boolean pass = dto.getPass() != null && dto.getPass();
|
||||
data.setStatus(pass ? ReportStatus.WAIT_FINANCE_VERIFY.getStatus() : ReportStatus.REJECT.getStatus());
|
||||
ReportQuery query = new ReportQuery();
|
||||
query.setReportId(report.getReportId());
|
||||
query.setStatusList(ReportStatus.canVerify());
|
||||
int update = this.updateByQuery(data, query);
|
||||
ServiceUtil.assertion(update != 1, "审核失败,当前报表状态已发生变化,请刷新后重试");
|
||||
|
||||
// 新增审核记录
|
||||
Verify verify = new Verify();
|
||||
verify.setUserId(verifyId);
|
||||
verify.setBstType(VerifyBstType.REPORT.getCode());
|
||||
verify.setBstId(report.getReportId());
|
||||
verify.setStatus(pass ? VerifyStatus.PASS.getCode() : VerifyStatus.REJECT.getCode());
|
||||
verify.setReason(dto.getVerifyRemark());
|
||||
int verifyInsert = verifyService.insertVerify(verify);
|
||||
ServiceUtil.assertion(verifyInsert != 1, "新增审核记录失败");
|
||||
|
||||
return update;
|
||||
});
|
||||
|
||||
return result == null ? 0 : result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int financeVerify(ReportVerifyDTO dto, Long userId) {
|
||||
if (dto == null || dto.getReportId() == null) {
|
||||
return 0;
|
||||
}
|
||||
ReportVO report = selectReportByReportId(dto.getReportId());
|
||||
ServiceUtil.assertion(report == null, "待审核的报表不存在");
|
||||
ServiceUtil.assertion(!ReportStatus.canFinanceVerify().contains(report.getStatus()), "当前报表状态不允许财务审核,请刷新后重试");
|
||||
// 拼接报表订单数据
|
||||
reportAssembler.assembleProductList(Collections.singletonList(report), false, true);
|
||||
|
||||
// 组装修改数据
|
||||
Report data = new Report();
|
||||
SysUser verifyUser = userService.selectUserById(verifyId); // 审核人
|
||||
boolean pass = dto.getPass() != null && dto.getPass();
|
||||
data.setStatus(pass ? ReportStatus.PASS.getStatus() : ReportStatus.REJECT.getStatus());
|
||||
data.setVerifyRemark(dto.getVerifyRemark());
|
||||
data.setVerifyTime(LocalDateTime.now());
|
||||
if (verifyUser != null) {
|
||||
data.setVerifyBy(verifyUser.getNickName());
|
||||
data.setVerifyId(verifyUser.getUserId());
|
||||
}
|
||||
// 组装查询条件
|
||||
ReportQuery query = new ReportQuery();
|
||||
query.setReportId(report.getReportId());
|
||||
query.setStatusList(ReportStatus.canVerify());
|
||||
|
||||
// 获取订单数据
|
||||
List<ReportOrderProdVO> orderProdList = report.getProductList().stream()
|
||||
.map(ReportProdVO::getOrderProdList).flatMap(List::stream).collect(Collectors.toList());
|
||||
|
||||
// 修改数据库
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
// 修改主表
|
||||
Report data = new Report();
|
||||
boolean pass = dto.getPass() != null && dto.getPass();
|
||||
data.setStatus(pass ? ReportStatus.PASS.getStatus() : ReportStatus.REJECT.getStatus());
|
||||
ReportQuery query = new ReportQuery();
|
||||
query.setReportId(report.getReportId());
|
||||
query.setStatusList(ReportStatus.canFinanceVerify());
|
||||
int update = this.updateByQuery(data, query);
|
||||
ServiceUtil.assertion(update != 1, "审核失败,当前报表状态已发生变化,请刷新后重试");
|
||||
|
||||
// 新增审核记录
|
||||
Verify verify = new Verify();
|
||||
verify.setUserId(userId);
|
||||
verify.setBstType(VerifyBstType.REPORT.getCode());
|
||||
verify.setBstId(report.getReportId());
|
||||
verify.setStatus(pass ? VerifyStatus.PASS.getCode() : VerifyStatus.REJECT.getCode());
|
||||
verify.setReason(dto.getVerifyRemark());
|
||||
int verifyInsert = verifyService.insertVerify(verify);
|
||||
ServiceUtil.assertion(verifyInsert != 1, "新增审核记录失败");
|
||||
|
||||
// 关联的订单,全部增加已审核的数量
|
||||
for (ReportOrderProdVO orderProd : orderProdList) {
|
||||
if (orderProd == null) {
|
||||
|
@ -550,4 +604,54 @@ public class ReportServiceImpl implements ReportService
|
|||
query.setPriceIds(priceIds);
|
||||
return reportMapper.calcTotalAmount(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int unVerify(Long reportId) {
|
||||
ReportVO report = selectReportByReportId(reportId);
|
||||
ServiceUtil.assertion(report == null, "ID为%s的报表不存在", reportId);
|
||||
ServiceUtil.assertion(!ReportStatus.canUnVerify().contains(report.getStatus()), "报表当前状态不允许反审核");
|
||||
|
||||
// 不允许反审核上个月的报表
|
||||
boolean isBefore = report.getReportDate() != null
|
||||
&& LocalDate.now().isBefore(report.getReportDate().plusMonths(1));
|
||||
ServiceUtil.assertion(isBefore, "不允许反审核日期为 %s 的报表", report.getReportDate());
|
||||
|
||||
// 拼接报表订单数据
|
||||
reportAssembler.assembleProductList(Collections.singletonList(report), false, true);
|
||||
// 获取订单数据
|
||||
List<ReportOrderProdVO> orderProdList = report.getProductList().stream()
|
||||
.map(ReportProdVO::getOrderProdList).flatMap(List::stream).collect(Collectors.toList());
|
||||
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
Report data = new Report();
|
||||
data.setStatus(ReportStatus.WAIT_VERIFY.getStatus());
|
||||
ReportQuery query = new ReportQuery();
|
||||
query.setReportId(reportId);
|
||||
query.setStatus(report.getStatus());
|
||||
int update = this.updateByQuery(data, query);
|
||||
ServiceUtil.assertion(update != 1, "反审核失败,当前报表状态已发生变化,请刷新后重试");
|
||||
|
||||
// 反审核后,订单全部减少已审核的数量
|
||||
if (ReportStatus.PASS.getStatus().equals(report.getStatus())) {
|
||||
for (ReportOrderProdVO orderProd : orderProdList) {
|
||||
if (orderProd == null) {
|
||||
continue;
|
||||
}
|
||||
ServiceUtil.assertion(orderProd.getOrderId() == null
|
||||
|| orderProd.getNum() == null
|
||||
|| orderProd.getPriceQuantityNumerator() == null
|
||||
|| orderProd.getPriceQuantityDenominator() == null,
|
||||
"修改订单审核数量出错:参数错误"
|
||||
);
|
||||
BigDecimal baseNum = ReportUtils.calcOrderProdBaseNum(orderProd);
|
||||
int subtract = prodOrderService.subtractVerifiedBaseNum(orderProd.getOrderId(), baseNum);
|
||||
ServiceUtil.assertion(subtract != 1, "更新关联订单失败");
|
||||
}
|
||||
}
|
||||
|
||||
return update;
|
||||
});
|
||||
|
||||
return result == null ? 0 : result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package com.ruoyi.yh.reportProd.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/10/31
|
||||
|
@ -26,4 +27,13 @@ public class ReportProdQuery extends ReportProdVO {
|
|||
|
||||
@ApiModelProperty("ID列表")
|
||||
private List<Long> ids;
|
||||
|
||||
@ApiModelProperty("精准工序名称")
|
||||
private String eqPriceName;
|
||||
|
||||
@ApiModelProperty("精准工序类别")
|
||||
private String eqPriceCategory;
|
||||
|
||||
@ApiModelProperty("精准工序大小")
|
||||
private String eqPriceSize;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package com.ruoyi.yh.reportProd.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.ruoyi.common.vo.LongIntegerVO;
|
||||
import com.ruoyi.dashboard.report.domain.dailyProd.DailyProdVO;
|
||||
import com.ruoyi.dashboard.report.domain.sum.ReportProdSumVO;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProd;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProdQuery;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProdVO;
|
||||
import com.ruoyi.yh.reportProd.domain.dto.ReportProdNewPriceDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报表产量Mapper接口
|
||||
|
@ -110,4 +112,9 @@ public interface ReportProdMapper
|
|||
* 查询报表产量统计
|
||||
*/
|
||||
ReportProdSumVO selectSum(@Param("query") ReportProdQuery query);
|
||||
|
||||
/**
|
||||
* 查询工序每日产量
|
||||
*/
|
||||
List<DailyProdVO> selectDailyProd(@Param("query") ReportProdQuery query);
|
||||
}
|
||||
|
|
|
@ -47,9 +47,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="searchTables">
|
||||
bst_report_prod brp
|
||||
left join bst_report br on br.report_id = brp.report_id
|
||||
left join bst_price bp on bp.price_id = brp.price_id
|
||||
left join sys_dept sd on sd.dept_id = br.dept_id
|
||||
left join bst_report br on br.report_id = brp.report_id
|
||||
left join bst_price bp on bp.price_id = brp.price_id
|
||||
left join sys_dept sd on sd.dept_id = br.dept_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
|
@ -75,6 +75,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.readPrice != null"> and brp.read_price = #{query.readPrice}</if>
|
||||
<if test="query.priceStatus != null and query.priceStatus != ''"> and bp.status = #{query.priceStatus}</if>
|
||||
<if test="query.deptId != null"> and sd.dept_id = #{query.deptId}</if>
|
||||
<if test="query.eqPriceName != null and query.eqPriceName != ''"> and brp.price_name = #{query.eqPriceName}</if>
|
||||
<if test="query.eqPriceCategory != null and query.eqPriceCategory != ''"> and brp.price_category = #{query.eqPriceCategory}</if>
|
||||
<if test="query.eqPriceSize != null and query.eqPriceSize != ''"> and brp.price_size = #{query.eqPriceSize}</if>
|
||||
<if test="query.priceMatch != null">
|
||||
and brp.price_id is <if test="query.priceMatch">not</if> null
|
||||
</if>
|
||||
|
@ -614,7 +617,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item.id}
|
||||
</foreach>
|
||||
and brp.deleted = false
|
||||
and brp.price_id is null
|
||||
and br.status in ('1', '4')
|
||||
</update>
|
||||
|
||||
|
@ -655,4 +657,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<!-- selectDailyProd -->
|
||||
|
||||
<resultMap id="DailyProdVO" type="com.ruoyi.dashboard.report.domain.dailyProd.DailyProdVO">
|
||||
<result property="totalNum" column="total_num" typeHandler="com.ruoyi.common.mybatis.typehandler.NonNullDecimalTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDailyProd" resultMap="DailyProdVO">
|
||||
select
|
||||
brp.price_name,
|
||||
brp.price_category,
|
||||
brp.price_size,
|
||||
brp.price_unit,
|
||||
br.report_date as report_date,
|
||||
sum(brp.num) as total_num
|
||||
from <include refid="searchTables"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
group by brp.price_name, brp.price_category, brp.price_size, brp.price_unit, br.report_date
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
package com.ruoyi.yh.reportProd.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
import com.ruoyi.common.vo.LongIntegerVO;
|
||||
|
@ -15,15 +25,6 @@ import com.ruoyi.yh.reportProd.mapper.ReportProdMapper;
|
|||
import com.ruoyi.yh.reportProd.service.ReportProdConverter;
|
||||
import com.ruoyi.yh.reportProd.service.ReportProdService;
|
||||
import com.ruoyi.yh.reportUserProd.service.ReportUserProdService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 报表产量Service业务层处理
|
||||
|
|
|
@ -37,4 +37,8 @@ public class ReportUserProd extends BaseEntity
|
|||
@Min(value = 0, message = "产量不允许小于0")
|
||||
private BigDecimal num;
|
||||
|
||||
@Excel(name = "是否充公", readConverterExp = "false=否,true=是")
|
||||
@ApiModelProperty("是否充公")
|
||||
private Boolean confiscate;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package com.ruoyi.yh.reportUserProd.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/11/2
|
||||
|
@ -35,4 +36,7 @@ public class ReportUserProdQuery extends ReportUserProdVO {
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private List<LocalDate> reportDateRange;
|
||||
|
||||
@ApiModelProperty("用户ID列表")
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package com.ruoyi.yh.reportUserProd.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.ruoyi.dashboard.report.domain.dailySalary.UserDailySalaryVO;
|
||||
import com.ruoyi.dashboard.report.domain.sum.ReportUserProdSumVO;
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProd;
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery;
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdVO;
|
||||
import com.ruoyi.yh.reportUserProd.domain.vo.ReportUserProdGroupByDateVO;
|
||||
import com.ruoyi.yh.reportUserProd.domain.vo.ReportUserProdGroupByYearMonthVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工产量Mapper接口
|
||||
|
@ -97,4 +99,9 @@ public interface ReportUserProdMapper
|
|||
* 查询报表产量统计
|
||||
*/
|
||||
ReportUserProdSumVO selectSum(@Param("query") ReportUserProdQuery query);
|
||||
|
||||
/**
|
||||
* 查询用户每日工资
|
||||
*/
|
||||
public List<UserDailySalaryVO> selectDailySalary(@Param("query") ReportUserProdQuery query);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
brup.user_id,
|
||||
brup.num,
|
||||
brup.deleted,
|
||||
brup.confiscate,
|
||||
su.nick_name as user_name,
|
||||
su.user_no as user_no,
|
||||
brp.price_name as price_name,
|
||||
|
@ -62,6 +63,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.priceSize != null and query.priceSize != ''">and brp.price_size like concat('%', #{query.priceSize}, '%')</if>
|
||||
<if test="query.pricePattern != null and query.pricePattern != ''">and brp.price_pattern like concat('%', #{query.pricePattern}, '%')</if>
|
||||
<if test="query.deptId != null">and br.dept_id = #{query.deptId}</if>
|
||||
<if test="query.confiscate != null">and brup.confiscate = #{query.confiscate}</if>
|
||||
<if test="query.userIds != null and query.userIds.size() > 0 ">
|
||||
and brup.user_id in
|
||||
<foreach item="item" collection="query.userIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.prodIds != null and query.prodIds.size() > 0 ">
|
||||
and brup.prod_id in
|
||||
<foreach item="item" collection="query.prodIds" open="(" separator="," close=")">
|
||||
|
@ -100,9 +108,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sum(if (br.status = '3', brp.price_price * brup.num, 0 )) as verified,
|
||||
sum(if (br.status = '2', brp.price_price * brup.num, 0 )) as verifying
|
||||
from bst_report_user_prod brup
|
||||
left join bst_report_prod brp on brp.id = brup.prod_id
|
||||
left join bst_report br on br.report_id = brp.report_id
|
||||
left join sys_dept sd on sd.dept_id = br.dept_id
|
||||
left join bst_report_prod brp on brp.id = brup.prod_id
|
||||
left join bst_report br on br.report_id = brp.report_id
|
||||
left join sys_dept sd on sd.dept_id = br.dept_id
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
|
@ -137,12 +145,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="userId != null">user_id,</if>
|
||||
<if test="num != null">num,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="confiscate != null">confiscate,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="prodId != null">#{prodId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="num != null">#{num},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="confiscate != null">#{confiscate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -151,7 +161,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
prod_id,
|
||||
user_id,
|
||||
num,
|
||||
deleted
|
||||
deleted,
|
||||
confiscate
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="i" separator=",">
|
||||
|
@ -164,6 +175,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="i.num == null">default,</if>
|
||||
<if test="i.deleted != null">#{i.deleted},</if>
|
||||
<if test="i.deleted == null">default,</if>
|
||||
<if test="i.confiscate != null">#{i.confiscate},</if>
|
||||
<if test="i.confiscate == null">default,</if>
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
@ -181,6 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.userId != null">user_id = #{data.userId},</if>
|
||||
<if test="data.num != null">num = #{data.num},</if>
|
||||
<if test="data.deleted != null">deleted = #{data.deleted},</if>
|
||||
<if test="data.confiscate != null">confiscate = #{data.confiscate},</if>
|
||||
</sql>
|
||||
|
||||
<update id="batchUpdate">
|
||||
|
@ -226,6 +240,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="confiscate = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.confiscate != null">
|
||||
WHEN #{item.id} THEN #{item.confiscate}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `confiscate`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach collection="list" open="(" close=")" item="item" separator=",">
|
||||
|
@ -278,4 +302,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<!-- selectDailySalary -->
|
||||
<resultMap id="UserDailySalaryVO" type="UserDailySalaryVO">
|
||||
<result property="totalPrice" column="total_price" typeHandler="com.ruoyi.common.mybatis.typehandler.NonNullDecimalTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDailySalary" resultMap="UserDailySalaryVO">
|
||||
select
|
||||
brup.user_id as user_id,
|
||||
su.nick_name as user_name,
|
||||
su.user_no as user_no,
|
||||
br.report_date as report_date,
|
||||
sum(brp.price_price * brup.num) as total_price
|
||||
from <include refid="searchTables"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
group by brup.user_id, su.nick_name, su.user_no, br.report_date
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package com.ruoyi.yh.reportUserProd.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdVO;
|
||||
import com.ruoyi.yh.reportUserProd.domain.bo.ReportUserProdBO;
|
||||
import com.ruoyi.yh.reportUserProd.service.ReportUserProdConverter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
|
@ -26,6 +27,7 @@ public class ReportUserProdConverterImpl implements ReportUserProdConverter {
|
|||
ReportUserProdBO bo = new ReportUserProdBO();
|
||||
bo.setUserId(vo.getUserId());
|
||||
bo.setNum(vo.getNum());
|
||||
bo.setConfiscate(vo.getConfiscate());
|
||||
return bo;
|
||||
}
|
||||
|
||||
|
@ -34,11 +36,11 @@ public class ReportUserProdConverterImpl implements ReportUserProdConverter {
|
|||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ReportUserProdBO bo = new ReportUserProdBO();
|
||||
bo.setId(vo.getId());
|
||||
bo.setUserId(vo.getUserId());
|
||||
bo.setNum(vo.getNum());
|
||||
bo.setConfiscate(vo.getConfiscate());
|
||||
return bo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package com.ruoyi.yh.verify.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 审核记录对象 bst_verify
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
@Data
|
||||
public class Verify extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "审核人ID")
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Long userId;
|
||||
|
||||
@Excel(name = "业务类型")
|
||||
@ApiModelProperty("业务类型")
|
||||
private String bstType;
|
||||
|
||||
@Excel(name = "业务ID")
|
||||
@ApiModelProperty("业务ID")
|
||||
private Long bstId;
|
||||
|
||||
@Excel(name = "状态", readConverterExp = "1=通过,2=未通过")
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "审核意见")
|
||||
@ApiModelProperty("审核意见")
|
||||
private String reason;
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.ruoyi.yh.verify.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VerifyQuery extends VerifyVO {
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.ruoyi.yh.verify.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VerifyVO extends Verify {
|
||||
|
||||
// 用户名称
|
||||
private String userName;
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.yh.verify.domain.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum VerifyBstType {
|
||||
|
||||
REPORT("1", "报表");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.yh.verify.domain.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum VerifyStatus {
|
||||
PASS("1", "通过"),
|
||||
REJECT("2", "驳回");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.ruoyi.yh.verify.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.yh.verify.domain.Verify;
|
||||
import com.ruoyi.yh.verify.domain.VerifyVO;
|
||||
import com.ruoyi.yh.verify.domain.VerifyQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 审核记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
public interface VerifyMapper
|
||||
{
|
||||
/**
|
||||
* 查询审核记录
|
||||
*
|
||||
* @param id 审核记录主键
|
||||
* @return 审核记录
|
||||
*/
|
||||
VerifyVO selectVerifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询审核记录列表
|
||||
*
|
||||
* @param query 审核记录
|
||||
* @return 审核记录集合
|
||||
*/
|
||||
List<VerifyVO> selectVerifyList(@Param("query")VerifyQuery query);
|
||||
|
||||
/**
|
||||
* 新增审核记录
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertVerify(Verify verify);
|
||||
|
||||
/**
|
||||
* 批量新增审核记录
|
||||
*/
|
||||
int batchInsert(@Param("list") List<? extends Verify> list);
|
||||
|
||||
/**
|
||||
* 批量修改审核记录
|
||||
*/
|
||||
int batchUpdate(@Param("list") List<? extends Verify> list);
|
||||
|
||||
/**
|
||||
* 修改审核记录
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateVerify(@Param("data") Verify verify);
|
||||
|
||||
/**
|
||||
* 删除审核记录
|
||||
*
|
||||
* @param id 审核记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteVerifyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除审核记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVerifyByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
<?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.ruoyi.yh.verify.mapper.VerifyMapper">
|
||||
|
||||
<resultMap type="VerifyVO" id="VerifyResult" autoMapping="true"/>
|
||||
|
||||
<sql id="selectVerifyVo">
|
||||
select
|
||||
bv.id,
|
||||
bv.user_id,
|
||||
bv.bst_type,
|
||||
bv.bst_id,
|
||||
bv.status,
|
||||
bv.reason,
|
||||
bv.create_time,
|
||||
su.nick_name as user_name
|
||||
from bst_verify bv
|
||||
left join sys_user su on su.user_id = bv.user_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.id != null "> and bv.id = #{query.id}</if>
|
||||
<if test="query.userId != null "> and bv.user_id = #{query.userId}</if>
|
||||
<if test="query.bstType != null and query.bstType != ''"> and bv.bst_type = #{query.bstType}</if>
|
||||
<if test="query.bstId != null "> and bst_id = #{query.bstId}</if>
|
||||
<if test="query.status != null and query.status != ''"> and bv.status = #{query.status}</if>
|
||||
<if test="query.reason != null and query.reason != ''"> and bv.reason like concat('%', #{query.reason}, '%')</if>
|
||||
<if test="query.userName != null and query.userName != ''"> and su.nick_name like concat('%', #{query.userName}, '%')</if>
|
||||
${query.params.dataScope}
|
||||
</sql>
|
||||
|
||||
<select id="selectVerifyList" parameterType="VerifyQuery" resultMap="VerifyResult">
|
||||
<include refid="selectVerifyVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectVerifyById" parameterType="Long" resultMap="VerifyResult">
|
||||
<include refid="selectVerifyVo"/>
|
||||
where bv.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertVerify" parameterType="Verify" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bst_verify
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="bstType != null and bstType != ''">bst_type,</if>
|
||||
<if test="bstId != null">bst_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="reason != null">reason,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="bstType != null and bstType != ''">#{bstType},</if>
|
||||
<if test="bstId != null">#{bstId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="reason != null">#{reason},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateVerify" parameterType="Verify">
|
||||
update bst_verify
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where id = #{data.id}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.userId != null">user_id = #{data.userId},</if>
|
||||
<if test="data.bstType != null and data.bstType != ''">bst_type = #{data.bstType},</if>
|
||||
<if test="data.bstId != null">bst_id = #{data.bstId},</if>
|
||||
<if test="data.status != null and data.status != ''">status = #{data.status},</if>
|
||||
<if test="data.reason != null">reason = #{data.reason},</if>
|
||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteVerifyById" parameterType="Long">
|
||||
delete from bst_verify where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteVerifyByIds" parameterType="String">
|
||||
delete from bst_verify where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.yh.verify.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.yh.verify.domain.Verify;
|
||||
import com.ruoyi.yh.verify.domain.VerifyQuery;
|
||||
import com.ruoyi.yh.verify.domain.VerifyVO;
|
||||
|
||||
/**
|
||||
* 审核记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
public interface VerifyService
|
||||
{
|
||||
/**
|
||||
* 查询审核记录
|
||||
*
|
||||
* @param id 审核记录主键
|
||||
* @return 审核记录
|
||||
*/
|
||||
public VerifyVO selectVerifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询审核记录列表
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 审核记录集合
|
||||
*/
|
||||
public List<VerifyVO> selectVerifyList(VerifyQuery verify);
|
||||
|
||||
/**
|
||||
* 新增审核记录
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertVerify(Verify verify);
|
||||
|
||||
/**
|
||||
* 修改审核记录
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateVerify(Verify verify);
|
||||
|
||||
/**
|
||||
* 批量删除审核记录
|
||||
*
|
||||
* @param ids 需要删除的审核记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVerifyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除审核记录信息
|
||||
*
|
||||
* @param id 审核记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVerifyById(Long id);
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
package com.ruoyi.yh.verify.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.yh.verify.domain.Verify;
|
||||
import com.ruoyi.yh.verify.domain.VerifyQuery;
|
||||
import com.ruoyi.yh.verify.domain.VerifyVO;
|
||||
import com.ruoyi.yh.verify.mapper.VerifyMapper;
|
||||
import com.ruoyi.yh.verify.service.VerifyService;
|
||||
|
||||
/**
|
||||
* 审核记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
@Service
|
||||
public class VerifyServiceImpl implements VerifyService
|
||||
{
|
||||
@Autowired
|
||||
private VerifyMapper verifyMapper;
|
||||
|
||||
/**
|
||||
* 查询审核记录
|
||||
*
|
||||
* @param id 审核记录主键
|
||||
* @return 审核记录
|
||||
*/
|
||||
@Override
|
||||
public VerifyVO selectVerifyById(Long id)
|
||||
{
|
||||
return verifyMapper.selectVerifyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询审核记录列表
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 审核记录
|
||||
*/
|
||||
@Override
|
||||
public List<VerifyVO> selectVerifyList(VerifyQuery verify)
|
||||
{
|
||||
return verifyMapper.selectVerifyList(verify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增审核记录
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertVerify(Verify verify)
|
||||
{
|
||||
verify.setCreateTime(DateUtils.getNowDate());
|
||||
return verifyMapper.insertVerify(verify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改审核记录
|
||||
*
|
||||
* @param verify 审核记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateVerify(Verify verify)
|
||||
{
|
||||
return verifyMapper.updateVerify(verify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除审核记录
|
||||
*
|
||||
* @param ids 需要删除的审核记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteVerifyByIds(Long[] ids)
|
||||
{
|
||||
return verifyMapper.deleteVerifyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除审核记录信息
|
||||
*
|
||||
* @param id 审核记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteVerifyById(Long id)
|
||||
{
|
||||
return verifyMapper.deleteVerifyById(id);
|
||||
}
|
||||
}
|
|
@ -1,15 +1,22 @@
|
|||
package com.ruoyi.web.dashboard;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.dashboard.report.service.ReportProdDashboardService;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProdQuery;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.dashboard.report.domain.dailyProd.DailyProdVO;
|
||||
import com.ruoyi.dashboard.report.service.ReportProdDashboardService;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProdQuery;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dashboard/reportProd")
|
||||
public class DashboardReportProdController extends BaseController {
|
||||
|
@ -20,6 +27,15 @@ public class DashboardReportProdController extends BaseController {
|
|||
@ApiOperation("产品报表统计")
|
||||
@GetMapping("/sum")
|
||||
public AjaxResult sum(ReportProdQuery query) {
|
||||
return AjaxResult.success(reportProdDashboardService.selectSum(query));
|
||||
return success(reportProdDashboardService.selectSum(query));
|
||||
}
|
||||
|
||||
@ApiOperation("工序每日产量统计")
|
||||
@GetMapping("/dailyProd")
|
||||
@PreAuthorize("@ss.hasPermi('dashboard:prod:dailyProd')")
|
||||
@DataScope(deptAlias = "sd")
|
||||
public AjaxResult dailyProd(ReportProdQuery query) {
|
||||
List<DailyProdVO> list = reportProdDashboardService.selectDailyProd(query);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,22 @@
|
|||
package com.ruoyi.web.dashboard;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.dashboard.report.service.ReportUserProdDashboardService;
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.dashboard.report.domain.dailySalary.UserDailySalaryVO;
|
||||
import com.ruoyi.dashboard.report.service.ReportUserProdDashboardService;
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dashboard/reportUserProd")
|
||||
public class DashboardReportUserProdController extends BaseController {
|
||||
|
@ -20,6 +27,15 @@ public class DashboardReportUserProdController extends BaseController {
|
|||
@ApiOperation("用户产品报表统计")
|
||||
@GetMapping("/sum")
|
||||
public AjaxResult sum(ReportUserProdQuery query) {
|
||||
return AjaxResult.success(reportUserProdDashboardService.selectSum(query));
|
||||
return success(reportUserProdDashboardService.selectSum(query));
|
||||
}
|
||||
|
||||
@ApiOperation("用户每日工资统计")
|
||||
@GetMapping("/dailySalary")
|
||||
@PreAuthorize("@ss.hasPermi('dashboard:userProd:dailySalary')")
|
||||
@DataScope(deptAlias = "sd")
|
||||
public AjaxResult dailySalary(ReportUserProdQuery query) {
|
||||
List<UserDailySalaryVO> list = reportUserProdDashboardService.selectDailySalary(query);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,23 @@
|
|||
package com.ruoyi.web.yh;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.LogTitle;
|
||||
|
@ -16,18 +34,10 @@ import com.ruoyi.yh.price.domain.Price;
|
|||
import com.ruoyi.yh.price.domain.PriceQuery;
|
||||
import com.ruoyi.yh.price.domain.PriceVO;
|
||||
import com.ruoyi.yh.price.domain.dto.PriceImportParams;
|
||||
import com.ruoyi.yh.price.domain.dto.PricePropertyQuery;
|
||||
import com.ruoyi.yh.price.domain.dto.PriceVerifyDTO;
|
||||
import com.ruoyi.yh.price.service.PriceConverter;
|
||||
import com.ruoyi.yh.price.service.PriceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
/**
|
||||
* 单价Controller
|
||||
|
@ -62,6 +72,25 @@ public class PriceController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
// 查询属性值
|
||||
@PreAuthorize("@ss.hasPermi('yh:price:list')")
|
||||
@GetMapping("/property")
|
||||
@DataScope(deptAlias = "sd")
|
||||
public TableDataInfo property(PricePropertyQuery query)
|
||||
{
|
||||
startPage();
|
||||
List<Object> list = priceService.selectProperty(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
// 查询单条单价
|
||||
@PreAuthorize("@ss.hasPermi('yh:price:list')")
|
||||
@GetMapping("/single")
|
||||
@DataScope(deptAlias = "sd")
|
||||
public AjaxResult single(PriceQuery query) {
|
||||
return success(priceService.selectOne(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取查询条件数据
|
||||
*/
|
||||
|
@ -88,7 +117,7 @@ public class PriceController extends BaseController
|
|||
@Log(title = LogTitle.PRICE, businessType = BusinessType.EXPORT, bizType = LogBizType.PRICE)
|
||||
@PostMapping("/export")
|
||||
@DataScope(deptAlias = "sd")
|
||||
public void export(HttpServletResponse response, PriceQuery query)
|
||||
public void export(PriceQuery query, HttpServletResponse response)
|
||||
{
|
||||
startPage();
|
||||
List<PriceVO> list = priceService.selectPriceList(query);
|
||||
|
|
|
@ -1,5 +1,23 @@
|
|||
package com.ruoyi.web.yh;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.LogTitle;
|
||||
|
@ -17,14 +35,6 @@ import com.ruoyi.yh.report.domain.dto.ReportVerifyDTO;
|
|||
import com.ruoyi.yh.report.service.ReportAssembler;
|
||||
import com.ruoyi.yh.report.service.ReportConverter;
|
||||
import com.ruoyi.yh.report.service.ReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报表Controller
|
||||
|
@ -68,7 +78,8 @@ public class ReportController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('yh:report:export')")
|
||||
@Log(title = LOG_TITLE, businessType = BusinessType.EXPORT, bizType = LogBizType.REPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ReportQuery query)
|
||||
@DataScope(deptAlias = "sd", userAlias = "su")
|
||||
public void export(ReportQuery query, HttpServletResponse response)
|
||||
{
|
||||
startPage();
|
||||
List<ReportVO> list = reportService.selectReportList(query);
|
||||
|
@ -133,6 +144,7 @@ public class ReportController extends BaseController
|
|||
return toAjax(reportService.logicDel(reportIds));
|
||||
}
|
||||
|
||||
// 主管审核
|
||||
@PreAuthorize("@ss.hasPermi('yh:report:verify')")
|
||||
@Log(title = LOG_TITLE, businessType = BusinessType.VERIFY, bizType = LogBizType.REPORT, bizIdName = "arg0")
|
||||
@PutMapping("/verify")
|
||||
|
@ -140,6 +152,24 @@ public class ReportController extends BaseController
|
|||
return toAjax(reportService.verify(dto, getUserId()));
|
||||
}
|
||||
|
||||
// 财务审核
|
||||
@PreAuthorize("@ss.hasPermi('yh:report:financeVerify')")
|
||||
@Log(title = LOG_TITLE, businessType = BusinessType.VERIFY, bizType = LogBizType.REPORT, bizIdName = "arg0")
|
||||
@PutMapping("/financeVerify")
|
||||
public AjaxResult financeVerify(@RequestBody @Validated ReportVerifyDTO dto) {
|
||||
return toAjax(reportService.financeVerify(dto, getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 反审核
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:report:unVerify')")
|
||||
@Log(title = LOG_TITLE, businessType = BusinessType.VERIFY, bizType = LogBizType.REPORT, bizIdName = "arg0")
|
||||
@PutMapping("/unVerify")
|
||||
public AjaxResult unVerify(Long reportId) {
|
||||
return toAjax(reportService.unVerify(reportId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('yh:report:cancel')")
|
||||
@Log(title = LOG_TITLE, businessType = BusinessType.CANCEL, bizType = LogBizType.REPORT, bizIdName = "arg0")
|
||||
@PutMapping("/{reportId}/cancel")
|
||||
|
|
|
@ -20,6 +20,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.enums.LogBizType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProd;
|
||||
import com.ruoyi.yh.reportProd.domain.ReportProdQuery;
|
||||
|
@ -120,7 +121,7 @@ public class ReportProdController extends BaseController
|
|||
*/
|
||||
@PutMapping("/priceMatch")
|
||||
@PreAuthorize("@ss.hasPermi('yh:reportProd:priceMatch')")
|
||||
@Log(title = "刷新单价匹配", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "刷新单价匹配", businessType = BusinessType.UPDATE, bizType = LogBizType.REPORT_PROD, bizIdName = "arg0")
|
||||
public AjaxResult priceMatch(@RequestBody List<Long> ids){
|
||||
return success(reportProdService.refreshPriceMatch(ids));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
package com.ruoyi.web.yh;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
@ -10,12 +22,6 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery;
|
||||
import com.ruoyi.yh.reportUserProd.domain.ReportUserProdVO;
|
||||
import com.ruoyi.yh.reportUserProd.service.ReportUserProdService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工产量Controller
|
||||
|
@ -50,7 +56,8 @@ public class ReportUserProdController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('yh:reportUserProd:export')")
|
||||
@Log(title = "导出员工产量", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ReportUserProdQuery query)
|
||||
@DataScope(deptAlias = "sd")
|
||||
public void export( ReportUserProdQuery query, HttpServletResponse response)
|
||||
{
|
||||
startPage();
|
||||
List<ReportUserProdVO> list = reportUserProdService.selectReportUserProdList(query);
|
||||
|
|
110
ruoyi-web/src/main/java/com/ruoyi/web/yh/VerifyController.java
Normal file
110
ruoyi-web/src/main/java/com/ruoyi/web/yh/VerifyController.java
Normal file
|
@ -0,0 +1,110 @@
|
|||
package com.ruoyi.web.yh;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.yh.verify.domain.Verify;
|
||||
import com.ruoyi.yh.verify.domain.VerifyQuery;
|
||||
import com.ruoyi.yh.verify.domain.VerifyVO;
|
||||
import com.ruoyi.yh.verify.service.VerifyService;
|
||||
|
||||
/**
|
||||
* 审核记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/yh/verify")
|
||||
public class VerifyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private VerifyService verifyService;
|
||||
|
||||
/**
|
||||
* 查询审核记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:verify:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(VerifyQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<VerifyVO> list = verifyService.selectVerifyList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出审核记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:verify:export')")
|
||||
@Log(title = "审核记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, VerifyQuery query)
|
||||
{
|
||||
List<VerifyVO> list = verifyService.selectVerifyList(query);
|
||||
ExcelUtil<VerifyVO> util = new ExcelUtil<VerifyVO>(VerifyVO.class);
|
||||
util.exportExcel(response, list, "审核记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审核记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:verify:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(verifyService.selectVerifyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增审核记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:verify:add')")
|
||||
@Log(title = "审核记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Verify verify)
|
||||
{
|
||||
return toAjax(verifyService.insertVerify(verify));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改审核记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:verify:edit')")
|
||||
@Log(title = "审核记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Verify verify)
|
||||
{
|
||||
return toAjax(verifyService.updateVerify(verify));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除审核记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('yh:verify:remove')")
|
||||
@Log(title = "审核记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(verifyService.deleteVerifyByIds(ids));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user