Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 7 months ago
parent
commit
756583cfcd
  1. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  2. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/MonthReportController.java
  3. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/schedule/OperStationCreateMonthReport.java
  4. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IMonthReportService.java
  5. 61
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java
  6. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  7. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/RunReportVO.java
  8. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
  9. 26
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java
  10. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.java
  11. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.xml
  12. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.java
  13. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml
  14. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.java
  15. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.xml
  16. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.java
  17. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
  18. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.java
  19. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml
  20. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.java
  21. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml
  22. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarAnnualInspectionServiceImpl.java
  23. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java
  24. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarInsuranceServiceImpl.java
  25. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java
  26. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java
  27. 17
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -1681,7 +1681,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
eq(ImsDutyMainPersonEntity::getDutyMainId, s.getId());
last("limit 1");
}});
if (StringUtils.isNotBlank(imsDutyMainPersonEntity.getDutyGroupName())){
if (ObjectUtil.isNotEmpty(imsDutyMainPersonEntity)&&StringUtils.isNotBlank(imsDutyMainPersonEntity.getDutyGroupName())){
s.setGroupName(imsDutyMainPersonEntity.getDutyGroupName());
}else {
s.setGroupName("临时班组");

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/MonthReportController.java

@ -75,6 +75,20 @@ public class MonthReportController {
StationRunReportAllVO stationReportAllVO = monthReportService.getStationMonthReportByStationCode(deptId,month);
return R.data(stationReportAllVO);
}
@ApiLog
@GetMapping("/setStationMonthReportByStationCode")
@ApiOperation(value = "根据站点编码生成站点月报",notes = "根据站点编码获取站点月报")
@ApiOperationSupport(order = 1)
@OperationAnnotation(moduleName = "生产月报",
title = "生成统计月报",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,
action = "生成统计月报")
public void setStationMonthReportByStationCode(@RequestParam("deptId") Long deptId,@RequestParam("month") String month) throws Exception {
// LocalDate startDate = DateUtil.getFirstDayByYearMonth(month);
// LocalDate endDate = DateUtil.getLastDayByYearMonth(month);
// return R.data(taskMonthService.getStationMonthReport(startDate,endDate,deptId.toString()));
monthReportService.setStationMonthReportByStationCode(deptId,month);
}
//
// @ApiLog
// @GetMapping("/getPersonalMonthReport")

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/schedule/OperStationCreateMonthReport.java

@ -61,6 +61,7 @@ public class OperStationCreateMonthReport {
eq(OperMonthReportEntity::getMonth,yearAndMonth);
eq(OperMonthReportEntity::getType, DictConstant.MONTH_REPORT_STATION);
eq(OperMonthReportEntity::getStationCode, deptVO.getId());
eq(OperMonthReportEntity::getIsDeleted, 0);
}});
if(CollectionUtil.isEmpty(operMonthReportEntityList)){
//按站点生成各电站运维月报
@ -76,15 +77,18 @@ public class OperStationCreateMonthReport {
entityList.add(operMonthReportEntity);
} catch (IOException e) {
e.printStackTrace();
log.error(e.toString());
}
//修改为每运行一次,保存一次
monthReportService.save(operMonthReportEntity);
}
}
else{
log.info("该月{}已生成月报",deptVO.getDeptName());
}
}//);
monthReportService.saveBatch(entityList);
log.info("---{}月份电站月报生成完成---",yearAndMonth);
log.info("---{}月份电站月报生成完成---"+entityList.toString());
return new ReturnT<>("SUCCESS");
}
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IMonthReportService.java

@ -5,6 +5,7 @@ import com.hnac.hzims.operational.report.vo.StationReportAllVO;
import com.hnac.hzims.operational.report.entity.OperMonthReportEntity;
import com.hnac.hzims.operational.report.vo.StationRunReportAllVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IMonthReportService extends BaseService<OperMonthReportEntity> {
/**
@ -16,6 +17,8 @@ public interface IMonthReportService extends BaseService<OperMonthReportEntity>
*/
StationRunReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception;
void setStationMonthReportByStationCode(Long deptId, String month) throws Exception;
/**
* 查询个人月报
* @param month

61
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java

@ -1,6 +1,7 @@
package com.hnac.hzims.operational.report.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.report.constants.DictConstant;
import com.hnac.hzims.operational.report.service.IOperPersonalMonthReportService;
import com.hnac.hzims.operational.report.service.IOperStationMonthReportService;
import com.hnac.hzims.operational.report.vo.PersonalMonthReportVO;
@ -15,14 +16,18 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.vo.DeptVO;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.time.YearMonth;
import java.util.List;
@Service
@AllArgsConstructor
@ -37,24 +42,64 @@ public class MonthReportServiceImpl extends BaseServiceImpl<MonthReportMapper, O
public StationRunReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception {
StationRunReportAllVO stationReportAllVO = new StationRunReportAllVO();
Dept dept = sysClient.getDept(deptId).getData();
//当月查询实时数据
if(month.equals(YearMonth.now().toString())){
OperMonthReportEntity operMonthReportEntity = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>(){{
eq(OperMonthReportEntity::getMonth,month);
eq(OperMonthReportEntity::getStationCode, dept.getId());
eq(OperMonthReportEntity::getIsDeleted, 0);
orderByDesc(OperMonthReportEntity::getObject);
last("limit 1;");
}});
//查询实时数据
if(ObjectUtil.isEmpty(operMonthReportEntity)){
stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
}
//历史查询定时任务生成的数据
else{
OperMonthReportEntity operMonthReportEntity = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>(){{
eq(OperMonthReportEntity::getMonth,month);
eq(OperMonthReportEntity::getStationCode, dept.getId());
orderByDesc(OperMonthReportEntity::getObject);
last("limit 1;");
}});
stationReportAllVO = ObjectUtil.isNotEmpty(operMonthReportEntity) ? (StationRunReportAllVO) ObjectHelper.byte2obj(operMonthReportEntity.getObject())
: operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
}
return stationReportAllVO;
}
@Override
public void setStationMonthReportByStationCode(Long deptId, String month){
Dept deptVO = sysClient.getDept(deptId).getData();
log.info("---{}机构---",deptVO.getDeptName());
//查询该电站该月报是否已生成月报
OperMonthReportEntity operMonthReportEntityByMonth = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>() {{
eq(OperMonthReportEntity::getMonth, month);
eq(OperMonthReportEntity::getType, DictConstant.MONTH_REPORT_STATION);
eq(OperMonthReportEntity::getStationCode, deptVO.getId());
eq(OperMonthReportEntity::getIsDeleted, 0);
last("limit 1;");
}});
if (ObjectUtil.isEmpty(operMonthReportEntityByMonth)||month.equals(YearMonth.now().toString())) {
if (ObjectUtil.isNotEmpty(operMonthReportEntityByMonth)){
this.removeById(operMonthReportEntityByMonth.getId());
}
//按站点生成各电站运维月报
StationRunReportAllVO stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(deptVO, DeptVO.class));
if (ObjectUtil.isNotEmpty(stationReportAllVO)) {
OperMonthReportEntity operMonthReportEntity = new OperMonthReportEntity();
operMonthReportEntity.setMonth(month);
operMonthReportEntity.setType(DictConstant.MONTH_REPORT_STATION);
operMonthReportEntity.setCreateDept(deptVO.getId());
operMonthReportEntity.setStationCode(deptVO.getId().toString());
try {
operMonthReportEntity.setObject(ObjectHelper.obj2byte(stationReportAllVO));
} catch (IOException e) {
e.printStackTrace();
}
//修改为每运行一次,保存一次
this.save(operMonthReportEntity);
}
} else {
log.info("该月{}已生成月报", deptVO.getDeptName());
}
}
// @Override
// public PersonalMonthReportVO getPersonalMonthReport(String month) throws Exception {
// PersonalMonthReportVO personalMonthReportVO = new PersonalMonthReportVO();

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java

@ -75,9 +75,7 @@ import java.time.LocalTime;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -114,7 +112,11 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
/**
* 通过线程池异步获取月报各模块内容 主要分为八块内容
**/
private static final ExecutorService pool = Executors.newFixedThreadPool(POOL_QUANTITY);
// private static final ExecutorService pool = Executors.newFixedThreadPool(POOL_QUANTITY);
private static final ExecutorService pool = new ThreadPoolExecutor(8, 10,
1, TimeUnit.HOURS, new ArrayBlockingQueue<>(5, true),
Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy());
/**
* 统计月报-电站-对内
@ -1222,9 +1224,10 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
int sum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoNumber).sum();
int qualifiedNum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum();
// double ticketInfoProportion = new BigDecimal(qualifiedNum ).divide(sum,2, RoundingMode.HALF_DOWN).doubleValue();
double ticketInfoProportion = sum == 0 ? 0 : new BigDecimal(qualifiedNum).divide(new BigDecimal(sum*100),2,
RoundingMode.HALF_DOWN).doubleValue();
String phenomenonConclusion = "5、本月开票%s张,合格率%s;";
double ticketInfoProportion = sum == 0 ? 0 : new BigDecimal(qualifiedNum).divide(new BigDecimal(sum),2,
RoundingMode.HALF_DOWN).multiply(new BigDecimal(100))
.setScale(2,RoundingMode.HALF_DOWN).doubleValue();
String phenomenonConclusion = "5、本月开票%s张,合格率百分之%s%%";
conclusion.append(String.format(phenomenonConclusion, sum, ticketInfoProportion)).append(";\r\n");
}else {
conclusion.append("5、本月未开票;\r\n");

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/RunReportVO.java

@ -17,11 +17,11 @@ public class RunReportVO implements Serializable {
@ApiModelProperty("姓名")
private String userName;
@ApiModelProperty("完成次数")
private Integer completeNum;
private Integer completeNum=0;
@ApiModelProperty("完成任务数量")
private List<String> completeList;
@ApiModelProperty("未完成次数")
private Integer incompleteNum;
private Integer incompleteNum=0;
@ApiModelProperty("完成任务数量")
private List<String> incompleteList;
@ApiModelProperty("备注")

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java

@ -249,6 +249,7 @@ public class StationVideoTypeController extends BladeController {
@ApiOperation(value = "获取Flv配置列表", notes = "获取Flv配置列表")
public R getFlvVideoConfig(VideoConfigEntity req,Query query) {
LambdaQueryWrapper<VideoConfigEntity> queryWrapper = com.hnac.hzims.common.utils.Condition.getQueryWrapper(VideoConfigEntity.class, req);
queryWrapper.eq(VideoConfigEntity::getCreateUser,AuthUtil.getUserId());
IPage<VideoConfigEntity> page = videoConfigService.page(com.hnac.hzims.common.utils.Condition.getPage(query), queryWrapper);
return R.data(page);
}

26
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java

@ -269,6 +269,32 @@ public class CarController extends BladeController {
return R.data(page);
}
// @ApiOperation(value = "新增车检记录模板")
// @ApiOperationSupport(order = 39)
// public R saveCarCheckRecordTemplate() {
//
// }
//
// @ApiOperationSupport(order = 40)
// public R updateCarCheckRecordTemplate() {
//
// }
//
// @ApiOperationSupport(order = 41)
// public R removeCarCheckRecordTemplate() {
//
// }
//
// @ApiOperationSupport(order = 42)
// public R carCheckRecordTemplateDetail() {
//
// }
//
// @ApiOperationSupport(order = 43)
// public R carCheckRecordTemplatePage() {
//
// }
@GetMapping("/exportCarMaintenanceData")
@ApiOperation(value = "导出车辆维保记录单")
@ApiOperationSupport(order = 24)

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.java

@ -1,11 +1,13 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarAnnualInspectionEntity;
import com.hnac.hzims.safeproduct.vo.CarAnnualInspectionPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
/**
@ -15,7 +17,7 @@ import java.util.Map;
* @date 2024-01-22
*/
@Mapper
public interface CarAnnualInspectionMapper extends BaseMapper<CarAnnualInspectionEntity> {
public interface CarAnnualInspectionMapper extends UserDataScopeBaseMapper<CarAnnualInspectionEntity> {
/**
* 年检记录分页
@ -23,5 +25,13 @@ public interface CarAnnualInspectionMapper extends BaseMapper<CarAnnualInspectio
* @param page 分页类
* @return 年检记录数据
*/
@UserDataAuth
IPage<CarAnnualInspectionPageVO> getCarAnnualInspectionPage(IPage<CarAnnualInspectionPageVO> page, Map<String, Object> param);
/**
* 查询当月年检记录
* @param month 当月
* @return 当月年检记录数据表
*/
List<CarAnnualInspectionEntity> selectCarAnnualInspectionByMonth(String month);
}

16
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarAnnualInspectionMapper.xml

@ -5,7 +5,8 @@
<select id="getCarAnnualInspectionPage"
resultType="com.hnac.hzims.safeproduct.vo.CarAnnualInspectionPageVO">
SELECT
t1.id, t1.code, t1.annual_inspection_time, t1.location, t2.unit, t2.car_brand, t2.plate_number
t1.id, t1.code, t1.annual_inspection_time, t1.location, t2.unit, t2.car_brand, t2.plate_number, t1.create_user,
t1.create_dept
FROM
hzims_car_annual_inspection t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
@ -29,4 +30,17 @@
ORDER BY
t1.create_time DESC
</select>
<select id="selectCarAnnualInspectionByMonth"
resultType="com.hnac.hzims.safeproduct.entity.CarAnnualInspectionEntity">
SELECT
*
FROM
hzims_car_annual_inspection
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.java

@ -1,11 +1,13 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
/**
@ -15,7 +17,7 @@ import java.util.Map;
* @date 2024-01-05
*/
@Mapper
public interface CarCheckRecordMapper extends BaseMapper<CarCheckRecordEntity> {
public interface CarCheckRecordMapper extends UserDataScopeBaseMapper<CarCheckRecordEntity> {
/**
* 车检记录分页
@ -23,5 +25,13 @@ public interface CarCheckRecordMapper extends BaseMapper<CarCheckRecordEntity> {
* @param page 分页类
* @return 分页数据
*/
@UserDataAuth
IPage<CarCheckRecordPageVO> getCarCheckRecordPage(IPage<CarCheckRecordPageVO> page, Map<String, Object> param);
/**
* 查询当月车检记录
* @param month 当月
* @return 当月车检记录数据表
*/
List<CarCheckRecordEntity> selectCarCheckRecordByMonth(String month);
}

16
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckRecordMapper.xml

@ -4,7 +4,8 @@
<select id="getCarCheckRecordPage" resultType="com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO">
SELECT
t1.id, t2.unit, t2.car_brand, t2.plate_number, t1.checker, t1.check_time, t1.conclusion
t1.id, t2.unit, t2.car_brand, t2.plate_number, t1.checker, t1.check_time, t1.conclusion, t1.create_user,
t1.create_dept
FROM
hzims_car_check_record t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
@ -28,4 +29,17 @@
ORDER BY
t1.create_time DESC
</select>
<select id="selectCarCheckRecordByMonth"
resultType="com.hnac.hzims.safeproduct.entity.CarCheckRecordEntity">
SELECT
*
FROM
hzims_car_check_record
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.java

@ -1,11 +1,13 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarInsuranceEntity;
import com.hnac.hzims.safeproduct.vo.CarInsurancePageVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
/**
@ -15,7 +17,7 @@ import java.util.Map;
* @date 2024-01-22
*/
@Mapper
public interface CarInsuranceMapper extends BaseMapper<CarInsuranceEntity> {
public interface CarInsuranceMapper extends UserDataScopeBaseMapper<CarInsuranceEntity> {
/**
* 车保记录页面
@ -23,5 +25,13 @@ public interface CarInsuranceMapper extends BaseMapper<CarInsuranceEntity> {
* @param page 分页类
* @return 车保记录数据
*/
@UserDataAuth
IPage<CarInsurancePageVO> getCarInsurancePage(IPage<CarInsurancePageVO> page, Map<String, Object> param);
/**
* 查询当月年保记录
* @param month 当月
* @return 当月年保记录数据表
*/
List<CarInsuranceEntity> selectCarInsuranceByMonth(String month);
}

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarInsuranceMapper.xml

@ -4,7 +4,8 @@
<select id="getCarInsurancePage" resultType="com.hnac.hzims.safeproduct.vo.CarInsurancePageVO">
SELECT
t1.id, t1.code, t1.insurance_time, t1.location, t2.unit, t2.car_brand, t2.plate_number
t1.id, t1.code, t1.insurance_time, t1.location, t2.unit, t2.car_brand, t2.plate_number, t1.create_user,
t1.create_dept
FROM
hzims_car_insurance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
@ -28,4 +29,16 @@
ORDER BY
t1.create_time DESC
</select>
<select id="selectCarInsuranceByMonth" resultType="com.hnac.hzims.safeproduct.entity.CarInsuranceEntity">
SELECT
*
FROM
hzims_car_insurance
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.java

@ -1,12 +1,14 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity;
import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO;
import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
/**
@ -16,7 +18,7 @@ import java.util.Map;
* @date 2024-01-04
*/
@Mapper
public interface CarMaintenanceMapper extends BaseMapper<CarMaintenanceEntity> {
public interface CarMaintenanceMapper extends UserDataScopeBaseMapper<CarMaintenanceEntity> {
/**
* 查询车辆维保记录详情
@ -31,5 +33,13 @@ public interface CarMaintenanceMapper extends BaseMapper<CarMaintenanceEntity> {
* @param page 分页类
* @return 分页数据
*/
@UserDataAuth
IPage<CarMaintenancePageVO> getCarMaintenancePage(IPage<CarMaintenancePageVO> page, Map<String, Object> param);
/**
* 查询当月车辆维保记录
* @param month 当月
* @return 当月车辆维保数据表
*/
List<CarMaintenanceEntity> selectCarMaintenanceByMonth(String month);
}

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml

@ -19,7 +19,7 @@
<select id="getCarMaintenancePage" resultType="com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO">
SELECT
t2.unit, t2.car_brand, t2.car_type, t2.plate_number, t1.id, t1.maintenance_type, t1.content, t1.location,
t1.cost, t1.maintainer, t1.confirmation_time, t1.maintenance_status
t1.cost, t1.maintainer, t1.confirmation_time, t1.maintenance_status, t1.create_user, t1.create_dept
FROM
hzims_car_maintenance t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
@ -43,4 +43,17 @@
ORDER BY
t1.create_time DESC
</select>
<select id="selectCarMaintenanceByMonth"
resultType="com.hnac.hzims.safeproduct.entity.CarMaintenanceEntity">
SELECT
*
FROM
hzims_car_maintenance
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.java

@ -1,11 +1,12 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.CarMilesYearDTO;
import com.hnac.hzims.safeproduct.entity.CarEntity;
import com.hnac.hzims.safeproduct.vo.CarMilesYearVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.math.BigDecimal;
import java.util.List;
@ -17,7 +18,7 @@ import java.util.List;
* @date 2024-01-03
*/
@Mapper
public interface CarMapper extends BaseMapper<CarEntity> {
public interface CarMapper extends UserDataScopeBaseMapper<CarEntity> {
/**
* 查询当年的全部车辆
@ -26,6 +27,7 @@ public interface CarMapper extends BaseMapper<CarEntity> {
* @param unit 单位
* @return 分页车辆数据
*/
@UserDataAuth
IPage<CarMilesYearVO> selectCarByYear(IPage<CarMilesYearVO> page, String year, String unit);
/**
@ -34,6 +36,7 @@ public interface CarMapper extends BaseMapper<CarEntity> {
* @param year 年份
* @return 里程数列表
*/
@UserDataAuth
List<CarMilesYearDTO> selectMilesByCar(List<String> carList, String year);
/**

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMapper.xml

@ -4,7 +4,7 @@
<select id="selectCarByYear" resultType="com.hnac.hzims.safeproduct.vo.CarMilesYearVO">
SELECT
DISTINCT t1.unit, t1.car_brand, t1.plate_number
DISTINCT t1.unit, t1.car_brand, t1.plate_number, t1.create_user, t1.create_dept
FROM
hzims_car t1
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id
@ -22,7 +22,8 @@
<select id="selectMilesByCar" resultType="com.hnac.hzims.safeproduct.dto.CarMilesYearDTO">
SELECT
t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t2.end_time, '%m') as dateTime, sum(t2.miles) as miles
t1.unit, t1.car_brand, t1.plate_number, DATE_FORMAT(t2.end_time, '%m') as dateTime, sum(t2.miles) as miles,
t1.create_user, t1.create_dept
FROM
hzims_car t1
LEFT JOIN hzims_car_used_record t2 ON t1.id = t2.car_id

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.java

@ -1,12 +1,14 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
/**
@ -16,7 +18,7 @@ import java.util.Map;
* @date 2024-01-04
*/
@Mapper
public interface CarUsedRecordMapper extends BaseMapper<CarUsedRecordEntity> {
public interface CarUsedRecordMapper extends UserDataScopeBaseMapper<CarUsedRecordEntity> {
/**
* 用车记录详情
@ -31,5 +33,13 @@ public interface CarUsedRecordMapper extends BaseMapper<CarUsedRecordEntity> {
* @param page 分页类
* @return 分页数据
*/
@UserDataAuth
IPage<CarUsedRecordPageVO> getCarUsedRecordPage(IPage<CarUsedRecordPageVO> page, Map<String, Object> param);
/**
* 查询当月用车记录
* @param month 当月
* @return 当月用车记录数据表
*/
List<CarUsedRecordEntity> selectCarUsedRecordByMonth(String month);
}

16
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarUsedRecordMapper.xml

@ -18,8 +18,8 @@
<select id="getCarUsedRecordPage" resultType="com.hnac.hzims.safeproduct.vo.CarUsedRecordPageVO">
SELECT
t1.id, t2.unit, t1.start_time, t1.user, t1.remark, t1.start_miles, t1.end_miles, t1.miles,
t2.car_brand, t2.plate_number, t1.used_location, t1.confirmation_time, t1.used_location
t1.id, t2.unit, t1.start_time, t1.user, t1.remark, t1.start_miles, t1.end_miles, t1.miles,t2.car_brand,
t2.plate_number, t1.used_location, t1.confirmation_time, t1.create_user, t1.create_dept
FROM
hzims_car_used_record t1
LEFT JOIN hzims_car t2 ON t1.car_id = t2.id
@ -43,4 +43,16 @@
ORDER BY
t1.create_time DESC
</select>
<select id="selectCarUsedRecordByMonth" resultType="com.hnac.hzims.safeproduct.entity.CarUsedRecordEntity">
SELECT
*
FROM
hzims_car_used_record
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarAnnualInspectionServiceImpl.java

@ -128,9 +128,6 @@ public class CarAnnualInspectionServiceImpl extends ServiceImpl<CarAnnualInspect
* @return 当月年检记录数据表
*/
private List<CarAnnualInspectionEntity> getCarAnnualInspectionByMonth(String month) {
QueryWrapper<CarAnnualInspectionEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarAnnualInspectionEntity::getCreateTime, month)
.orderByDesc(CarAnnualInspectionEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectCarAnnualInspectionByMonth(month);
}
}

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java

@ -1,13 +1,11 @@
package com.hnac.hzims.safeproduct.service.impl;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO;
import com.hnac.hzims.safeproduct.entity.CarCheckItemEntity;
@ -140,10 +138,7 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
* @return 当月车检记录数据表
*/
private List<CarCheckRecordEntity> getCarCheckRecordByMonth(String month) {
QueryWrapper<CarCheckRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarCheckRecordEntity::getCreateTime, month)
.orderByDesc(CarCheckRecordEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectCarCheckRecordByMonth(month);
}
/**

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarInsuranceServiceImpl.java

@ -125,9 +125,6 @@ public class CarInsuranceServiceImpl extends ServiceImpl<CarInsuranceMapper, Car
* @return 当月年保记录数据表
*/
private List<CarInsuranceEntity> getCarInsuranceByMonth(String month) {
QueryWrapper<CarInsuranceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarInsuranceEntity::getCreateTime, month)
.orderByDesc(CarInsuranceEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectCarInsuranceByMonth(month);
}
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java

@ -198,9 +198,6 @@ public class CarMaintenanceServiceImpl extends ServiceImpl<CarMaintenanceMapper,
* @return 当月车辆维保数据表
*/
private List<CarMaintenanceEntity> getCarMaintenanceByMonth(String month) {
QueryWrapper<CarMaintenanceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarMaintenanceEntity::getCreateTime, month)
.orderByDesc(CarMaintenanceEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectCarMaintenanceByMonth(month);
}
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarUsedRecordServiceImpl.java

@ -177,9 +177,6 @@ public class CarUsedRecordServiceImpl extends ServiceImpl<CarUsedRecordMapper, C
* @return 当月用车记录数据表
*/
private List<CarUsedRecordEntity> getCarUsedRecordByMonth(String month) {
QueryWrapper<CarUsedRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(CarUsedRecordEntity::getCreateTime, month)
.orderByDesc(CarUsedRecordEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectCarUsedRecordByMonth(month);
}
}

17
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/allTicket/fegin/TicketInfoAllClient.java

@ -71,15 +71,16 @@ public class TicketInfoAllClient implements ITicketInfoAllClient {
TicketInfoStatisticVO ticketInfoStatisticVO=new TicketInfoStatisticVO();
ticketInfoStatisticVO.setTicketInfoType("合计");
int sum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoNumber).sum();
int CompleteNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoCompleteNum).sum();
int InvalidatedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoInvalidatedNum).sum();
int QualifiedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum();
Double Proportion = new BigDecimal(QualifiedNum).divide(new BigDecimal(sum),2, RoundingMode.UP).doubleValue();
int completeNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoCompleteNum).sum();
int invalidatedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoInvalidatedNum).sum();
int qualifiedNum = workTicketStatistic.stream().mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum();
Double proportion = new BigDecimal(qualifiedNum).divide(new BigDecimal(sum),2, RoundingMode.UP)
.multiply(new BigDecimal(100)).setScale(2, RoundingMode.UP).doubleValue();
ticketInfoStatisticVO.setTicketInfoNumber(sum);
ticketInfoStatisticVO.setTicketInfoCompleteNum(CompleteNum);
ticketInfoStatisticVO.setTicketInfoInvalidatedNum(InvalidatedNum);
ticketInfoStatisticVO.setTicketInfoQualifiedNum(QualifiedNum);
ticketInfoStatisticVO.setTicketInfoProportion(Proportion);
ticketInfoStatisticVO.setTicketInfoCompleteNum(completeNum);
ticketInfoStatisticVO.setTicketInfoInvalidatedNum(invalidatedNum);
ticketInfoStatisticVO.setTicketInfoQualifiedNum(qualifiedNum);
ticketInfoStatisticVO.setTicketInfoProportion(proportion);
workTicketStatistic.add(ticketInfoStatisticVO);
}else {
TicketInfoStatisticVO ticketInfoStatisticVO=new TicketInfoStatisticVO();

Loading…
Cancel
Save