三表一册补卡相关数据
This commit is contained in:
parent
d7578f8afc
commit
7bbd0707f5
|
|
@ -0,0 +1,29 @@
|
|||
package com.bonus.system.api;
|
||||
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
import com.bonus.common.core.constant.ServiceNameConstants;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.system.api.factory.RemoteJobFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
* 文件上传工具类
|
||||
*/
|
||||
@FeignClient(contextId = "remoteJobService", value = ServiceNameConstants.JOB_SERVICE, fallbackFactory = RemoteJobFallbackFactory.class)
|
||||
public interface RemoteJobService {
|
||||
|
||||
/**
|
||||
*
|
||||
* 三表一册手动更新
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/ownJob/update", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public AjaxResult update(@RequestPart(value = "month") String month, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.bonus.system.api.factory;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.system.api.RemoteJobService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传工具类 服务降级处理
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Component
|
||||
public class RemoteJobFallbackFactory implements FallbackFactory<RemoteJobService>
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteJobFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteJobService create(Throwable throwable) {
|
||||
log.error("文件上传调用失败:{}", throwable.getMessage());
|
||||
return new RemoteJobService(){
|
||||
@Override
|
||||
public AjaxResult update(String month, String source) {
|
||||
return AjaxResult.error("三表一册更新报错:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ package com.bonus.common.core.constant;
|
|||
|
||||
/**
|
||||
* 服务名称
|
||||
*
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public class ServiceNameConstants
|
||||
|
|
@ -26,4 +26,9 @@ public class ServiceNameConstants
|
|||
* 考勤机服务模块
|
||||
*/
|
||||
public static final String URK_SERVICE = "bonus-urk";
|
||||
|
||||
/**
|
||||
* 考勤服务模块
|
||||
*/
|
||||
public static final String JOB_SERVICE = "bonus-job";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.alibaba.excel.write.metadata.WriteSheet;
|
|||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmProject;
|
||||
import com.bonus.bmw.domain.vo.*;
|
||||
import com.bonus.bmw.service.PmProjectService;
|
||||
|
|
@ -21,7 +22,6 @@ import com.bonus.common.security.annotation.InnerAuth;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -304,6 +304,22 @@ public class PmProjectController extends BaseController {
|
|||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 封档
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pro:month:list"))
|
||||
@PostMapping("/proAttDataUpdateRemind")
|
||||
@SysLog(title = "三表一册", businessType = OperaType.UPDATE, module = "三表一册->考勤更新提醒")
|
||||
public AjaxResult proAttDataUpdateRemind(@RequestBody List<MapBeanPo> list) {
|
||||
try {
|
||||
int res = pmProjectService.proAttDataUpdateRemind(list);
|
||||
return toAjax(res);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 封档
|
||||
|
|
@ -321,12 +337,40 @@ public class PmProjectController extends BaseController {
|
|||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 月份和工程编号
|
||||
* 封档状态
|
||||
*/
|
||||
@GetMapping("/getSealStatus")
|
||||
@SysLog(title = "三表一册", businessType = OperaType.UPDATE, module = "三表一册->封档状态")
|
||||
public AjaxResult getSealStatus(ProMonthTable proMonthTable) {
|
||||
try {
|
||||
return pmProjectService.getSealStatus(proMonthTable);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目列表
|
||||
*/
|
||||
@GetMapping("/updateThreeTableOneRoster")
|
||||
@SysLog(title = "三表一册", businessType = OperaType.UPDATE, module = "三表一册->更新数据")
|
||||
public AjaxResult updateThreeTableOneRoster(ProMonthTable proMonthTable) {
|
||||
try {
|
||||
return pmProjectService.updateThreeTableOneRoster(proMonthTable);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
/**
|
||||
* 回单上传
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pro:month:list"))
|
||||
@PostMapping("/updateProMonthTableRefund")
|
||||
@SysLog(title = "三表一册", businessType = OperaType.UPDATE, module = "三表一册->封档")
|
||||
@SysLog(title = "三表一册", businessType = OperaType.UPDATE, module = "三表一册->回单上传")
|
||||
public AjaxResult updateProMonthTableRefund(@RequestParam(value = "files",required = false) MultipartFile[] files, @RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
params= Sm4Utils.decrypt(params);
|
||||
|
|
@ -342,7 +386,7 @@ public class PmProjectController extends BaseController {
|
|||
}
|
||||
|
||||
@PostMapping("/updateRefundFileById/{id}")
|
||||
@SysLog(title = "三表一册", businessType = OperaType.DELETE, module = "三表一册->封档")
|
||||
@SysLog(title = "三表一册", businessType = OperaType.DELETE, module = "三表一册->回单上传")
|
||||
public AjaxResult updateRefundFileById(@PathVariable Long id) {
|
||||
try {
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,8 @@ public class RepairCardRecordDto {
|
|||
*/
|
||||
private String attDay;
|
||||
|
||||
private String yearMonth;
|
||||
|
||||
/**
|
||||
* 主键编码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmProject;
|
||||
import com.bonus.bmw.domain.po.PmSubCompany;
|
||||
import com.bonus.bmw.domain.vo.*;
|
||||
|
|
@ -120,4 +121,10 @@ public interface PmProjectMapper {
|
|||
ProMonthTable getProMonthTableById(ProMonthTable proMonthTable);
|
||||
|
||||
int updateSalary(List<UserWagePayVo> userWagePay);
|
||||
|
||||
int proAttDataUpdateRemind(List<MapBeanPo> list);
|
||||
|
||||
int getSealStatus(ProMonthTable proMonthTable);
|
||||
|
||||
int updateDataStatus(ProMonthTable proMonthTable);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,4 +54,6 @@ public interface RepairCardApplyMapper {
|
|||
* @return
|
||||
*/
|
||||
Integer getPlayCardByWorkIdAndAttDay(RepairCardRecordDto repairCardRecord);
|
||||
|
||||
List<RepairCardApplyDto> getRepairCardApplyByProMonth(RepairCardApplyDto cardApplyDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.bmw.service;
|
|||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmProject;
|
||||
import com.bonus.bmw.domain.vo.*;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -99,4 +100,10 @@ public interface PmProjectService {
|
|||
int updateSalary(List<UserWagePayVo> userWagePay);
|
||||
|
||||
AjaxResult updateRefundFileById(Long id);
|
||||
|
||||
int proAttDataUpdateRemind(List<MapBeanPo> list);
|
||||
|
||||
AjaxResult getSealStatus(ProMonthTable proMonthTable);
|
||||
|
||||
AjaxResult updateThreeTableOneRoster(ProMonthTable proMonthTable);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public interface RepairCardApplyService {
|
|||
|
||||
AjaxResult audit(RepairCardApplyDto cardApplyDto);
|
||||
|
||||
int autoAudit(RepairCardApplyDto cardApplyDto);
|
||||
|
||||
List<CardStatisticsDto> getCardStatistics(RepairCardApplyDto cardApply);
|
||||
|
||||
AjaxResult updateRepairCardApply(RepairCardApplyDto cardApplyDto, FileBasicMsgDto fileBasicMsgDto);
|
||||
|
|
|
|||
|
|
@ -2,18 +2,23 @@ package com.bonus.bmw.service.impl;
|
|||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.RepairCardApplyDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmProject;
|
||||
import com.bonus.bmw.domain.po.PmSubCompany;
|
||||
import com.bonus.bmw.domain.vo.*;
|
||||
import com.bonus.bmw.mapper.BmSubContractMapper;
|
||||
import com.bonus.bmw.mapper.PmProjectMapper;
|
||||
import com.bonus.bmw.service.PmProjectService;
|
||||
import com.bonus.bmw.service.RepairCardApplyService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.RemoteJobService;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -40,10 +45,16 @@ public class PmProjectServiceImpl implements PmProjectService {
|
|||
@Resource
|
||||
private BmSubContractMapper bmSubContractMapper;
|
||||
|
||||
@Resource
|
||||
private RepairCardApplyService repairCardApplyService;
|
||||
|
||||
|
||||
@Resource
|
||||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
@Resource
|
||||
private RemoteJobService remoteJobService;
|
||||
|
||||
/**
|
||||
* 标段工程列表
|
||||
*/
|
||||
|
|
@ -225,7 +236,15 @@ public class PmProjectServiceImpl implements PmProjectService {
|
|||
proMonthTable.setBlockTime(DateUtil.now());
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
proMonthTable.setUpdateUser(sysUser.getUserId().intValue());
|
||||
return pmProjectMapper.updateProMonthTable(proMonthTable);
|
||||
int i = pmProjectMapper.updateProMonthTable(proMonthTable);
|
||||
if(i > 0){
|
||||
//封挡成功,所有在审核的当月补卡全部失败封档成功
|
||||
RepairCardApplyDto cardApplyDto = new RepairCardApplyDto();
|
||||
cardApplyDto.setRepairMonth(proMonthTable.getTableMonth());
|
||||
cardApplyDto.setProId(Math.toIntExact(proMonthTable.getProId()));
|
||||
int x = repairCardApplyService.autoAudit(cardApplyDto);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -274,4 +293,30 @@ public class PmProjectServiceImpl implements PmProjectService {
|
|||
fileUploadUtils.delFileListById(id.toString(),"", "", "");
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int proAttDataUpdateRemind(List<MapBeanPo> list) {
|
||||
return pmProjectMapper.proAttDataUpdateRemind(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getSealStatus(ProMonthTable proMonthTable) {
|
||||
int i = pmProjectMapper.getSealStatus(proMonthTable);
|
||||
String msg = "未封挡";
|
||||
if(i==2){
|
||||
msg = "已封挡";
|
||||
}
|
||||
return AjaxResult.success(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult updateThreeTableOneRoster(ProMonthTable proMonthTable) {
|
||||
try {
|
||||
remoteJobService.update(proMonthTable.getTableMonth(), SecurityConstants.INNER);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
int i = pmProjectMapper.updateDataStatus(proMonthTable);
|
||||
return i>0?AjaxResult.success():AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.bmw.domain.dto.*;
|
|||
import com.bonus.bmw.domain.po.MapBeanPo;
|
||||
import com.bonus.bmw.domain.po.PmProject;
|
||||
import com.bonus.bmw.mapper.RepairCardApplyMapper;
|
||||
import com.bonus.bmw.service.PmProjectService;
|
||||
import com.bonus.bmw.service.RepairCardApplyService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
|
|
@ -19,6 +20,7 @@ import javax.annotation.Resource;
|
|||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -31,6 +33,10 @@ public class RepairCardApplyServiceImpl implements RepairCardApplyService {
|
|||
|
||||
@Resource
|
||||
private RepairCardApplyMapper repairCardApplyMapper;
|
||||
|
||||
@Resource
|
||||
private PmProjectService pmProjectService;
|
||||
|
||||
@Resource
|
||||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
|
|
@ -183,6 +189,9 @@ public class RepairCardApplyServiceImpl implements RepairCardApplyService {
|
|||
try {
|
||||
cardApplyDto.setCheckUser(SecurityUtils.getLoginUser().getUsername());
|
||||
repairCardApplyMapper.updaterepairCardApply(cardApplyDto);
|
||||
List<MapBeanPo> dataList = new ArrayList<>();
|
||||
// 使用 Map,key 是 (fieldA, fieldB) 的组合,value 是对象
|
||||
// 如果有重复 key,后面的会覆盖前面的(保留最后一条)
|
||||
if (cardApplyDto.getCheckStatus() == 1) {
|
||||
// 通过
|
||||
List<RepairCardRecordDto> repairCardRecords = repairCardApplyMapper.getRepairCardRecordsList(cardApplyDto);
|
||||
|
|
@ -192,16 +201,37 @@ public class RepairCardApplyServiceImpl implements RepairCardApplyService {
|
|||
repairCardRecord.setAttDay(s);
|
||||
// 数据库设为了必填,所以这里生成一个随机字符串填充
|
||||
repairCardRecord.setIdCode(UUID.randomUUID().toString());
|
||||
//查询有没有补卡过
|
||||
//查询有没有打卡过
|
||||
Integer i = repairCardApplyMapper.getPlayCardByWorkIdAndAttDay(repairCardRecord);
|
||||
if(i<1){
|
||||
repairCardApplyMapper.insertAttPerson(repairCardRecord);
|
||||
//更新那个工程那个月的数据
|
||||
String yearMonth = extractYearMonth(repairCardRecord.getAttDay());
|
||||
if(yearMonth != null){
|
||||
MapBeanPo mapBeanPo = new MapBeanPo();
|
||||
mapBeanPo.setProId(repairCardRecord.getProId());
|
||||
mapBeanPo.setName(yearMonth);
|
||||
dataList.add(mapBeanPo);
|
||||
}
|
||||
}
|
||||
repairCardApplyMapper.insertAttRecord(repairCardRecord);
|
||||
repairCardApplyMapper.insertRepairCardDate(repairCardRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<MapBeanPo> uniqueList = new ArrayList<>(dataList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
data -> data.getProId() + "_" + data.getName(), // key: A+B
|
||||
data -> data, // value: 对象本身
|
||||
(existing, replacement) -> existing // 冲突时保留第一个
|
||||
// 如果想保留最后一个,写成: (existing, replacement) -> replacement
|
||||
))
|
||||
.values());
|
||||
//如果已生成月三表一册数据就提示更新
|
||||
if(!uniqueList.isEmpty()){
|
||||
pmProjectService.proAttDataUpdateRemind(uniqueList);
|
||||
}
|
||||
return AjaxResult.success("审核成功");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
|
|
@ -209,6 +239,43 @@ public class RepairCardApplyServiceImpl implements RepairCardApplyService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int autoAudit(RepairCardApplyDto cardApplyDto) {
|
||||
//查询包含的工程和月份的补卡未审核申请
|
||||
List<RepairCardApplyDto> list = repairCardApplyMapper.getRepairCardApplyByProMonth(cardApplyDto);
|
||||
for (RepairCardApplyDto repairCardApplyDto : list) {
|
||||
repairCardApplyDto.setCheckStatus(2);
|
||||
repairCardApplyDto.setRepairRemark(cardApplyDto.getRepairMonth() +"数据已封档,包含此月份的补卡自动退回");
|
||||
audit(repairCardApplyDto);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static String extractYearMonth(String dateStr) {
|
||||
// 1. 非空判断
|
||||
if (dateStr == null || dateStr.trim().isEmpty()) {
|
||||
return null; // 或返回 "",根据业务需求
|
||||
}
|
||||
// 去除首尾空格
|
||||
dateStr = dateStr.trim();
|
||||
// 2. 长度判断:至少需要 7 位才能截取 "yyyy-MM"
|
||||
if (dateStr.length() < 7) {
|
||||
return null; // 格式不足
|
||||
}
|
||||
// 3. 基本格式校验:检查第4位和第7位是否为连字符(可选,但更安全)
|
||||
if (dateStr.charAt(4) != '-' || dateStr.charAt(7) != '-') {
|
||||
return null; // 不符合 yyyy-MM-dd 基本结构
|
||||
}
|
||||
// 4. 进一步可选:验证前4位和中间2位是否为数字
|
||||
String yearPart = dateStr.substring(0, 4);
|
||||
String monthPart = dateStr.substring(5, 7);
|
||||
if (!yearPart.matches("\\d{4}") || !monthPart.matches("\\d{2}")) {
|
||||
return null; // 不是有效的数字
|
||||
}
|
||||
// 5. 安全截取年月
|
||||
return dateStr.substring(0, 7); // "yyyy-MM"
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardStatisticsDto> getCardStatistics(RepairCardApplyDto cardApply) {
|
||||
return repairCardApplyMapper.getCardStatistics(cardApply);
|
||||
|
|
|
|||
|
|
@ -311,4 +311,22 @@
|
|||
update tb_pro_month_table_roster set deduct_money = #{item.deductMoney}, actual_money = #{item.actualMoney} where id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="proAttDataUpdateRemind">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update tb_pro_month_table set is_update = '1' where pro_id = #{item.proId} and table_month = #{item.name}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getSealStatus" resultType="java.lang.Integer">
|
||||
select
|
||||
status
|
||||
from tb_pro_month_table
|
||||
where pro_id = #{proId} and table_month = #{tableMonth}
|
||||
</select>
|
||||
|
||||
<update id="updateDataStatus">
|
||||
update tb_pro_month_table set is_update = '0' where table_month = #{tableMonth}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -332,4 +332,17 @@
|
|||
<select id="getPlayCardByWorkIdAndAttDay" resultType="java.lang.Integer">
|
||||
select count(1) from bm_att_person where worker_id = #{workerId} and att_day = #{attDay}
|
||||
</select>
|
||||
|
||||
<select id="getRepairCardApplyByProMonth" resultType="com.bonus.bmw.domain.dto.RepairCardApplyDto">
|
||||
SELECT DISTINCT
|
||||
brca.id
|
||||
FROM
|
||||
bm_repair_card_apply brca
|
||||
LEFT JOIN bm_repair_card_date brcd ON brca.id = brcd.apply_id
|
||||
WHERE
|
||||
brca.is_active = 1
|
||||
AND brca.check_status = 0
|
||||
AND DATE_FORMAT(brcd.current_day, '%Y-%m') = #{repairMonth}
|
||||
AND brca.pro_id = #{proId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.job.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.job.service.JobService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 调度任务信息操作处理
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ownJob")
|
||||
public class JobController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private JobService service;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param month 月份
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("update")
|
||||
public AjaxResult update(String month) {
|
||||
try {
|
||||
service.update(month);
|
||||
return AjaxResult.success("更新成功");
|
||||
}catch (Exception e) {
|
||||
return AjaxResult.error("三表一册更新报错");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.job.service;
|
||||
|
||||
/**
|
||||
* 定时任务调度日志信息信息 服务层
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public interface JobService
|
||||
{
|
||||
|
||||
void update(String month);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.job.service;
|
||||
|
||||
import com.bonus.job.task.ThreeTableOneRosterTask;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 定时任务调度日志信息 服务层
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Service
|
||||
public class JobServiceImpl implements JobService
|
||||
{
|
||||
@Resource
|
||||
private ThreeTableOneRosterTask threeTableOneRosterTask;
|
||||
|
||||
@Override
|
||||
public void update(String month) {
|
||||
threeTableOneRosterTask.createThreeTableOneRosterData();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue