6a8a31c0 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 bfafc9c5 416f8f1c
正在显示 36 个修改的文件 包含 408 行增加159 行删除
......@@ -47,4 +47,10 @@ public interface CommonSqlMapper {
Integer deleteWrapper(@Param("tableName") String tableName, @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
/***
* 获取子部门集合
* @param departId
* @return
*/
String getChildDepartId(@Param(value="departId") String departId);
}
......
......@@ -50,4 +50,27 @@
delete from ${tableName} ${ew.customSqlSegment}
</delete>
<!-- 获取子部门集合-->
<select id="getChildDepartId" resultType="java.lang.String">
SELECT
GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids
FROM
sys_depart
WHERE
parent_id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
OR id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
OR parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
)
</select>
</mapper>
......
......@@ -3,7 +3,6 @@ package com.skua.modules.common.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;
......@@ -40,4 +39,11 @@ public interface ICommonSqlService {
Integer deleteWrapper(String tableName, QueryWrapper<?> queryWrapper);
/***
* 获取子部门集合
* @param departId
* @return
*/
String getChildDepartId( String departId);
}
......
......@@ -82,4 +82,13 @@ public class CommonSqlServiceImpl implements ICommonSqlService {
return commonSqlMapper.deleteWrapper(tableName, queryWrapper);
}
/***
* 获取子部门集合
* @param departId
* @return
*/
public String getChildDepartId( String departId){
return commonSqlMapper.getChildDepartId(departId);
}
}
......
......@@ -90,18 +90,28 @@ public class SysCommandCentreController {
@ApiOperation(value="指挥中心-运行负荷率分析", notes="指挥中心-运行负荷率分析")
//指挥中心-运行负荷率分析
@GetMapping(value = "/statisticsByLoadRate")
public Result<DepartLoadRateResultVO > statisticsByLoadRate(String startDate , String endTime,Integer loadRateType) throws Exception {
public Result<DepartLoadRateResultVO > statisticsByLoadRate(ReportItemvParam reportItemvParam) throws Exception {
Result<DepartLoadRateResultVO > result = new Result<>();
String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674
Integer loadRateType = reportItemvParam.getLoadRateType();
if(loadRateType == null ) loadRateType = 1;
DepartLoadRateResultVO departLoadRateResultVO = reportItemvService.statisticsByLoadRate( departIds,startDate , endTime, loadRateType);
DepartLoadRateResultVO departLoadRateResultVO = reportItemvService.statisticsByLoadRate( departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate(), loadRateType);
result.setSuccess(true);
result.setResult(departLoadRateResultVO);
return result;
}
@AutoLog(value = "指挥中心-运行负荷率分析")
//指挥中心----运行负荷率分析----处理水量详情
@AutoLog(value = "指挥中心-处理水量详情")
@ApiOperation(value="指挥中心-处理水量详情")
@GetMapping("/getCLSLXQ")
public Result<List<WaterTreatmentVO>> getCLSLXQ(ReportItemvParam reportItemvParam){
Result<List<WaterTreatmentVO>> result = new Result<>();
List<WaterTreatmentVO> waterTrendVOList = commandCentreService.statisticsCLSLXQ(reportItemvParam.getStartDate(),reportItemvParam.getEndDate(), BaseContextHandler.getDeparts());
result.setResult(waterTrendVOList );
return result;
}
/* @AutoLog(value = "指挥中心-运行负荷率分析")
@ApiOperation(value="指挥中心-运行负荷率分析---列表详情", notes="指挥中心-运行负荷率分析----列表详情")
//指挥中心-运行负荷率分析
@GetMapping(value = "/statisticsByLoadRateList")
......@@ -112,17 +122,17 @@ public class SysCommandCentreController {
result.setSuccess(true);
result.setResult(departLoadRateResultVO);
return result;
}
}*/
//cement水泥 electricity
@AutoLog(value = "指挥中心-泥量统计")
@ApiOperation(value="指挥中心-泥量统计", notes="指挥中心-泥量统计")
@GetMapping(value = "/statisticsByCement")
public Result<List<FRportlCommandCenterVO>> statisticsByCement(String startDate , String endDate) throws Exception {
public Result<List<FRportlCommandCenterVO>> statisticsByCement(ReportItemvParam reportItemvParam) throws Exception {
Result<List<FRportlCommandCenterVO>> result = new Result();
String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674
List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByCement(departIds,startDate,endDate);
List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByCement(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate());
result.setResult(dataList );
return result;
}
......@@ -130,10 +140,10 @@ public class SysCommandCentreController {
@ApiOperation(value="指挥中心-泥量统计--详情列表", notes="指挥中心-泥量统计--详情列表")
//指挥中心-泥量统计--详情列表
@GetMapping(value = "/statisticsByCementList")
public Result<List<ReportItemVO>> statisticsByCementList(String startDate , String endDate) throws Exception {
public Result<List<ReportItemVO>> statisticsByCementList(ReportItemvParam reportItemvParam) throws Exception {
Result<List<ReportItemVO>> result = new Result();
String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674
List<ReportItemVO> dataList = reportItemvService.statisticsByCementList(departIds,startDate,endDate);
List<ReportItemVO> dataList = reportItemvService.statisticsByCementList(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate());
result.setResult(dataList );
return result;
}
......@@ -143,20 +153,20 @@ public class SysCommandCentreController {
@AutoLog(value = "指挥中心-能耗分析")
@ApiOperation(value="指挥中心-能耗分析", notes="指挥中心-能耗分析")
@GetMapping(value = "/statisticsByElectricity")
public Result<List<FRportlCommandCenterVO>> statisticsByElectricity(String startDate ,String endDate) throws Exception {
public Result<List<FRportlCommandCenterVO>> statisticsByElectricity(ReportItemvParam reportItemvParam) throws Exception {
Result<List<FRportlCommandCenterVO>> result = new Result();
String departId = "1818214519948836864,1711662624459804674";
List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByElectricity(departId,startDate,endDate);
List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByElectricity(departId,reportItemvParam.getStartDate(),reportItemvParam.getEndDate());
result.setResult(dataList );
return result;
}
@AutoLog(value = "指挥中心-能耗分析")
@ApiOperation(value="指挥中心-能耗分析--详情列表", notes="指挥中心-能耗分析--详情列表")
@GetMapping(value = "/statisticsByElectricityList")
public Result<List<ReportItemVO>> statisticsByElectricityList(String startDate ,String endDate) throws Exception {
public Result<List<ReportItemVO>> statisticsByElectricityList(ReportItemvParam reportItemvParam) throws Exception {
Result<List<ReportItemVO>> result = new Result();
String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674
List<ReportItemVO> dataList = reportItemvService.statisticsByElectricityList(departIds,startDate,endDate);
List<ReportItemVO> dataList = reportItemvService.statisticsByElectricityList(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate());
result.setResult(dataList );
return result;
}
......@@ -355,16 +365,7 @@ public class SysCommandCentreController {
return result;
}
//指挥中心----运行负荷率分析----处理水量详情
@AutoLog(value = "指挥中心-处理水量详情")
@ApiOperation(value="指挥中心-处理水量详情")
@GetMapping("/getCLSLXQ")
public Result<List<WaterTreatmentVO>> getCLSLXQ(@RequestParam(name = "time", required = true)String time){
Result<List<WaterTreatmentVO>> result = new Result<>();
List<WaterTreatmentVO> waterTrendVOList = commandCentreService.statisticsCLSLXQ(time, BaseContextHandler.getDeparts());
result.setResult(waterTrendVOList );
return result;
}
/**
* 获取时间之间的月份
......
......@@ -86,8 +86,8 @@ public interface ICommandCentreService {
/***
* 指挥中心----运行负荷率分析----处理水量详情
* @param time
* @param
* @return
*/
List<WaterTreatmentVO> statisticsCLSLXQ(String time ,String departIds);
List<WaterTreatmentVO> statisticsCLSLXQ(String startDate,String endDate ,String departIds);
}
......
......@@ -22,10 +22,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* <pre>
......@@ -169,11 +166,12 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
* @param time
* @return
*/
public List<WaterTreatmentVO> statisticsCLSLXQ(String time, String departIds){
public List<WaterTreatmentVO> statisticsCLSLXQ(String startDate,String endDate, String departIds){
List<WaterTreatmentVO> dateList = null;
DateVO dateVO = new DateVO(time);//转换后的时间参数
DateVO dateVO = new DateVO(startDate);//转换后的时间参数
long differenceDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
long differenceDay = DateUtils.differenceDay(startDate, endDate);
String departIdssss = BaseUtil.quoteEach(departIds , ",");
//String factorySql = "select fi.depart_id ,d.depart_name, fi.pro_scale*10000 'pro_scale' from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")";
String factorySql = "select group_concat(fi.depart_id) from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")";
......@@ -181,7 +179,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
departIds =getJdbcTemplate().queryForObject(factorySql,String.class);
//月产水量
Map<String,String> cslMap = commonQueryCsl(departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
Map<String,String> cslMap = commonQueryCsl(departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa";
......@@ -200,8 +198,10 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
if(dateList != null ){
for(WaterTreatmentVO waterTreatmentVO : dateList){
waterTreatmentVO.setRank(index++);//设置排名
waterTreatmentVO.setMonthDayNum(differenceDay);
if(waterTreatmentVO.getCSL() != null ){
waterTreatmentVO.setDayCsl(Double.parseDouble(JSUtils.divide( waterTreatmentVO.getCSL() ,differenceDay )) );
waterTreatmentVO.setCSL(Double.parseDouble(JSUtils.format(waterTreatmentVO.getCSL()) ));//格式化
}
/* waterTreatmentVO.setRank( index++);//设置排名
if(cslMap.get(waterTreatmentVO.getDepartId()) != null ){
......
......@@ -259,20 +259,20 @@ public class ReportItemvService {
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportViewUtil.view2119,"CSL", departId, startTime,endTime);
String sql = "select sum(aaa.CSL) from " + dataViewName2119+ "aaa";
String csl = getJdbcTemplate().queryForObject(sql,String.class);
return csl;
return ConvertUtils.getString(csl,"0.00");
}
public String getSumDLHJ(String departId ,String startTime ,String endTime){
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportViewUtil.view3a24,"DLHJ", departId, startTime,endTime);
String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa";
String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
return dlhj;
return ConvertUtils.getString(dlhj,"0.00");
}
public String getSumValue(String viewName,String fileds,String departId ,String startTime ,String endTime){
String dataViewName3a24 = ReportViewUtil.buildViewLike(viewName,fileds, departId, startTime,endTime);
String sql = "select sum(aaa."+fileds+") from " + dataViewName3a24+ "aaa";
String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
return dlhj;
return ConvertUtils.getString(dlhj,"0.00");
}
//指挥中心-运行负荷率分析
public DepartLoadRateResultVO statisticsByLoadRate(String departIds,String startTime, String endTime, Integer loadRateType) {
......@@ -281,11 +281,11 @@ public class ReportItemvService {
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startTime,endTime);// 部门、时间
//列表数据
List<DepartLoadRateVO> dataList = statisticsByLoadRateList(departIds, startTime,endTime,loadRateType);
long differenceDay = DateUtils.differenceDay(startTime, endTime);
//统计总数
int normalNum = getJdbcTemplate().queryForObject( getStatisticsByLoadRate( dataViewName2119,1 ),Integer.class);//正常
int lowLoadNum = getJdbcTemplate().queryForObject( getStatisticsByLoadRate( dataViewName2119,3 ),Integer.class);//低负荷
int overloadNum = getJdbcTemplate().queryForObject( getStatisticsByLoadRate( dataViewName2119,2 ),Integer.class);//超负荷
int normalNum = getJdbcTemplate().queryForObject( getStatisticsByLoadRate( dataViewName2119,1,differenceDay ),Integer.class);//正常
int lowLoadNum = getJdbcTemplate().queryForObject( getStatisticsByLoadRate( dataViewName2119,3,differenceDay ),Integer.class);//低负荷
int overloadNum = getJdbcTemplate().queryForObject( getStatisticsByLoadRate( dataViewName2119,2 ,differenceDay),Integer.class);//超负荷
departLoadRateResultVO.setLowLoadNum( lowLoadNum );
departLoadRateResultVO.setNormalNum( normalNum );
......@@ -296,8 +296,10 @@ public class ReportItemvService {
//指挥中心-运行负荷率分析---列表详情
public List<DepartLoadRateVO> statisticsByLoadRateList(String departIds, String startTime, String endTime ,Integer loadRateType) {
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startTime,endTime);// 部门、时间
long differenceDay = DateUtils.differenceDay(startTime, endTime);
// 运行负荷率分析 = CSL/规模
String sql = " select round(sum(aaa.CSL),2) 'waterYieldMonth' ,aaa.depart_id , d.depart_name , round( (sum(aaa.CSL)/(fi.pro_scale*10000) ),2) 'loadRate' from "+ dataViewName2119 +" aaa";
String sql = " select round(sum(aaa.CSL),2) 'waterYieldMonth' ,aaa.depart_id , d.depart_name , round( (sum(aaa.CSL)/(fi.pro_scale * 100 * "+differenceDay+") ),2) 'loadRate' from "+ dataViewName2119 +" aaa";
sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id ";
sql += " left join sys_depart d on d.id = aaa.depart_id group by aaa.depart_id";
......@@ -312,12 +314,9 @@ public class ReportItemvService {
return dataList;
}
private String getStatisticsByLoadRate(String dataViewName2119 ,Integer loadRateType ){
private String getStatisticsByLoadRate(String dataViewName2119 ,Integer loadRateType ,long differenceDay){
String sql = "select count(1) from ( ";
sql += " select aaa.depart_id , round( (sum(aaa.CSL)/(fi.pro_scale*10000) ),2) 'loadRate' from "+ dataViewName2119 +" aaa";
sql += " select aaa.depart_id , round( (sum(aaa.CSL)/(fi.pro_scale * 100 *"+differenceDay+") ),2) 'loadRate' from "+ dataViewName2119 +" aaa";
sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id ";
sql += " group by aaa.depart_id ";
if(loadRateType != null ){
......
......@@ -35,9 +35,11 @@ public class WaterTreatmentVO {
@ApiModelProperty(value = "排名")
private Integer rank;
private long monthDayNum = 30;
public Double getFhl() {
if(this.getCSL() != null && this.getProScale() != null && this.getProScale().doubleValue() > 0 ){
fhl = this.getCSL() / this.getProScale();
fhl = this.getCSL()*100 / (this.getProScale() * this.getMonthDayNum() );
}
return fhl;
}
......
......@@ -26,11 +26,13 @@
d.depart_name AS depart_name,
r.report_date AS danger_date,
r.danger_name AS danger_location,
u.realname AS 'danger_user',
1 AS is_fault,
r.status
FROM
sys_depart d
LEFT JOIN danger_inspection_record r ON d.id = r.depart_id
LEFT JOIN sys_user u ON u.id = r.report_user
WHERE
d.depart_type = 1
AND r.report_date LIKE CONCAT(#{year},'%')
......
......@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.DistributContractVO;
import com.skua.modules.guest.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -77,6 +78,9 @@ public class DistributContractController {
Result<List<DistributContract>> result = new Result<List<DistributContract>>();
QueryWrapper<DistributContract> queryWrapper = QueryGenerator.initQueryWrapper(distributContract, req.getParameterMap());
// 需要添加条件判断
queryWrapper.eq("use_flag","1");//生效的合同
queryWrapper.ge("end_time", DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));// 生效时间 《 当前时间 《 失效时间
queryWrapper.le("start_time", DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
List<DistributContract> dataList = distributContractService.list(queryWrapper);
result.setSuccess(true);
result.setResult(dataList);
......
......@@ -99,7 +99,7 @@ public class ErpCommonController {
@AutoLog(value = "ERP-采购合同--物料清单(药剂入库使用)")
@ApiOperation(value = "ERP-采购合同--物料清单药剂入库使用()", notes = "ERP-采购合同--物料清单(药剂入库使用)")
@RequestMapping(value = "/queryPurchaseMaterialListByIn", method = RequestMethod.GET)
@GetMapping("/queryPurchaseMaterialListByIn")
public Result<IPage<PurchaseMaterialVO>> queryPurchaseMaterialListByIn(
MaterialSearchVO materialSearchVO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
......
......@@ -25,21 +25,21 @@ import io.swagger.annotations.ApiOperation;
/**
* <pre>
* 购合同
* 购合同
* </pre>
* @author 开发者姓名
* @version V0.1, 开发时间
*/
@Slf4j
@Api(tags="erp购合同")
@Api(tags="erp购合同")
@RestController("webPurchaseContractController")
@RequestMapping("/web/erp/purchaseContract")
public class PurchaseContractController {
@Autowired
private IERPPurchaseContractService purchaseContractService;
@AutoLog(value = "erp购合同-分页列表查询")
@ApiOperation(value="erp采购合同-分页列表查询", notes="erp采购合同-分页列表查询")
@AutoLog(value = "erp购合同-分页列表查询")
@ApiOperation(value="erp统购合同-分页列表查询", notes="erp统购合同-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ERPPurchaseContract>> queryPageList(ERPPurchaseContract ERPPurchaseContract,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
......@@ -59,8 +59,8 @@ public class PurchaseContractController {
result.setResult(pageList);
return result;
}
@AutoLog(value = "erp购合同-集团审核列表")
@ApiOperation(value="erp采购合同-集团审核列表", notes="erp采购合同-集团审核列表")
@AutoLog(value = "erp购合同-集团审核列表")
@ApiOperation(value="erp统购合同-集团审核列表", notes="erp统购合同-集团审核列表")
@GetMapping(value = "/handleList")
public Result<IPage<ERPPurchaseContract>> handleList(ERPPurchaseContract purchaseContract,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
......@@ -81,8 +81,8 @@ public class PurchaseContractController {
return result;
}
@AutoLog(value = "erp采购合同-有权限的采购合同集合")
@ApiOperation(value="erp采购合同-有权限的采购合同集合", notes="erp采购合同-有权限的采购合同集合")
@AutoLog(value = "erp统购合同-有权限的统购合同集合")
@ApiOperation(value="erp统购合同-有权限的统购合同集合", notes="erp统购合同-有权限的统购合同集合")
@GetMapping(value = "/purchaseContractList")
public Result<List<ERPPurchaseContract>> purchaseContractList(MaterialSearchVO materialSearchVO) {
Result<List<ERPPurchaseContract>> result = new Result<List<ERPPurchaseContract>>();
......@@ -105,8 +105,8 @@ public class PurchaseContractController {
return result;
}
@AutoLog(value = "erp购合同-添加")
@ApiOperation(value="erp采购合同-添加", notes="erp采购合同-添加")
@AutoLog(value = "erp购合同-添加")
@ApiOperation(value="erp统购合同-添加", notes="erp统购合同-添加")
@PostMapping(value = "/add")
public Result<ERPPurchaseContract> add(@RequestBody PurchaseContractVO purchaseContractVO) {
Result<ERPPurchaseContract> result = new Result<ERPPurchaseContract>();
......@@ -125,8 +125,8 @@ public class PurchaseContractController {
return result;
}
@AutoLog(value = "erp购合同-编辑")
@ApiOperation(value="erp采购合同-编辑", notes="erp采购合同-编辑")
@AutoLog(value = "erp购合同-编辑")
@ApiOperation(value="erp统购合同-编辑", notes="erp统购合同-编辑")
@PutMapping(value = "/edit")
public Result<ERPPurchaseContract> edit(@RequestBody PurchaseContractVO purchaseContractVO) {
Result<ERPPurchaseContract> result = new Result<ERPPurchaseContract>();
......@@ -146,8 +146,8 @@ public class PurchaseContractController {
return result;
}
@AutoLog(value = "erp购合同-通过id删除")
@ApiOperation(value="erp采购合同-通过id删除", notes="erp采购合同-通过id删除")
@AutoLog(value = "erp购合同-通过id删除")
@ApiOperation(value="erp统购合同-通过id删除", notes="erp统购合同-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
......@@ -168,8 +168,8 @@ public class PurchaseContractController {
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp购合同-批量删除")
@ApiOperation(value="erp采购合同-批量删除", notes="erp采购合同-批量删除")
@AutoLog(value = "erp购合同-批量删除")
@ApiOperation(value="erp统购合同-批量删除", notes="erp统购合同-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<ERPPurchaseContract> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<ERPPurchaseContract> result = new Result<ERPPurchaseContract>();
......@@ -190,8 +190,8 @@ public class PurchaseContractController {
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "erp购合同-通过id查询")
@ApiOperation(value="erp采购合同-通过id查询", notes="erp采购合同-通过id查询")
@AutoLog(value = "erp购合同-通过id查询")
@ApiOperation(value="erp统购合同-通过id查询", notes="erp统购合同-通过id查询")
@GetMapping(value = "/queryById")
public Result<PurchaseContractVO> queryById(@RequestParam(name="id",required=true) String id) {
Result<PurchaseContractVO> result = new Result<PurchaseContractVO>();
......@@ -205,8 +205,8 @@ public class PurchaseContractController {
return result;
}
@AutoLog(value = "erp购合同-送审")
@ApiOperation(value="erp采购合同-送审", notes="erp采购合同-送审")
@AutoLog(value = "erp购合同-送审")
@ApiOperation(value="erp统购合同-送审", notes="erp统购合同-送审")
@GetMapping(value = "/sendAudit")
public Result<PurchaseContractVO> sendAudit(@RequestParam(name="id",required=true) String id) {
Result<PurchaseContractVO> result = new Result<PurchaseContractVO>();
......@@ -223,8 +223,8 @@ public class PurchaseContractController {
}
return result;
}
@AutoLog(value = "erp购合同-审批")
@ApiOperation(value="erp采购合同-审批", notes="erp采购合同-审批")
@AutoLog(value = "erp购合同-审批")
@ApiOperation(value="erp统购合同-审批", notes="erp统购合同-审批")
@PutMapping(value = "/audit")
public Result<PurchaseContractVO> auditPurchasePlan(@RequestBody PurchaseContractVO purchaseContractVO) {
Result<PurchaseContractVO> result = new Result<PurchaseContractVO>();
......@@ -237,8 +237,8 @@ public class PurchaseContractController {
}
return result;
}
@AutoLog(value = "erp购合同-同步入库")
@ApiOperation(value="erp采购合同-同步入库", notes="erp采购合同-同步入库")
@AutoLog(value = "erp购合同-同步入库")
@ApiOperation(value="erp统购合同-同步入库", notes="erp统购合同-同步入库")
@PutMapping(value = "/syncEquipmentIn")
public Result<String> syncEquipmentIn(@RequestParam(name="id",required=true) String id ) {
Result<String> result = new Result<String>();
......
......@@ -11,6 +11,7 @@ import com.skua.core.util.DateUtils;
import com.skua.modules.equipment.vo.EquipmentRealTimeVO;
import com.skua.modules.erp.vo.MetricInfoVO;
import com.skua.modules.erp.vo.RealTimeHistoryDataVO;
import com.skua.modules.guest.util.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
......@@ -39,6 +40,19 @@ public class TestMetricInfoController {
public Result<RealTimeHistoryDataVO> equipRealTimeHistoryDataCtrl(@RequestParam(value = "departId") String departId,
@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "endTime") String endTime) {
if(StringUtils.isEmpty(startTime)){
startTime = DateUtil.getCurrentDate() ;
}
if(StringUtils.isEmpty(endTime)){
endTime = DateUtil.getCurrentDate();
}
if(startTime != null && startTime.length() < 19){
startTime = startTime+" 00:00:00";
}
if(endTime != null && endTime.length() < 19){
endTime = endTime+" 23:59:59";
}
Result<RealTimeHistoryDataVO> result = new Result<>();
RealTimeHistoryDataVO realTimeHistoryDataVO = new RealTimeHistoryDataVO();
//String fields = "TCSWSCLC_PLC300_Tag182,TCSWSCLC_PLC300_Tag185";
......
......@@ -65,6 +65,14 @@ public class DistributContract {
@ApiModelProperty(value = "备注")
private String remarks;
@ApiModelProperty(value = "启动标记 1.启动 0不启用")
private String useFlag;
@ApiModelProperty(value = "生效时间")
private String startTime;
@ApiModelProperty(value = "失效时间")
private String endTime;
/**申请人*/
@Excel(name = "申请人", width = 15)
@ApiModelProperty(value = "申请人")
......
......@@ -95,6 +95,16 @@ public class ERPPurchaseContract {
@ApiModelProperty(value = "申请时间")
private String applyTime;
@ApiModelProperty(value = "启动标记 1.启动 0不启用")
private String useFlag;
@ApiModelProperty(value = "生效时间")
private String startTime;
@ApiModelProperty(value = "失效时间")
private String endTime;
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
......
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import com.skua.core.util.ConvertUtils;
import com.skua.tool.util.JSUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -30,6 +32,9 @@ public class PurchaseMaterial {
@TableId(type = IdType.UUID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
@ApiModelProperty(value = "所属机构")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**采购计划编号*/
@Excel(name = "采购合同编号", width = 15)
@ApiModelProperty(value = "采购合同编号")
......@@ -50,10 +55,7 @@ public class PurchaseMaterial {
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private java.lang.String goodCode;
/**供应商id*/
@Excel(name = "供应商id", width = 15)
@ApiModelProperty(value = "供应商id")
private java.lang.String supplierId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
......@@ -80,6 +82,20 @@ public class PurchaseMaterial {
private java.lang.String remark;
/**供应商编号*/
@Excel(name = "供应商编号", width = 15)
@ApiModelProperty(value = "供应商编号")
@Dict(dictTable = "ajh_supplier_manage", dicCode="id", dicText = "supp_name")
private String supplierId;
/**税额*/
@Excel(name = "税额", width = 15)
@ApiModelProperty(value = "税额")
private String taxAmount;
/**价税合计*/
@Excel(name = "价税合计", width = 15)
@ApiModelProperty(value = "价税合计")
private String totalPriceTax;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
......@@ -105,5 +121,16 @@ public class PurchaseMaterial {
@ApiModelProperty(value = "扩展:分销总价")
private String distributTotalPrice;
@TableField(exist=false)
@ApiModelProperty(value = "扩展:货号物料入库数量")
private String storeNum;
@TableField(exist=false)
@ApiModelProperty(value = "扩展:剩余数量")
private Double remainNum;
public Double getRemainNum() {
remainNum = ConvertUtils.getDouble(this.getPurchaseNum() ,0d) - ConvertUtils.getDouble(this.getStoreNum() ,0d);// JSUtils.divide(this.getPurchaseNum() ,this.getStoreNum());
return remainNum;
}
}
......
......@@ -57,7 +57,7 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> {
* @param goodCode
* @return
*/
public int checkGoodCode(@Param("id")String id,@Param("goodCode") String goodCode);
int checkGoodCode(@Param("id")String id,@Param("goodCode") String goodCode);
/**
......@@ -66,12 +66,12 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> {
* @return
*/
@Anonymous
public IPage<PurchaseMaterialVO> queryPurchaseMaterialListByIn(Page<PurchaseMaterialVO> page,@Param("param") MaterialSearchVO materialSearchVO);
IPage<PurchaseMaterialVO> queryPurchaseMaterialListByIn(Page<PurchaseMaterialVO> page,@Param("param") MaterialSearchVO materialSearchVO);
/***
* 根据id或code校验合同编号是否唯一
* @param contractCode
* @return
*/
public int checkContractCode(@Param("contractCode")String contractCode );
int checkContractCode(@Param("contractCode")String contractCode );
}
......
......@@ -36,17 +36,11 @@
</select>
<select id="queryMaterialByGoodCode" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.*
from (
select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id
AND m.good_code = #{goodCode}
AND pc.departs like CONCAT('%', #{departId}, '%')
limit 1
) aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join ajh_supplier_manage sm on sm.id = aaa.supplier_id
select st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', pm.*
from erp_purchase_material pm
left join equipment_sparepart_type st on st.id = pm.sparepart_type
left join ajh_supplier_manage sm on sm.id = pm.supplier_id
where pm.good_code = #{goodCode} and pm.depart_id = #{departId}
</select>
......@@ -56,23 +50,20 @@
where good_code = #{goodCode}
<if test="id != null and id !=''">and id = #{id}</if>
</select>
<!-- 药剂入库查询结果:物料清单-->
<select id="queryPurchaseMaterialListByIn" resultType="com.skua.modules.erp.vo.PurchaseMaterialVO">
select st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.*
select pc.id 'purchase_contract_id', pc.contract_code 'purchase_contract_code' , st.item_text as 'sparepart_type_name',
(select sum(mi.material_num) from erp_material_in mi where mi.audit_status = 3 and mi.good_code = aaa.good_code) 'storeNum',aaa.*
from (
select pc.depart_id,pc.contract_code 'purchase_contract_code',pc.project_name ,dm.distribut_price ,dm.distribut_total_price,dm.material_num,pm.*
from erp_purchase_material pm , erp_purchase_contract pc ,erp_distribut_material dm
where pm.contract_id =pc.id and pm.good_code = dm.good_code and pc.id = #{param.purchaseContractId} and dm.contract_id = #{param.distributContractId}
<if test="param.sparepartCode != null and param.sparepartCode !=''"> and pc.departs like '%' #{param.departId}'%'</if>
<if test="param.sparepartCode != null and param.sparepartCode !=''"> and pm.sparepart_code =#{param.sparepartCode}</if>
<if test="param.sparepartType != null and param.sparepartType !=''"> and pm.sparepart_type in (${param.sparepartType}) </if>
<if test="param.sparepartName != null and param.sparepartName !=''"> and pm.sparepart_name like '%' #{param.sparepartName}'%'</if>
select dc.contract_code 'distribut_contract_code', dc.id 'distribut_contract_id', dm.distribut_price ,dm.distribut_total_price,dm.material_num 'distribut_num',pm.*
from erp_distribut_contract dc , erp_distribut_material dm , erp_purchase_material pm
where dc.id = dm.contract_id and dm.good_code = pm.good_code and pm.depart_id = #{param.departId}
<if test="param.sparepartCode != null and param.sparepartCode !=''">and pm.sparepart_code =#{param.sparepartCode}</if>
<if test="param.sparepartType != null and param.sparepartType !=''">and pm.sparepart_type in (${param.sparepartType}) </if>
<if test="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%' #{param.sparepartName}'%'</if>
)aaa
left join erp_purchase_contract pc on pc.id = aaa.contract_id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join ajh_supplier_manage sm on sm.id = aaa.supplier_id
</select>
<!-- 根据id或code校验合同编号是否唯一-->
<select id="checkContractCode" resultType="java.lang.Integer">
......
......@@ -37,5 +37,5 @@ public interface IPurchaseMaterialService extends IService<PurchaseMaterial> {
* 药剂入库查询结果:采购物料清单+分销单价+分销总价
* @return
*/
public IPage<PurchaseMaterialVO> queryPurchaseMaterialListByIn(Page<PurchaseMaterialVO> page, MaterialSearchVO materialSearchVO);
IPage<PurchaseMaterialVO> queryPurchaseMaterialListByIn(Page<PurchaseMaterialVO> page, MaterialSearchVO materialSearchVO);
}
......
package com.skua.modules.erp.vo;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @auther kangwei
......
......@@ -62,8 +62,6 @@ public class SafetyOffenceRecordController {
@Autowired
private ISysUserService userService;
@Autowired
private ISysUserDepartService sysUserDepartMapper;//用户部门关系表
/**
* <pre>
* 分页列表查询
......@@ -87,11 +85,15 @@ public class SafetyOffenceRecordController {
QueryWrapper<SafetyOffenceRecord> queryWrapper = QueryGenerator.initQueryWrapper(safetyOffenceRecord, req.getParameterMap());
Page<SafetyOffenceRecord> page = new Page<SafetyOffenceRecord>(pageNo, pageSize);
/*//上报人员
String userIds = queryUserIdsByName(safetyOffenceRecord.getReportUserName());
if(userIds.length() > 0){
queryWrapper.in("report_user",userIds);
}*/
//查询违章人员 ,否则查询创建人
if(safetyOffenceRecord.getOffenceUser() == null ){
/*if(safetyOffenceRecord.getOffenceUser() == null ){
queryWrapper.eq("create_user_id", BaseContextHandler.getUserId() );
}
}*/
IPage<SafetyOffenceRecord> pageList = safetyOffenceRecordService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......@@ -152,11 +154,36 @@ public class SafetyOffenceRecordController {
if(safetyOffenceRecord.getStatus() == null ){
queryWrapper.ge("status","1");// 状态 >=1
}
//上报人员
/* String userIds = queryUserIdsByName(safetyOffenceRecord.getReportUserName());
if(userIds.length() > 0){
queryWrapper.in("report_user",userIds);
}*/
IPage<SafetyOffenceRecord> pageList = safetyOffenceRecordService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
// 根据名称模糊查询,返回用户编号ids
/*
private String queryUserIdsByName(String reportUserName){
//上报人员
String userIds = "";
if(StringUtils.isNotEmpty(reportUserName)){
//String userIds = userService.queryUserIdsByName(safetyOffenceRecord.getReportUserName());
QueryWrapper<SysUser> userQueryWrapper = new QueryWrapper<SysUser>();
userQueryWrapper.like("realname",reportUserName);
List<SysUser> userInfoList = userService.list(userQueryWrapper);
if(userInfoList != null && !userInfoList.isEmpty()){
for(SysUser user :userInfoList ){
if(userIds.length() > 0 ) userIds +=",";
userIds +="'"+user.getId()+"'";
}
}
}
return userIds;
}
*/
@AutoLog(value = "违章记录-统计数量")
@ApiOperation(value="违章记录-统计数量", notes="违章记录-统计数量")
......@@ -165,8 +192,8 @@ public class SafetyOffenceRecordController {
Result<SafetyOffenceRecordStatisticsVO> result = new Result<SafetyOffenceRecordStatisticsVO>();
try {
SafetyOffenceRecordStatisticsVO safetyOffenceRecordStatisticsVO = null;
String reportType = null;
String departIds = null;
String reportType = "3";//数据过滤
String departIds = BaseContextHandler.getDeparts();//数据过滤
if (!"1".equals(BaseContextHandler.get("userType"))) {
String role_ah_id = sysConfigService.queryValueByKey("ROLE_AH_ADMIN");//安环管理员角色编号
......@@ -175,11 +202,14 @@ public class SafetyOffenceRecordController {
//安装部长角色看集团类型的违法上报
if( userRoleIds != null && userRoleIds.contains( role_ah_id ) ){//判断安环管理员
reportType ="1";
departIds = null;
}
if( userRoleIds != null && userRoleIds.contains( role_cz_id ) ){//判断 厂长
reportType = "2";
departIds = BaseContextHandler.getDeparts();
}
}else{
reportType = null;
departIds= null;
}
safetyOffenceRecordStatisticsVO = safetyOffenceRecordService.statistics(reportType,departIds);
result.setResult( safetyOffenceRecordStatisticsVO );
......@@ -205,6 +235,7 @@ public class SafetyOffenceRecordController {
public Result<SafetyOffenceRecord> add(@RequestBody SafetyOffenceRecord safetyOffenceRecord) {
Result<SafetyOffenceRecord> result = new Result<SafetyOffenceRecord>();
try {
safetyOffenceRecord.setReportUserName("匿名");
safetyOffenceRecord.setCreateUserId(BaseContextHandler.getUserId());//创建人编号
if(StringUtils.isNotEmpty(safetyOffenceRecord.getReportUser() )){
SysUser sysUser = userService.getById(safetyOffenceRecord.getReportUser());
......
......@@ -56,7 +56,7 @@ public class SafetyOffenceRecord {
private String reportUser;
@ApiModelProperty(value = "上报人名称")
private String reportUserName ="匿名" ;
private String reportUserName ;
/**上报时间*/
@Excel(name = "上报时间", width = 15)
@ApiModelProperty(value = "上报时间")
......
......@@ -111,8 +111,6 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData
@Param(value="start") String start, @Param(value="end") String end,
@Param(value="departIds") String departIds, @Param(value="dayCount") int dayCount);
String getChildDepartId(@Param(value="departId") String departId);
List<JnhbReportDetailsDy> getDyList(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3,
@Param(value="departId") String departId, @Param(value="year") String year);
......
......@@ -329,26 +329,7 @@
ORDER BY
d.depart_order
</select>
<select id="getChildDepartId" resultType="java.lang.String">
SELECT
GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids
FROM
sys_depart
WHERE
parent_id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
OR id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
OR parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
)
</select>
<select id="getDyList" resultType="com.skua.modules.report.vo.JnhbReportDetailsDy">
SELECT
RIGHT(LEFT( v.time, 7 ),2) AS time,
......
......@@ -4,6 +4,7 @@ import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.common.mapper.CommonSqlMapper;
import com.skua.modules.common.vo.DateVO;
import com.skua.modules.custom.entity.FCustomReportDataset;
import com.skua.modules.custom.mapper.FCustomReportDatasetMapper;
......@@ -29,6 +30,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
/**
* 数据集管理
*/
......@@ -37,6 +40,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
@Autowired
private FCustomReportDatasetMapper mapper;
@Resource
private CommonSqlMapper commonSqlMapper;
/* (non-Javadoc)
* @see com.skua.modules.custom.service.IFCustomReportDatasetService#getFillReportList()
*/
......@@ -224,7 +229,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String start = month.substring(0,4)+"-01-01";
String end = month + "-31";
int dayCount = (int)DateUtils.differenceDay(start,end);
String departIds = mapper.getChildDepartId(departId);
String departIds = commonSqlMapper.getChildDepartId(departId);
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, start, end);
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end);
List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds, dayCount);
......@@ -408,7 +413,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
//头部统计数据
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, startTime, endTime);
String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime);
System.out.println("dataViewName3 = "+dataViewName3);
//System.out.println("dataViewName3 = "+dataViewName3);
if(StringUtils.isNotEmpty(departIds)){
departIds = JSUtils.quoteEach(departIds,",");
}
......@@ -425,7 +430,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
sql += " and d.id in ("+departIds+")";
}
sql += ") ddd";
System.out.println("sql = "+sql);
//System.out.println("sql = "+sql);
List<JnhbReportData> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<JnhbReportData>(JnhbReportData.class));
if( dataList != null && !dataList.isEmpty()){
return dataList.get(0);
......
......@@ -11,8 +11,11 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.equipment.vo.EquipmentSparepartSearchVO;
import com.skua.tool.dfs.MapDFS;
import com.skua.tool.util.JSUtils;
import org.apache.commons.lang.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
......@@ -97,8 +100,6 @@ public class EquipmentSparepartController {
@Autowired
private CustomRedisUtil customRedisUtil;
@Autowired
private Key2ValueService key2ValueService;
@Autowired
private IEquipmentInService equipmentInService;
@Autowired
private IEquipmentInChildService equipmentInChildService;
......@@ -218,14 +219,15 @@ public class EquipmentSparepartController {
@AutoLog(value = "备品备件表-分页列表查询")
@ApiOperation(value = "备品备件表-分页列表查询", notes = "备品备件表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<EquipmentSparepartVO>> queryPageList(EquipmentSparepartDTO equipmentSparepartDTO,
public Result<IPage<EquipmentSparepartVO>> queryPageList(EquipmentSparepartSearchVO sparepartSearchVO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) throws Exception {
Result<IPage<EquipmentSparepartVO>> result = new Result<>();
Page page = new Page(pageNo, pageSize);
// Page page = new Page(pageNo, pageSize);
Set<String> sparepartTypeSet = new HashSet<>();
if (org.apache.commons.lang3.StringUtils.isNotEmpty(equipmentSparepartDTO.getSparepartType())) {
String typeId = equipmentSparepartDTO.getSparepartType();
if (org.apache.commons.lang3.StringUtils.isNotEmpty(sparepartSearchVO.getSparepartType())) {
String typeId = sparepartSearchVO.getSparepartType();
// 查询子集
MapDFS mapDFS = new MapDFS();
List<Map<String, Object>> tree = mapDFS.buildTree(equipmentSparepartTypeService.listMaps(new QueryWrapper<EquipmentSparepartType>().select("id, parent_id as parentId")));
......@@ -240,7 +242,24 @@ public class EquipmentSparepartController {
}
}
}
IPage<Map<String, Object>> mapPage = BaseFactory.JOIN()
//部门子集
//后续补充
Page<EquipmentSparepartVO> page = new Page<EquipmentSparepartVO>(pageNo, pageSize);
//权限部门
if(StringUtils.isNotEmpty(sparepartSearchVO.getDepartId())){
String departIds = iCommonSqlService.getChildDepartId(sparepartSearchVO.getDepartId() ) ;
sparepartSearchVO.setDepartIds(departIds ) ;
}else{
sparepartSearchVO.setDepartIds( JSUtils.quoteEach(BaseContextHandler.getDeparts() ,",")) ;//非管理员,获取权限部门集合
}
IPage<EquipmentSparepartVO> pageList = equipmentSparepartService.queryByPage(page,sparepartSearchVO);
result.setSuccess(true);
result.setResult(pageList);
return result;
/* IPage<Map<String, Object>> mapPage = BaseFactory.JOIN()
.select(EquipmentSparepartSupplies.class)
.select(SuppliesWarehouse.class)
.select("equipment_sparepart.depart_id,equipment_sparepart.id,equipment_sparepart.storage_num storageNum,equipment_sparepart.supplies_warehouse_id suppliesWarehouseId,equipment_sparepart_supplies.id suppliesId")
......@@ -300,6 +319,8 @@ public class EquipmentSparepartController {
result.setSuccess(true);
result.setResult(page);
return result;
*/
}
/**
......
......@@ -64,7 +64,8 @@ public class EquipmentSparepart {
*/
@Excel(name = "备件类型", width = 15)
@ApiModelProperty(value = "备件类型")
@BeanAnno(targetFieldName = "sparepartType_dictText")
//@BeanAnno(targetFieldName = "sparepartType_dictText")
@Dict(dictTable = "equipment_sparepart_Type",dicCode = "id",dicText = "item_text")
@JoinSqlQueryAnno(joinSqlQueryEnum = JoinSqlQueryEnum.EQ)
private String sparepartType;
/**
......@@ -91,6 +92,7 @@ public class EquipmentSparepart {
*/
@Excel(name = "生产厂商", width = 15)
@ApiModelProperty(value = "生产厂商")
@Dict(dictTable = "equipment_brand",dicCode = "id",dicText = "brand_company")
private String manufacturer;
/**
* 计量单位
......
......@@ -3,7 +3,10 @@ package com.skua.modules.equipment.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.equipment.dto.EquipmentSparepartDTO;
import com.skua.modules.equipment.entity.EquipmentSparepart;
import com.skua.modules.equipment.vo.EquipmentSparepartSearchVO;
import com.skua.modules.equipment.vo.EquipmentSparepartVO;
import com.skua.modules.supplies.entity.EquipmentSparepartSupplies;
import org.apache.ibatis.annotations.Param;
......@@ -14,5 +17,6 @@ public interface EquipmentSparepartMapper extends BaseMapper<EquipmentSparepart>
Integer updateStorageNumById(@Param("id") String id, @Param("storageNum") Double storageNum, @Param("version") Integer version);
//分页检索
IPage<EquipmentSparepartVO> queryByPage(@Param("page")Page<EquipmentSparepartVO> page, @Param("param") EquipmentSparepartSearchVO sparepartSearchVO);
}
......
......@@ -6,4 +6,17 @@
update equipment_sparepart set storage_num = #{storageNum}, version = #{version} + 1 where id = #{id} and version = #{version}
</update>
<select id="queryByPage" resultType="com.skua.modules.equipment.vo.EquipmentSparepartVO" >
select d.depart_name as 'departIdName', sw.depart_id,sw.warehouse_code ,sw.warehouse_name ,sw.warehouse_address ,sw.principal ,es.*
from equipment_sparepart es , supplies_Warehouse sw
left join sys_depart d on sw.depart_id = d.id
where es.supplies_warehouse_id = sw.id and sw.depart_id in (${param.+departIds})
order by inventory_update_time desc
</select>
<!-- <if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code =#{param.sparepartCode}</if>
<if test="param.sparepartType != null and param.sparepartType !=''">and es.sparepart_type in (${param.sparepartType}) </if>
<if test="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%' #{param.sparepartName}'%'</if>
suppliesWarehouseId-->
</mapper>
......
......@@ -3,7 +3,10 @@ package com.skua.modules.equipment.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.equipment.dto.EquipmentSparepartDTO;
import com.skua.modules.equipment.entity.EquipmentSparepart;
import com.skua.modules.equipment.vo.EquipmentSparepartSearchVO;
import com.skua.modules.equipment.vo.EquipmentSparepartVO;
import com.skua.modules.supplies.entity.EquipmentSparepartSupplies;
/**
......@@ -13,5 +16,6 @@ public interface IEquipmentSparepartService extends IService<EquipmentSparepart>
Integer updateStorageNumById(String id, Double storageNum, Integer version);
IPage<EquipmentSparepartVO> queryByPage(Page<EquipmentSparepartVO> page, EquipmentSparepartSearchVO sparepartSearchVO);
}
......
......@@ -3,9 +3,12 @@ package com.skua.modules.equipment.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.skua.modules.equipment.dto.EquipmentSparepartDTO;
import com.skua.modules.equipment.entity.EquipmentSparepart;
import com.skua.modules.equipment.mapper.EquipmentSparepartMapper;
import com.skua.modules.equipment.service.IEquipmentSparepartService;
import com.skua.modules.equipment.vo.EquipmentSparepartSearchVO;
import com.skua.modules.equipment.vo.EquipmentSparepartVO;
import com.skua.modules.supplies.entity.EquipmentSparepartSupplies;
import org.springframework.stereotype.Service;
......@@ -20,6 +23,13 @@ public class EquipmentSparepartServiceImpl extends ServiceImpl<EquipmentSparepar
return baseMapper.updateStorageNumById(id, storageNum, version);
}
/***
* 分页查询
* @param page
* @param equipmentSparepartDTO
* @return
*/
public IPage<EquipmentSparepartVO> queryByPage(Page<EquipmentSparepartVO> page, EquipmentSparepartSearchVO sparepartSearchVO){
return baseMapper.queryByPage(page,sparepartSearchVO);
}
}
......
package com.skua.modules.equipment.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value=" EquipmentSparepart物料查询对象", description=" EquipmentSparepart物料查询对象")
public class EquipmentSparepartSearchVO {
/**厂站*/
@ApiModelProperty(value = "厂站")
private String departId;
@ApiModelProperty(value = "物料类别编号")
private String sparepartType;
@ApiModelProperty(value = "物料名称")
private String sparepartName;
@ApiModelProperty(value = "物料Code")
public String sparepartCode;
@ApiModelProperty(value = "权限下的部门编号集合")
private String departIds;
@ApiModelProperty(value = "物料属性")
private String sparepartAttribute;
@ApiModelProperty(value = "仓库编号")
private String suppliesWarehouseId;
@ApiModelProperty(value = "规格")
private String specification ;
@ApiModelProperty(value = "用途")
private String purpose;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
}
package com.skua.modules.equipment.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import com.skua.modules.equipment.entity.EquipmentSparepart;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @author sonin
......@@ -18,4 +22,28 @@ public class EquipmentSparepartVO extends EquipmentSparepart {
private String consumeNum;
//20241111 kangwei新增扩展
@TableField(exist=false)
@ApiModelProperty(value = "仓库编号")
private String warehouseCode;
/**仓库名称*/
@TableField(exist=false)
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
/**仓库地址*/
@TableField(exist=false)
@ApiModelProperty(value = "仓库地址")
private String warehouseAddress;
/**负责人*/
@ApiModelProperty(value = "负责人")
@TableField(exist=false)
@Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
private String principal;
@TableField(exist=false)
private String departIdName;
}
......
......@@ -154,6 +154,7 @@ public class MybatisInterceptor implements Interceptor {
|| "com.skua.modules.system.datestandard.mapper.SysMonitorMetricInfoMapper.selectList".equals(sqlId) //点表
|| "com.skua.modules.equipment.mapper.EquipmentSparepartMapper.selectOne".equals(sqlId)
|| "com.skua.modules.supplies.mapper.EquipmentSparepartSuppliesMapper.selectById".equals(sqlId)
|| "com.skua.modules.equipment.mapper.EquipmentSparepartMapper.queryByPage".equals(sqlId)//库存查询
) {
log.debug("************************------sqlId------**************************" + sqlId);
return invocation.proceed();
......
......@@ -32,35 +32,35 @@ public interface ISysUserService extends IService<SysUser> {
* @param user
* @param roles
*/
public void editUserWithRole(SysUser user,String roles);
void editUserWithRole(SysUser user,String roles);
/**
* 获取用户的授权角色
* @param username
* @return
*/
public List<String> getRole(String username);
List<String> getRole(String username);
/**
* 查询用户信息包括 部门信息
* @param username
* @return
*/
public SysUserCacheInfo getCacheUser(String username);
SysUserCacheInfo getCacheUser(String username);
/**
* 根据部门Id查询
* @param
* @return
*/
public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username);
IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username);
/**
* 根据角色Id查询
* @param
* @return
*/
public IPage<SysUser> getUserByRoleId(Page<SysUser> page,String roleId, String username);
IPage<SysUser> getUserByRoleId(Page<SysUser> page,String roleId, String username);
/**
* 通过用户名获取用户角色集合
......@@ -88,7 +88,7 @@ public interface ISysUserService extends IService<SysUser> {
/**
* 根据手机号获取用户名和密码
*/
public SysUser getUserByPhone(String phone);
SysUser getUserByPhone(String phone);
/**
......@@ -152,5 +152,5 @@ public interface ISysUserService extends IService<SysUser> {
* @param userIds
* @return
*/
public String getUserNameByUserIds(String userIds);
String getUserNameByUserIds(String userIds);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!