Merge remote-tracking branch 'origin/dev_New' into dev_New
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.project.system.domain.SysNotice; |
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper; |
| | | import com.ruoyi.safe.mapper.SafeTrainingMapper; |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | //宿¶ä»»å¡æ±æ» |
| | | public class ScheduleTask { |
| | | |
| | | @Autowired |
| | | private SafeTrainingMapper safeTrainingMapper; |
| | | |
| | | @Autowired |
| | | private SysNoticeMapper noticeMapper; |
| | | |
| | | //宿¶ä»»å¡(15åéæ§è¡ä¸æ¬¡--夿å¹è®è®¡åæ°æ®,ç¶æååæ´) |
| | | @Scheduled(cron = "0 0/15 * * * ?") |
| | | public void testScheduleTask() { |
| | | List<SafeTraining> safeTrainings = safeTrainingMapper.selectList(Wrappers.<SafeTraining>lambdaQuery().ne(SafeTraining::getState, 2)); |
| | | if (safeTrainings.size() > 0) { |
| | | for (SafeTraining safeTraining : safeTrainings) { |
| | | //æ ¹æ®æ¶é´å¤æå¹è®ç¶æ |
| | | String trainingDate = safeTraining.getTrainingDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | LocalDateTime openingTime = LocalDateTime.parse((trainingDate + safeTraining.getOpeningTime()), DateTimeFormatter.ofPattern("yyyy-MM-ddHH:mm:ss")); |
| | | LocalDateTime endTime = LocalDateTime.parse((trainingDate + safeTraining.getEndTime()), DateTimeFormatter.ofPattern("yyyy-MM-ddHH:mm:ss")); |
| | | if (LocalDateTime.now().isBefore(openingTime)) { |
| | | //æªå¼å§ |
| | | safeTraining.setState(0); |
| | | } else if (LocalDateTime.now().isAfter(endTime)) { |
| | | //å·²ç»æ |
| | | safeTraining.setState(2); |
| | | } else { |
| | | //è¿è¡ä¸ |
| | | safeTraining.setState(1); |
| | | } |
| | | safeTrainingMapper.updateById(safeTraining); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //å·²è¯»æ°æ®åä¸ä¸ªå®æ¶ä»»å¡(æ¯æ1å·1ç¹æ¸
ç䏿¬¡ä¸ä¸ªæå·²è¯»æ°æ®) |
| | | @Scheduled(cron = "0 0 1 1 * ?") |
| | | public void cleanReadData() { |
| | | noticeMapper.delete(Wrappers.<SysNotice>lambdaQuery() |
| | | .eq(SysNotice::getStatus,"1") |
| | | .lt(SysNotice::getCreateTime, LocalDateTime.now())); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.approve.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import com.ruoyi.approve.service.IApproveNodeService; |
| | | import com.ruoyi.approve.vo.ApproveProcessVO; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.mapper.DeviceRepairMapper; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.other.service.impl.TempFileServiceImpl; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.purchase.service.impl.PurchaseLedgerServiceImpl; |
| | | import com.ruoyi.sales.mapper.*; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | //@RequiredArgsConstructor |
| | | public class ApproveNodeServiceImpl extends ServiceImpl<ApproveNodeMapper, ApproveNode> implements IApproveNodeService { |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private CommonFileServiceImpl commonFileService; |
| | | @Autowired |
| | | private StockUtils stockUtils; |
| | | @Autowired |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | |
| | | @Autowired |
| | | private PurchaseLedgerServiceImpl purchaseLedgerServiceImpl; |
| | | |
| | | |
| | | public ApproveProcess getApproveById(String id) { |
| | |
| | | if (status.equals(2)) { |
| | | // åæ |
| | | purchaseLedger.setApprovalStatus(3); |
| | | List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectList(new QueryWrapper<SalesLedgerProduct>() |
| | | .lambda().eq(SalesLedgerProduct::getSalesLedgerId, purchaseLedger.getId()).eq(SalesLedgerProduct::getType, 2)); |
| | | for (SalesLedgerProduct salesLedgerProduct : salesLedgerProducts) { |
| | | // è´¨æ£ |
| | | if (salesLedgerProduct.getIsChecked()) { |
| | | purchaseLedgerServiceImpl.addQualityInspect(purchaseLedger, salesLedgerProduct); |
| | | }else { |
| | | //ç´æ¥å
¥åº |
| | | stockUtils.addStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockQualifiedRecordTypeEnum.PURCHASE_STOCK_IN.getCode(), purchaseLedger.getId()); |
| | | } |
| | | } |
| | | } else if (status.equals(3)) { |
| | | // æç» |
| | | purchaseLedger.setApprovalStatus(4); |
| | |
| | | if(status.equals(2)){ |
| | | shippingInfo.setStatus("å®¡æ ¸éè¿"); |
| | | }else if(status.equals(3)){ |
| | | shippingInfo.setType("å®¡æ ¸æç»"); |
| | | shippingInfo.setStatus("å®¡æ ¸æç»"); |
| | | }else if(status.equals(1)){ |
| | | shippingInfo.setStatus("å®¡æ ¸ä¸"); |
| | | } |
| | |
| | | .eq(ApproveProcess::getApproveId, approveNode.getApproveProcessId())).get(0); |
| | | if (approveProcess.getApproveUserIds().split(",").length > nodeOrder){ |
| | | String id = approveProcess.getApproveUserIds().split(",")[nodeOrder]; |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveNode.getApproveProcessId()+"æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/collaborativeApproval/approvalProcess?approveType="+approveProcess.getApproveType()+"&approveId="+approveNode.getApproveProcessId()); |
| | | if (approveProcess.getApproveType()==8){ |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId() + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/safeProduction/safeWorkApproval?approveType=" + approveProcess.getApproveType() + "&approveId=" + approveProcess.getApproveId()); |
| | | }else { |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId() + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/collaborativeApproval/approvalProcess?approveType=" + approveProcess.getApproveType() + "&approveId=" + approveProcess.getApproveId()); |
| | | } |
| | | } |
| | | break; |
| | | case 2: |
| | |
| | | case 6: |
| | | return "æ¥ä»·å®¡æ¹"; |
| | | case 7: |
| | | return "åºåºå®¡æ¹"; |
| | | return "å货审æ¹"; |
| | | case 8: |
| | | return "å±é©ä½ä¸å®¡æ¹"; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | //@RequiredArgsConstructor |
| | | public class ApproveProcessServiceImpl extends ServiceImpl<ApproveProcessMapper, ApproveProcess> implements IApproveProcessService { |
| | | private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | |
| | | private final StringRedisTemplate redisTemplate; |
| | | |
| | | private final DailyRedisCounter dailyRedisCounter; |
| | | |
| | | private final SysDeptMapper sysDeptMapper; |
| | | private final IApproveNodeService approveNodeService; |
| | | private final SysUserMapper sysUserMapper; |
| | | private final ApproveProcessMapper approveProcessMapper; |
| | | private final TempFileServiceImpl tempFileService; |
| | | private final CommonFileMapper commonFileMapper; |
| | | private final CommonFileServiceImpl commonFileService; |
| | | private final ISysNoticeService sysNoticeService; |
| | | @Autowired |
| | | private StringRedisTemplate redisTemplate; |
| | | @Autowired |
| | | private DailyRedisCounter dailyRedisCounter; |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | @Autowired |
| | | private IApproveNodeService approveNodeService; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | @Autowired |
| | | private ApproveProcessMapper approveProcessMapper; |
| | | @Autowired |
| | | private TempFileServiceImpl tempFileService; |
| | | @Autowired |
| | | private CommonFileMapper commonFileMapper; |
| | | @Autowired |
| | | private CommonFileServiceImpl commonFileService; |
| | | @Autowired |
| | | private ISysNoticeService sysNoticeService; |
| | | |
| | | @Override |
| | | public void addApprove(ApproveProcessVO approveProcessVO) throws Exception { |
| | |
| | | tempFileService.migrateTempFilesToFormal(approveProcess.getId(), approveProcessVO.getTempFileIds(), FileNameType.ApproveProcess.getValue()); |
| | | /*æ¶æ¯éç¥*/ |
| | | String id = approveProcessVO.getApproveUserIds().split(",")[0]; |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcessVO.getApproveType()), |
| | | approveID + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/collaborativeApproval/approvalProcess?approveType=" + approveProcessVO.getApproveType() + "&approveId=" + approveID); |
| | | if (approveProcess.getApproveType()==8){ |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId() + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/safeProduction/safeWorkApproval?approveType=" + approveProcess.getApproveType() + "&approveId=" + approveProcess.getApproveId()); |
| | | }else { |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId() + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/collaborativeApproval/approvalProcess?approveType=" + approveProcess.getApproveType() + "&approveId=" + approveProcess.getApproveId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | return one; |
| | | } |
| | | |
| | | private final ApproveNodeMapper approveNodeMapper; |
| | | @Autowired |
| | | private ApproveNodeMapper approveNodeMapper; |
| | | |
| | | // æ¥ä»·å®¡æ¹ç¼è¾å®¡æ ¸äºº |
| | | public void updateApproveUser(ApproveGetAndUpdateVo approveGetAndUpdateVo) { |
| | |
| | | approveNodeService.initApproveNodes(approveGetAndUpdateVo.getApproveUserIds(), approveProcess.getApproveId(), approveProcess.getTenantId()); |
| | | /*æ¶æ¯éç¥*/ |
| | | String id = approveProcess.getApproveUserIds().split(",")[0]; |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId() + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/collaborativeApproval/approvalProcess?approveType=" + approveProcess.getApproveType() + "&approveId=" + approveProcess.getApproveId()); |
| | | if (approveProcess.getApproveType()==8){ |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId() + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/safeProduction/safeWorkApproval?approveType=" + approveProcess.getApproveType() + "&approveId=" + approveProcess.getApproveId()); |
| | | }else { |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId() + "æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | "/collaborativeApproval/approvalProcess?approveType=" + approveProcess.getApproveType() + "&approveId=" + approveProcess.getApproveId()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.procurementrecord.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | |
| | | StockInRecord one = stockInRecordService.getOne(new QueryWrapper<StockInRecord>() |
| | | .lambda().eq(StockInRecord::getRecordId, recordId) |
| | | .eq(StockInRecord::getRecordType, recordType)); |
| | | |
| | | stockInRecordService.batchDelete(Collections.singletonList(one.getId())); |
| | | if (ObjectUtils.isNotEmpty(one)) { |
| | | stockInRecordService.batchDelete(Collections.singletonList(one.getId())); |
| | | } |
| | | } |
| | | public void deleteStockOutRecord(Long recordId, String recordType) { |
| | | StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>() |
| | | .lambda().eq(StockOutRecord::getRecordId, recordId) |
| | | .eq(StockOutRecord::getRecordType, recordType)); |
| | | |
| | | stockOutRecordService.batchDelete(Collections.singletonList(one.getId())); |
| | | if (ObjectUtils.isNotEmpty(one)) { |
| | | stockOutRecordService.batchDelete(Collections.singletonList(one.getId())); |
| | | } |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "BOMç¼å·") |
| | | @Excel(name = "BOMç¼å·") |
| | | private String bomNo; |
| | | |
| | | @ApiModelProperty(value = "交æåå·®") |
| | | private Integer deliveryDaysDiff; |
| | | } |
| | |
| | | package com.ruoyi.project.system.mapper;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | |
|
| | | /**
|
| | | * é¨é¨ç®¡ç æ°æ®å±
|
| | | * |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @Mapper
|
| | | public interface SysDeptMapper
|
| | | {
|
| | | /**
|
| | | * æ¥è¯¢é¨é¨ç®¡çæ°æ®
|
| | | * |
| | | *
|
| | | * @param dept é¨é¨ä¿¡æ¯
|
| | | * @return é¨é¨ä¿¡æ¯éå
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * æ ¹æ®è§è²IDæ¥è¯¢é¨é¨æ ä¿¡æ¯
|
| | | * |
| | | *
|
| | | * @param roleId è§è²ID
|
| | | * @param deptCheckStrictly é¨é¨æ 鿩项æ¯å¦å
³èæ¾ç¤º
|
| | | * @return éä¸é¨é¨å表
|
| | |
| | |
|
| | | /**
|
| | | * æ ¹æ®é¨é¨IDæ¥è¯¢ä¿¡æ¯
|
| | | * |
| | | *
|
| | | * @param deptId é¨é¨ID
|
| | | * @return é¨é¨ä¿¡æ¯
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * æ ¹æ®IDæ¥è¯¢ææåé¨é¨
|
| | | * |
| | | *
|
| | | * @param deptId é¨é¨ID
|
| | | * @return é¨é¨å表
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * æ ¹æ®IDæ¥è¯¢ææåé¨é¨ï¼æ£å¸¸ç¶æï¼
|
| | | * |
| | | *
|
| | | * @param deptId é¨é¨ID
|
| | | * @return åé¨é¨æ°
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * æ¯å¦åå¨åèç¹
|
| | | * |
| | | *
|
| | | * @param deptId é¨é¨ID
|
| | | * @return ç»æ
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * æ¥è¯¢é¨é¨æ¯å¦åå¨ç¨æ·
|
| | | * |
| | | *
|
| | | * @param deptId é¨é¨ID
|
| | | * @return ç»æ
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * æ ¡éªé¨é¨åç§°æ¯å¦å¯ä¸
|
| | | * |
| | | *
|
| | | * @param deptName é¨é¨åç§°
|
| | | * @param parentId ç¶é¨é¨ID
|
| | | * @return ç»æ
|
| | |
| | |
|
| | | /**
|
| | | * æ°å¢é¨é¨ä¿¡æ¯
|
| | | * |
| | | *
|
| | | * @param dept é¨é¨ä¿¡æ¯
|
| | | * @return ç»æ
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * ä¿®æ¹é¨é¨ä¿¡æ¯
|
| | | * |
| | | *
|
| | | * @param dept é¨é¨ä¿¡æ¯
|
| | | * @return ç»æ
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * ä¿®æ¹æå¨é¨é¨æ£å¸¸ç¶æ
|
| | | * |
| | | *
|
| | | * @param deptIds é¨é¨IDç»
|
| | | */
|
| | | public void updateDeptStatusNormal(Long[] deptIds);
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹åå
ç´ å
³ç³»
|
| | | * |
| | | *
|
| | | * @param depts åå
ç´
|
| | | * @return ç»æ
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * å é¤é¨é¨ç®¡çä¿¡æ¯
|
| | | * |
| | | *
|
| | | * @param deptId é¨é¨ID
|
| | | * @return ç»æ
|
| | | */
|
| | |
| | | package com.ruoyi.project.system.service.impl;
|
| | |
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.ruoyi.project.system.mapper.SysUserMapper;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.project.system.domain.SysNotice;
|
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper;
|
| | |
| | | sysNotice.setTenantId(tenantId);
|
| | | return sysNotice;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @date 2025-05-09 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Slf4j |
| | | public class PurchaseLedgerServiceImpl extends ServiceImpl<PurchaseLedgerMapper, PurchaseLedger> implements IPurchaseLedgerService { |
| | | private final AccountExpenseService accountExpenseService; |
| | | private final PurchaseLedgerMapper purchaseLedgerMapper; |
| | | @Autowired |
| | | private AccountExpenseService accountExpenseService; |
| | | @Autowired |
| | | private PurchaseLedgerMapper purchaseLedgerMapper; |
| | | |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | | @Autowired |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | @Autowired |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | |
| | | private final SysUserMapper userMapper; |
| | | @Autowired |
| | | private SysUserMapper userMapper; |
| | | |
| | | private final TempFileMapper tempFileMapper; |
| | | @Autowired |
| | | private TempFileMapper tempFileMapper; |
| | | |
| | | private final CommonFileMapper commonFileMapper; |
| | | @Autowired |
| | | private CommonFileMapper commonFileMapper; |
| | | |
| | | private final SupplierManageMapper supplierManageMapper; |
| | | @Autowired |
| | | private SupplierManageMapper supplierManageMapper; |
| | | |
| | | private final ProductMapper productMapper; |
| | | @Autowired |
| | | private ProductMapper productMapper; |
| | | |
| | | private final ProductModelMapper productModelMapper; |
| | | @Autowired |
| | | private ProductModelMapper productModelMapper; |
| | | |
| | | private final SysUserMapper sysUserMapper; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | private final TicketRegistrationMapper ticketRegistrationMapper; |
| | | @Autowired |
| | | private TicketRegistrationMapper ticketRegistrationMapper; |
| | | |
| | | private final ProductRecordMapper productRecordMapper; |
| | | @Autowired |
| | | private ProductRecordMapper productRecordMapper; |
| | | |
| | | private final PaymentRegistrationMapper paymentRegistrationMapper; |
| | | |
| | | private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | private final StringRedisTemplate redisTemplate; |
| | | private final QualityInspectMapper qualityInspectMapper; |
| | | private final CommonFileServiceImpl commonFileService; |
| | | private final QualityTestStandardBindingMapper qualityTestStandardBindingMapper; |
| | | private final QualityTestStandardParamMapper qualityTestStandardParamMapper; |
| | | private final QualityTestStandardMapper qualityTestStandardMapper; |
| | | private final QualityInspectParamMapper qualityInspectParamMapper; |
| | | |
| | | private final ApproveProcessServiceImpl approveProcessService; |
| | | |
| | | private final ProcurementRecordMapper procurementRecordStorageMapper; |
| | | |
| | | private final PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper; |
| | | |
| | | private final SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper; |
| | | @Autowired |
| | | private PaymentRegistrationMapper paymentRegistrationMapper; |
| | | @Autowired |
| | | private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | @Autowired |
| | | private StringRedisTemplate redisTemplate; |
| | | @Autowired |
| | | private QualityInspectMapper qualityInspectMapper; |
| | | @Autowired |
| | | private CommonFileServiceImpl commonFileService; |
| | | @Autowired |
| | | private QualityTestStandardBindingMapper qualityTestStandardBindingMapper; |
| | | @Autowired |
| | | private QualityTestStandardParamMapper qualityTestStandardParamMapper; |
| | | @Autowired |
| | | private QualityTestStandardMapper qualityTestStandardMapper; |
| | | @Autowired |
| | | private QualityInspectParamMapper qualityInspectParamMapper; |
| | | @Autowired |
| | | private ApproveProcessServiceImpl approveProcessService; |
| | | @Autowired |
| | | private ProcurementRecordMapper procurementRecordStorageMapper; |
| | | @Autowired |
| | | private PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper; |
| | | @Autowired |
| | | private SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper; |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | |
| | |
| | | return 1; |
| | | } |
| | | |
| | | private void addQualityInspect(PurchaseLedger purchaseLedger, SalesLedgerProduct saleProduct) { |
| | | |
| | | public void addQualityInspect(PurchaseLedger purchaseLedger, SalesLedgerProduct saleProduct) { |
| | | QualityInspect qualityInspect = new QualityInspect(); |
| | | qualityInspect.setInspectType(0); |
| | | qualityInspect.setSupplier(purchaseLedger.getSupplierName()); |
| | |
| | | if (ids == null || ids.length == 0) { |
| | | throw new BaseException("请éä¸è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | for (Long id : ids) { |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id); |
| | | if (purchaseLedger.getApprovalStatus().equals(3)) { |
| | | throw new BaseException(purchaseLedger.getPurchaseContractNumber()+"å·²ç»å®¡æ¹éè¿ï¼ä¸å
许å é¤"); |
| | | } |
| | | } |
| | | // æ¹éå é¤å
³èçéè´å
¥åºè®°å½ |
| | | LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductQueryWrapper = new LambdaQueryWrapper<>(); |
| | | salesLedgerProductQueryWrapper.in(SalesLedgerProduct::getSalesLedgerId, ids) |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody QualityUnqualified qualityUnqualified) { |
| | | qualityUnqualified.setInspectState(0); |
| | | return AjaxResult.success(qualityUnqualifiedService.save(qualityUnqualified)); |
| | | } |
| | | |
| | |
| | | public int deal(QualityUnqualified qualityUnqualified) { |
| | | QualityUnqualified unqualified = qualityUnqualifiedMapper.selectById(qualityUnqualified.getId()); |
| | | QualityInspect qualityInspect = qualityInspectService.getById(unqualified.getInspectId()); |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "è¿ä¿®": |
| | | case "è¿å·¥": |
| | | //å¤æè´¨æ£è¡¨æ¯å¦æç¸å
³çæ¥å·¥id,å¦æææ¥å·¥id,é£ä¹è¿å·¥éè¦éæ°å建ç产订åéæ°ç产 |
| | | if (ObjectUtils.isNotNull(qualityInspect.getProductMainId())) { |
| | | //è¿å·¥éè¦éæ°å建ç产订åéæ°ç产 |
| | | ProductOrder productOrder = productionProductMainMapper.getOrderByMainId(qualityInspect.getProductMainId()); |
| | | ProductOrder order = new ProductOrder(); |
| | | BeanUtils.copyProperties(productOrder, order); |
| | | order.setId(null); |
| | | order.setQuantity(unqualified.getQuantity()); |
| | | order.setCompleteQuantity(BigDecimal.ZERO); |
| | | order.setStartTime(null); |
| | | order.setEndTime(null); |
| | | productOrderService.save(order); |
| | | //æ°å¢ç产订åä¸çå·¥èºè·¯çº¿ä¸»è¡¨ |
| | | ProductProcessRoute productProcessRoute = productProcessRouteMapper.selectList(Wrappers.<ProductProcessRoute>lambdaQuery().eq(ProductProcessRoute::getProductOrderId, productOrder.getId()).orderByDesc(ProductProcessRoute::getId)).get(0); |
| | | ProductProcessRoute newProcessRoute = new ProductProcessRoute(); |
| | | BeanUtils.copyProperties(productProcessRoute, newProcessRoute); |
| | | newProcessRoute.setId(null); |
| | | newProcessRoute.setProductOrderId(order.getId()); |
| | | productProcessRouteMapper.insert(newProcessRoute); |
| | | //æ°å¢ç产订åä¸çå·¥èºè·¯çº¿å表 |
| | | List<ProductProcessRouteItem> processRouteItems = productProcessRouteItemMapper.selectList(new QueryWrapper<ProductProcessRouteItem>().lambda().eq(ProductProcessRouteItem::getProductRouteId, productProcessRoute.getId())); |
| | | // çæå½åæ¥æçåç¼ï¼å¹´ææ¥ |
| | | String datePrefix = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | for (ProductProcessRouteItem processRouteItem : processRouteItems) { |
| | | ProductProcessRouteItem productProcessRouteItem = new ProductProcessRouteItem(); |
| | | BeanUtils.copyProperties(processRouteItem, productProcessRouteItem); |
| | | productProcessRouteItem.setId(null); |
| | | productProcessRouteItem.setProductRouteId(newProcessRoute.getId()); |
| | | int insert = productProcessRouteItemMapper.insert(productProcessRouteItem); |
| | | if (insert > 0) { |
| | | // æ¥è¯¢ä»æ¥å·²åå¨çæå¤§å·¥åå· |
| | | QueryWrapper<ProductWorkOrder> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.likeRight("work_order_no", datePrefix) |
| | | .orderByDesc("work_order_no") |
| | | .last("LIMIT 1"); |
| | | ProductWorkOrder lastWorkOrder = productWorkOrderMapper.selectOne(queryWrapper); |
| | | int sequenceNumber = 1; // é»è®¤åºå· |
| | | if (lastWorkOrder != null && lastWorkOrder.getWorkOrderNo() != null) { |
| | | String lastNo = lastWorkOrder.getWorkOrderNo().toString(); |
| | | if (lastNo.startsWith(datePrefix)) { |
| | | String seqStr = lastNo.substring(datePrefix.length()); |
| | | try { |
| | | sequenceNumber = Integer.parseInt(seqStr) + 1; |
| | | } catch (NumberFormatException e) { |
| | | sequenceNumber = 1; |
| | | if (ObjectUtils.isNotNull(qualityInspect) && qualityInspect.getInspectType()!=0) { |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "è¿ä¿®": |
| | | case "è¿å·¥": |
| | | //å¤æè´¨æ£è¡¨æ¯å¦æç¸å
³çæ¥å·¥id,å¦æææ¥å·¥id,é£ä¹è¿å·¥éè¦éæ°å建ç产订åéæ°ç产 |
| | | if (ObjectUtils.isNotNull(qualityInspect.getProductMainId())) { |
| | | //è¿å·¥éè¦éæ°å建ç产订åéæ°ç产 |
| | | ProductOrder productOrder = productionProductMainMapper.getOrderByMainId(qualityInspect.getProductMainId()); |
| | | ProductOrder order = new ProductOrder(); |
| | | BeanUtils.copyProperties(productOrder, order); |
| | | order.setId(null); |
| | | order.setQuantity(unqualified.getQuantity()); |
| | | order.setCompleteQuantity(BigDecimal.ZERO); |
| | | order.setStartTime(null); |
| | | order.setEndTime(null); |
| | | productOrderService.save(order); |
| | | //æ°å¢ç产订åä¸çå·¥èºè·¯çº¿ä¸»è¡¨ |
| | | ProductProcessRoute productProcessRoute = productProcessRouteMapper.selectList(Wrappers.<ProductProcessRoute>lambdaQuery().eq(ProductProcessRoute::getProductOrderId, productOrder.getId()).orderByDesc(ProductProcessRoute::getId)).get(0); |
| | | ProductProcessRoute newProcessRoute = new ProductProcessRoute(); |
| | | BeanUtils.copyProperties(productProcessRoute, newProcessRoute); |
| | | newProcessRoute.setId(null); |
| | | newProcessRoute.setProductOrderId(order.getId()); |
| | | productProcessRouteMapper.insert(newProcessRoute); |
| | | //æ°å¢ç产订åä¸çå·¥èºè·¯çº¿å表 |
| | | List<ProductProcessRouteItem> processRouteItems = productProcessRouteItemMapper.selectList(new QueryWrapper<ProductProcessRouteItem>().lambda().eq(ProductProcessRouteItem::getProductRouteId, productProcessRoute.getId())); |
| | | // çæå½åæ¥æçåç¼ï¼å¹´ææ¥ |
| | | String datePrefix = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | for (ProductProcessRouteItem processRouteItem : processRouteItems) { |
| | | ProductProcessRouteItem productProcessRouteItem = new ProductProcessRouteItem(); |
| | | BeanUtils.copyProperties(processRouteItem, productProcessRouteItem); |
| | | productProcessRouteItem.setId(null); |
| | | productProcessRouteItem.setProductRouteId(newProcessRoute.getId()); |
| | | int insert = productProcessRouteItemMapper.insert(productProcessRouteItem); |
| | | if (insert > 0) { |
| | | // æ¥è¯¢ä»æ¥å·²åå¨çæå¤§å·¥åå· |
| | | QueryWrapper<ProductWorkOrder> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.likeRight("work_order_no", datePrefix) |
| | | .orderByDesc("work_order_no") |
| | | .last("LIMIT 1"); |
| | | ProductWorkOrder lastWorkOrder = productWorkOrderMapper.selectOne(queryWrapper); |
| | | int sequenceNumber = 1; // é»è®¤åºå· |
| | | if (lastWorkOrder != null && lastWorkOrder.getWorkOrderNo() != null) { |
| | | String lastNo = lastWorkOrder.getWorkOrderNo().toString(); |
| | | if (lastNo.startsWith(datePrefix)) { |
| | | String seqStr = lastNo.substring(datePrefix.length()); |
| | | try { |
| | | sequenceNumber = Integer.parseInt(seqStr) + 1; |
| | | } catch (NumberFormatException e) { |
| | | sequenceNumber = 1; |
| | | } |
| | | } |
| | | } |
| | | // çæå®æ´çå·¥åå· |
| | | String workOrderNoStr = String.format("%s%03d", datePrefix, sequenceNumber); |
| | | ProductWorkOrder productWorkOrder = new ProductWorkOrder(); |
| | | productWorkOrder.setProductProcessRouteItemId(productProcessRouteItem.getId()); |
| | | productWorkOrder.setProductOrderId(order.getId()); |
| | | productWorkOrder.setPlanQuantity(order.getQuantity()); |
| | | productWorkOrder.setWorkOrderNo(workOrderNoStr); |
| | | productWorkOrder.setStatus(1); |
| | | productWorkOrderMapper.insert(productWorkOrder); |
| | | } |
| | | // çæå®æ´çå·¥åå· |
| | | String workOrderNoStr = String.format("%s%03d", datePrefix, sequenceNumber); |
| | | ProductWorkOrder productWorkOrder = new ProductWorkOrder(); |
| | | productWorkOrder.setProductProcessRouteItemId(productProcessRouteItem.getId()); |
| | | productWorkOrder.setProductOrderId(order.getId()); |
| | | productWorkOrder.setPlanQuantity(order.getQuantity()); |
| | | productWorkOrder.setWorkOrderNo(workOrderNoStr); |
| | | productWorkOrder.setStatus(1); |
| | | productWorkOrderMapper.insert(productWorkOrder); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case "æ¥åº": |
| | | //è°ç¨ä¸åæ ¼åºåæ¥å£ å
¥ä¸åæ ¼åº |
| | | stockUtils.addUnStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockUnQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(),unqualified.getId()); |
| | | break; |
| | | case "è®©æ¥æ¾è¡": |
| | | //è°ç¨æäº¤åæ ¼çæ¥å£ |
| | | stockUtils.addStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(),unqualified.getId()); |
| | | qualityInspect.setCheckResult("åæ ¼"); |
| | | qualityInspectService.submit(qualityInspect); |
| | | break; |
| | | default: |
| | | break; |
| | | break; |
| | | case "æ¥åº": |
| | | //è°ç¨ä¸åæ ¼åºåæ¥å£ å
¥ä¸åæ ¼åº |
| | | stockUtils.addUnStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockUnQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId()); |
| | | break; |
| | | case "è®©æ¥æ¾è¡": |
| | | //è°ç¨æäº¤åæ ¼çæ¥å£ |
| | | stockUtils.addStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId()); |
| | | qualityInspect.setCheckResult("åæ ¼"); |
| | | qualityInspectService.submit(qualityInspect); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | qualityUnqualified.setInspectState(1);//å·²å¤ç |
| | | return qualityUnqualifiedMapper.updateById(qualityUnqualified); |
| | |
| | | |
| | | @ApiOperation("å é¤äºæ
䏿¥è®°å½") |
| | | @DeleteMapping("/{ids}") |
| | | public R delSafeCertification(@RequestBody List<Integer> ids) { |
| | | public R delSafeAccident(@RequestBody List<Integer> ids) { |
| | | return R.ok(safeAccidentService.removeBatchByIds(ids)); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.safe.dto.SafeTrainingDto; |
| | | import com.ruoyi.safe.pojo.SafeAccident; |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import com.ruoyi.safe.service.SafeAccidentService; |
| | | import com.ruoyi.safe.service.SafeTrainingDetailsService; |
| | | import com.ruoyi.safe.service.SafeTrainingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/safeTraining") |
| | | @Api(tags = "å®å
¨ç产--å®å
¨å¹è®èæ ¸") |
| | | public class SafeTrainingController { |
| | | |
| | | @Autowired |
| | | private SafeTrainingService safeTrainingService; |
| | | |
| | | @Autowired |
| | | private SafeTrainingDetailsService safeTrainingDetailsService; |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public R page(Page page, SafeTrainingDto safeTrainingDto) { |
| | | return R.ok(safeTrainingService.pageSafeTraining(page, safeTrainingDto)); |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢/ç¼è¾å®å
¨å¹è®èæ ¸") |
| | | @PostMapping() |
| | | public R addOrUpdate(@RequestBody SafeTraining safeTraining) { |
| | | return R.ok(safeTrainingService.addOrUpdate(safeTraining)); |
| | | } |
| | | |
| | | @ApiOperation("ç¾å°") |
| | | @PostMapping ("/sign") |
| | | public R sign(@RequestBody SafeTrainingDetails safeTrainingDetails) { |
| | | return R.ok(safeTrainingDetailsService.save(safeTrainingDetails)); |
| | | } |
| | | |
| | | @ApiOperation("ç»ææç»æ¥è¯¢") |
| | | @GetMapping ("/getSafeTraining") |
| | | public R getSafeTraining(Long id) { |
| | | return R.ok(safeTrainingService.getSafeTraining(id)); |
| | | } |
| | | |
| | | @ApiOperation("ç»ææç»ä¿å") |
| | | @PostMapping ("/saveSafeTraining") |
| | | public R saveSafeTraining(@RequestBody SafeTrainingDto safeTrainingDto) { |
| | | return R.ok(safeTrainingService.saveSafeTraining(safeTrainingDto)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤å®å
¨å¹è®èæ ¸") |
| | | @DeleteMapping("/{ids}") |
| | | public R delSafeTraining(@RequestBody List<Integer> ids) { |
| | | return R.ok(safeTrainingService.delSafeTraining(ids)); |
| | | } |
| | | |
| | | @ApiOperation("导åº") |
| | | @PostMapping ("/export") |
| | | public void export(HttpServletResponse response, @RequestBody SafeTraining safeTraining) { |
| | | safeTrainingService.export(response,safeTraining.getId()); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.safe.dto.SafeTrainingDto; |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import com.ruoyi.safe.service.SafeTrainingDetailsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--è®°å½è¯¦æ
å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:15 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/safeTrainingDetails") |
| | | @Api(tags = "å®å
¨ç产--å®å
¨å¹è®èæ ¸--è®°å½è¯¦æ
") |
| | | public class SafeTrainingDetailsController { |
| | | |
| | | |
| | | @Autowired |
| | | private SafeTrainingDetailsService safeTrainingDetailsService; |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public R page(Page page, SafeTrainingDetails safeTrainingDetails) { |
| | | return R.ok(safeTrainingDetailsService.pageDetails(page, safeTrainingDetails)); |
| | | } |
| | | |
| | | @ApiOperation("导åº") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, @RequestBody SafeTrainingDetails safeTrainingDetails) { |
| | | safeTrainingDetailsService.export(response,safeTrainingDetails.getUserId()); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.safe.pojo.SafeHiddenFile; |
| | | import com.ruoyi.safe.pojo.SafeTrainingFile; |
| | | import com.ruoyi.safe.service.SafeTrainingFileService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--éä»¶ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:23 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/safeTrainingFile") |
| | | @Api(tags = "å®å
¨ç产--å®å
¨å¹è®èæ ¸--éä»¶") |
| | | public class SafeTrainingFileController { |
| | | |
| | | @Resource |
| | | private SafeTrainingFileService safeTrainingFileService; |
| | | |
| | | |
| | | /** |
| | | * æ°å¢ |
| | | * @param safeHiddenFile |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public R add(@RequestBody SafeTrainingFile safeHiddenFile) { |
| | | return R.ok(safeTrainingFileService.save(safeHiddenFile)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å é¤") |
| | | public R delSafeHiddenFile(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return R.ok(safeTrainingFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | *å页æ¥è¯¢ |
| | | * @param page |
| | | * @param safeTrainingFile |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public R listPage(Page page, SafeTrainingFile safeTrainingFile) { |
| | | return R.ok(safeTrainingFileService.page(page, Wrappers.<SafeTrainingFile>lambdaQuery().eq(SafeTrainingFile::getSafeTrainingId,safeTrainingFile.getSafeTrainingId()))); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class SafeTrainingDetailsDto extends SafeTrainingDetails { |
| | | |
| | | @ApiModelProperty("å¹è®äººåç¼å·") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("å¹è®äººååç§°") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("ææºå·ç ") |
| | | private String phonenumber; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.dto; |
| | | |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import com.ruoyi.safe.pojo.SafeTrainingFile; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SafeTrainingDto extends SafeTraining { |
| | | |
| | | @ApiModelProperty("æ¥å人æ°") |
| | | private Integer nums; |
| | | |
| | | @ApiModelProperty("è¯ä»·äºº") |
| | | private String assessmentUserName; |
| | | |
| | | @ApiModelProperty("éä»¶éå") |
| | | private List<SafeTrainingFile> safeTrainingFileList; |
| | | |
| | | @ApiModelProperty("å¹è®è®°å½äººå详æ
éå") |
| | | private List<SafeTrainingDetailsDto> safeTrainingDetailsDtoList; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safe.dto.SafeTrainingDetailsDto; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--è®°å½è¯¦æ
Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:15 |
| | | */ |
| | | @Mapper |
| | | public interface SafeTrainingDetailsMapper extends BaseMapper<SafeTrainingDetails> { |
| | | |
| | | List<SafeTrainingDetailsDto> getSafeTraining(@Param("id") Long id); |
| | | |
| | | IPage<SafeTrainingDetails> pageDetails(Page page, @Param("c") SafeTrainingDetails safeTrainingDetails); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.mapper; |
| | | |
| | | import com.ruoyi.safe.pojo.SafeTrainingFile; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--éä»¶ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:23 |
| | | */ |
| | | @Mapper |
| | | public interface SafeTrainingFileMapper extends BaseMapper<SafeTrainingFile> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safe.dto.SafeTrainingDto; |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:06 |
| | | */ |
| | | @Mapper |
| | | public interface SafeTrainingMapper extends BaseMapper<SafeTraining> { |
| | | |
| | | IPage<SafeTrainingDto> pageSafeTraining(Page page, @Param("c") SafeTrainingDto safeTrainingDto); |
| | | |
| | | SafeTrainingDto getSafeTraining(@Param("id") Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:06 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("safe_training") |
| | | @ApiModel(value = "SafeTraining对象", description = "å®å
¨ç产--å®å
¨å¹è®èæ ¸") |
| | | public class SafeTraining implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("课ç¨ç¼å·") |
| | | private String courseCode; |
| | | |
| | | @ApiModelProperty("å¹è®ç®æ ") |
| | | private String trainingObjectives; |
| | | |
| | | @ApiModelProperty("å¹è®å
容") |
| | | private String trainingContent; |
| | | |
| | | @ApiModelProperty("å¹è®æ¹å¼") |
| | | private String trainingMode; |
| | | |
| | | @ApiModelProperty("ç¶æ(0ï¼æªå¼å§1ï¼è¿è¡ä¸ï¼2ï¼å·²ç»æ)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("åå 对象") |
| | | private String participants; |
| | | |
| | | @ApiModelProperty("å¹è®å°ç¹") |
| | | private String placeTraining; |
| | | |
| | | @ApiModelProperty("å¹è®è®²å¸") |
| | | private String trainingLecturer; |
| | | |
| | | @ApiModelProperty("å¹è®æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @NotBlank(message = "å¹è®æ¥æä¸è½ä¸ºç©º") |
| | | private LocalDate trainingDate; |
| | | |
| | | @ApiModelProperty("å¼å§æ¶é´(æ¶åç§)") |
| | | @NotBlank(message = "å¼å§æ¶é´ä¸è½ä¸ºç©º") |
| | | private String openingTime; |
| | | |
| | | @ApiModelProperty("ç»ææ¶é´(æ¶åç§)") |
| | | @NotBlank(message = "ç»ææ¶é´ä¸è½ä¸ºç©º") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty("课é¢å¦å") |
| | | private String projectCredits; |
| | | |
| | | @ApiModelProperty("课æ¶") |
| | | private Double classHour; |
| | | |
| | | @ApiModelProperty("èæ ¸æ¹å¼") |
| | | private String assessmentMethod; |
| | | |
| | | @ApiModelProperty("æ¬æ¬¡å¹è®ç»¼åè¯ä»·") |
| | | private String comprehensiveAssessment; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty("è¯ä»·äººid") |
| | | private Integer assessmentUserId; |
| | | |
| | | @ApiModelProperty("è¯ä»·æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate assessmentDate; |
| | | |
| | | @ApiModelProperty("å¹è®æè¦") |
| | | private String trainingAbstract; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--è®°å½è¯¦æ
|
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:15 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("safe_training_details") |
| | | @ApiModel(value = "SafeTrainingDetails对象", description = "å®å
¨ç产--å®å
¨å¹è®èæ ¸--è®°å½è¯¦æ
") |
| | | public class SafeTrainingDetails implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("ç¨æ·è¡¨æ ¼ï¼userï¼ä¸»é®") |
| | | @NotBlank(message = "ç¨æ·idä¸è½ä¸ºç©º") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("å
³èå®å
¨å¹è®èæ ¸id") |
| | | private Integer safeTrainingId; |
| | | |
| | | @ApiModelProperty("èæ ¸ç»æ") |
| | | private String examinationResults; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | |
| | | |
| | | @ApiModelProperty("å¹è®æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @TableField(exist = false) |
| | | private LocalDate trainingDate; |
| | | |
| | | @ApiModelProperty("课ç¨ç¼å·") |
| | | @TableField(exist = false) |
| | | private String courseCode; |
| | | |
| | | @ApiModelProperty("å¹è®å
容") |
| | | @TableField(exist = false) |
| | | private String trainingContent; |
| | | |
| | | @ApiModelProperty("å¹è®è¯¾æ¶") |
| | | @TableField(exist = false) |
| | | private Double classHour; |
| | | |
| | | @ApiModelProperty("课é¢å¦å") |
| | | @TableField(exist = false) |
| | | private String projectCredits; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | @TableField(exist = false) |
| | | private String remarks; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--éä»¶ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:23 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("safe_training_file") |
| | | @ApiModel(value = "SafeTrainingFile对象", description = "å®å
¨ç产--å®å
¨å¹è®èæ ¸--éä»¶") |
| | | public class SafeTrainingFile implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å
³èå®å
¨å¹è®èæ ¸id") |
| | | private Integer safeTrainingId; |
| | | |
| | | private String name; |
| | | |
| | | private String url; |
| | | |
| | | private Object fileSize; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safe.dto.SafeTrainingDto; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--è®°å½è¯¦æ
æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:15 |
| | | */ |
| | | public interface SafeTrainingDetailsService extends IService<SafeTrainingDetails> { |
| | | |
| | | IPage<SafeTrainingDetails> pageDetails(Page page, SafeTrainingDetails safeTrainingDetails); |
| | | |
| | | void export(HttpServletResponse response, Long userId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.service; |
| | | |
| | | import com.ruoyi.safe.pojo.SafeTrainingFile; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--éä»¶ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:23 |
| | | */ |
| | | public interface SafeTrainingFileService extends IService<SafeTrainingFile> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safe.dto.SafeTrainingDto; |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:06 |
| | | */ |
| | | public interface SafeTrainingService extends IService<SafeTraining> { |
| | | |
| | | IPage<SafeTrainingDto> pageSafeTraining(Page page, SafeTrainingDto safeTrainingDto); |
| | | |
| | | int addOrUpdate(SafeTraining safeTraining); |
| | | |
| | | SafeTrainingDto getSafeTraining(Long id); |
| | | |
| | | int saveSafeTraining(SafeTrainingDto safeTrainingDto); |
| | | |
| | | int delSafeTraining(List<Integer> ids); |
| | | |
| | | void export(HttpServletResponse response, Long id); |
| | | } |
| | |
| | | @Override |
| | | public int add(SafeHidden safeHidden) { |
| | | safeHiddenMapper.insert(safeHidden); |
| | | String datePrefix = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String datePrefix = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd")); |
| | | String no = "YH" + String.format("%s%03d", datePrefix, safeHidden.getId()); |
| | | safeHidden.setHiddenCode(no); |
| | | safeHiddenMapper.updateById(safeHidden); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.safe.dto.SafeTrainingDetailsDto; |
| | | import com.ruoyi.safe.dto.SafeTrainingDto; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import com.ruoyi.safe.mapper.SafeTrainingDetailsMapper; |
| | | import com.ruoyi.safe.service.SafeTrainingDetailsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--è®°å½è¯¦æ
æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:15 |
| | | */ |
| | | @Service |
| | | public class SafeTrainingDetailsServiceImpl extends ServiceImpl<SafeTrainingDetailsMapper, SafeTrainingDetails> implements SafeTrainingDetailsService { |
| | | |
| | | @Autowired |
| | | private SafeTrainingDetailsMapper safeTrainingDetailsMapper; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public IPage<SafeTrainingDetails> pageDetails(Page page, SafeTrainingDetails safeTrainingDetails) { |
| | | return safeTrainingDetailsMapper.pageDetails(page, safeTrainingDetails); |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, Long userId) { |
| | | SafeTrainingDetails safeTrainingDetails = new SafeTrainingDetails(); |
| | | safeTrainingDetails.setUserId(userId); |
| | | SysUser sysUser = sysUserMapper.selectUserById(userId); |
| | | List<SafeTrainingDetails> safeTrainingDetailsList = safeTrainingDetailsMapper.pageDetails(new Page(1, -1), safeTrainingDetails).getRecords(); |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/safe-training-details.docx"); |
| | | Configure configure = Configure.builder() |
| | | .bind("safeTrainingDetailsList", new HackLoopTableRenderPolicy()) |
| | | .build(); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("user", sysUser); |
| | | put("safeTrainingDetailsList", safeTrainingDetailsList); |
| | | }}); |
| | | |
| | | try { |
| | | response.setContentType("application/msword"); |
| | | String fileName = URLEncoder.encode( |
| | | "å¹è®ä¸èæ ¸è®°å½", "UTF-8"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
| | | response.setHeader("Content-disposition", |
| | | "attachment;filename=" + fileName + ".docx"); |
| | | OutputStream os = response.getOutputStream(); |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.service.impl; |
| | | |
| | | import com.ruoyi.safe.pojo.SafeTrainingFile; |
| | | import com.ruoyi.safe.mapper.SafeTrainingFileMapper; |
| | | import com.ruoyi.safe.service.SafeTrainingFileService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸--éä»¶ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:23 |
| | | */ |
| | | @Service |
| | | public class SafeTrainingFileServiceImpl extends ServiceImpl<SafeTrainingFileMapper, SafeTrainingFile> implements SafeTrainingFileService { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.production.pojo.ProductOrder; |
| | | import com.ruoyi.production.pojo.ProductWorkOrder; |
| | | import com.ruoyi.project.system.domain.SysNotice; |
| | | import com.ruoyi.safe.dto.SafeTrainingDetailsDto; |
| | | import com.ruoyi.safe.dto.SafeTrainingDto; |
| | | import com.ruoyi.safe.mapper.SafeTrainingDetailsMapper; |
| | | import com.ruoyi.safe.mapper.SafeTrainingFileMapper; |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import com.ruoyi.safe.mapper.SafeTrainingMapper; |
| | | import com.ruoyi.safe.pojo.SafeTrainingDetails; |
| | | import com.ruoyi.safe.pojo.SafeTrainingFile; |
| | | import com.ruoyi.safe.service.SafeTrainingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®å
¨ç产--å®å
¨å¹è®èæ ¸ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-29 10:54:06 |
| | | */ |
| | | @Service |
| | | public class SafeTrainingServiceImpl extends ServiceImpl<SafeTrainingMapper, SafeTraining> implements SafeTrainingService { |
| | | |
| | | @Autowired |
| | | private SafeTrainingMapper safeTrainingMapper; |
| | | |
| | | @Autowired |
| | | private SafeTrainingFileMapper safeTrainingFileMapper; |
| | | |
| | | @Autowired |
| | | private SafeTrainingDetailsMapper safeTrainingDetailsMapper; |
| | | |
| | | @Override |
| | | public IPage<SafeTrainingDto> pageSafeTraining(Page page, SafeTrainingDto safeTrainingDto) { |
| | | return safeTrainingMapper.pageSafeTraining(page, safeTrainingDto); |
| | | } |
| | | |
| | | @Override |
| | | public int addOrUpdate(SafeTraining safeTraining) { |
| | | if (ObjectUtils.isNull(safeTraining.getId())) { |
| | | String datePrefix = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd")); |
| | | // æ¥è¯¢ä»æ¥å·²åå¨çæå¤§è¯¾ç¨ç¼å· |
| | | QueryWrapper<SafeTraining> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.likeRight("course_code", datePrefix) |
| | | .orderByDesc("course_code") |
| | | .last("LIMIT 1"); |
| | | SafeTraining lastSafeTraining = safeTrainingMapper.selectOne(queryWrapper); |
| | | int sequenceNumber = 1; // é»è®¤åºå· |
| | | if (lastSafeTraining != null && lastSafeTraining.getCourseCode() != null) { |
| | | String lastNo = lastSafeTraining.getCourseCode().toString(); |
| | | if (lastNo.startsWith(datePrefix)) { |
| | | String seqStr = lastNo.substring(datePrefix.length()); |
| | | try { |
| | | sequenceNumber = Integer.parseInt(seqStr) + 1; |
| | | } catch (NumberFormatException e) { |
| | | sequenceNumber = 1; |
| | | } |
| | | } |
| | | } |
| | | // çæå®æ´ç课ç¨ç¼å· |
| | | String no = "KC-" + String.format("%s%03d", datePrefix, sequenceNumber); |
| | | safeTraining.setCourseCode(no); |
| | | } |
| | | //æ ¹æ®æ¶é´å¤æå¹è®ç¶æ |
| | | String trainingDate = safeTraining.getTrainingDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | LocalDateTime openingTime = LocalDateTime.parse((trainingDate + safeTraining.getOpeningTime()), DateTimeFormatter.ofPattern("yyyy-MM-ddHH:mm:ss")); |
| | | LocalDateTime endTime = LocalDateTime.parse((trainingDate + safeTraining.getEndTime()), DateTimeFormatter.ofPattern("yyyy-MM-ddHH:mm:ss")); |
| | | if (LocalDateTime.now().isBefore(openingTime)) { |
| | | //æªå¼å§ |
| | | safeTraining.setState(0); |
| | | } else if (LocalDateTime.now().isAfter(endTime)) { |
| | | //å·²ç»æ |
| | | safeTraining.setState(2); |
| | | } else { |
| | | //è¿è¡ä¸ |
| | | safeTraining.setState(1); |
| | | } |
| | | //æ°å¢ææ´æ° |
| | | saveOrUpdate(safeTraining); |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public SafeTrainingDto getSafeTraining(Long id) { |
| | | //ä¸»è¡¨æ°æ® |
| | | SafeTrainingDto safeTrainingDto = safeTrainingMapper.getSafeTraining(id); |
| | | //éä»¶ |
| | | List<SafeTrainingFile> safeTrainingFiles = safeTrainingFileMapper.selectList(Wrappers.<SafeTrainingFile>lambdaQuery().eq(SafeTrainingFile::getSafeTrainingId, id)); |
| | | safeTrainingDto.setSafeTrainingFileList(safeTrainingFiles); |
| | | //å¹è®è®°å½è¯¦æ
|
| | | List<SafeTrainingDetailsDto> safeTrainingDetailsDto = safeTrainingDetailsMapper.getSafeTraining(id); |
| | | safeTrainingDto.setSafeTrainingDetailsDtoList(safeTrainingDetailsDto); |
| | | return safeTrainingDto; |
| | | } |
| | | |
| | | @Override |
| | | public int saveSafeTraining(SafeTrainingDto safeTrainingDto) { |
| | | //æ´æ°ä¸»è¡¨ |
| | | safeTrainingMapper.updateById(safeTrainingDto); |
| | | //æ´æ°å¹è®è®°å½è¯¦æ
|
| | | safeTrainingDto.getSafeTrainingDetailsDtoList().forEach(safeTrainingDetailsDto -> { |
| | | safeTrainingDetailsMapper.updateById(safeTrainingDetailsDto); |
| | | }); |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public int delSafeTraining(List<Integer> ids) { |
| | | //å é¤ä¸»è¡¨ |
| | | safeTrainingMapper.deleteBatchIds(ids); |
| | | //å é¤éä»¶ |
| | | safeTrainingFileMapper.delete(Wrappers.<SafeTrainingFile>lambdaQuery().in(SafeTrainingFile::getSafeTrainingId, ids)); |
| | | //å é¤å¹è®è®°å½ |
| | | safeTrainingDetailsMapper.delete(Wrappers.<SafeTrainingDetails>lambdaQuery().in(SafeTrainingDetails::getSafeTrainingId, ids)); |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, Long id) { |
| | | SafeTrainingDto safeTrainingDto = safeTrainingMapper.getSafeTraining(id); |
| | | List<SafeTrainingDetailsDto> safeTrainingDetailsDtoList = safeTrainingDetailsMapper.getSafeTraining(id); |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/safe-training.docx"); |
| | | Configure configure = Configure.builder() |
| | | .bind("safeTrainingDetailsDtoList", new HackLoopTableRenderPolicy()) |
| | | .build(); |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("safeTrainingDto", safeTrainingDto); |
| | | put("safeTrainingDetailsDtoList", safeTrainingDetailsDtoList); |
| | | }}); |
| | | |
| | | try { |
| | | response.setContentType("application/msword"); |
| | | String fileName = URLEncoder.encode( |
| | | safeTrainingDto.getCourseCode() + "å¹è®ä¸èæ ¸è®¡å", "UTF-8"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
| | | response.setHeader("Content-disposition", |
| | | "attachment;filename=" + fileName + ".docx"); |
| | | OutputStream os = response.getOutputStream(); |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("åè´§ä¿¡æ¯å表") |
| | | public AjaxResult listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfo> listPage = shippingInfoService.listPage(page,req); |
| | | IPage<ShippingInfoDto> listPage = shippingInfoService.listPage(page,req); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.UPDATE) |
| | | public AjaxResult deductStock(@RequestBody ShippingInfoDto req) throws IOException { |
| | | |
| | | |
| | | return shippingInfoService.deductStock( req) ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | @ApiModelProperty(value = "äº¤è´§æ¥æ") |
| | | private LocalDate deliveryDate; |
| | | } |
| | |
| | | */ |
| | | private Long supplierId; |
| | | |
| | | private Integer approvalStatus; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @date : 2025/10/22 9:32 |
| | | */ |
| | | public interface ShippingInfoMapper extends BaseMapper<ShippingInfo> { |
| | | IPage<ShippingInfo> listPage(Page page,@Param("req") ShippingInfo req); |
| | | IPage<ShippingInfoDto> listPage(Page page, @Param("req") ShippingInfo req); |
| | | |
| | | List<ShippingInfo> listAll(); |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "çäº§ç¶æ") |
| | | private String productionStatus = "æªå¼å§"; |
| | | |
| | | //äº¤è´§æ¥æ |
| | | @ApiModelProperty(value = "äº¤è´§æ¥æ") |
| | | @TableField(value = "delivery_date") |
| | | private LocalDate deliveryDate; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "交货天æ°å·®") |
| | | private Integer deliveryDaysDiff; |
| | | } |
| | | |
| | |
| | | * @date : 2025/10/22 9:33 |
| | | */ |
| | | public interface ShippingInfoService extends IService<ShippingInfo>{ |
| | | IPage<ShippingInfo> listPage(Page page, ShippingInfo req); |
| | | IPage<ShippingInfoDto> listPage(Page page, ShippingInfo req); |
| | | |
| | | boolean deductStock(ShippingInfoDto req) throws IOException; |
| | | |
| | |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | |
| | | public List<CommonFile> getFileListByBusinessId(Long businessId,Integer type) { |
| | | return commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, businessId) |
| | | .eq(CommonFile::getType, type)); |
| | | } |
| | | |
| | | public void deleteByBusinessId(Long businessId,Integer type) { |
| | | commonFileMapper.delete(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, businessId) |
| | | .eq(CommonFile::getType, type)); |
| | |
| | | if(ObjectUtils.isEmpty(invoiceRegistrationProductDto)){ |
| | | throw new RuntimeException("产åå¼ç¥¨å°è´¦æ¥æ¾å¤±è´¥"); |
| | | } |
| | | List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(new LambdaQueryWrapper<InvoiceRegistrationProduct>() |
| | | .eq(InvoiceRegistrationProduct::getSalesLedgerProductId, invoiceRegistrationProductDto.getSalesLedgerProductId())); |
| | | if(CollectionUtils.isNotEmpty(invoiceRegistrationProducts)){ |
| | | invoiceRegistrationProductDto.setNoInvoiceNum(invoiceRegistrationProductDto.getQuantity() |
| | | .subtract(invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getInvoiceNum).reduce(BigDecimal.ZERO, BigDecimal::add))); |
| | | invoiceRegistrationProductDto.setNoInvoiceAmount(invoiceRegistrationProductDto.getTaxInclusiveTotalPrice() |
| | | .subtract(invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getInvoiceAmount).reduce(BigDecimal.ZERO, BigDecimal::add))); |
| | | } |
| | | // æ¥è¯¢éä»¶ |
| | | QueryWrapper<InvoiceLedgerFile> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("invoice_ledger_id", invoiceRegistrationProductDto.getInvoiceLedgerId()); |
| | |
| | | private ApproveProcessServiceImpl approveProcessService; |
| | | |
| | | @Override |
| | | public IPage<ShippingInfo> listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfo> listPage = shippingInfoMapper.listPage(page, req); |
| | | |
| | | public IPage<ShippingInfoDto> listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfoDto> listPage = shippingInfoMapper.listPage(page, req); |
| | | listPage.getRecords().forEach(item ->{ |
| | | item.setCommonFileList(commonFileService.getFileListByBusinessId(item.getId(), FileNameType.SHIP.getValue())); |
| | | }); |
| | | return listPage; |
| | | } |
| | | |
| | |
| | | if (byId == null) { |
| | | throw new RuntimeException("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | //æ£ååºå |
| | | if(!"å·²åè´§".equals(byId.getStatus())){ |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(byId.getSalesLedgerProductId()); |
| | | stockUtils.substractStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId()); |
| | | } |
| | | byId.setExpressNumber(req.getExpressNumber()); |
| | | byId.setExpressCompany(req.getExpressCompany()); |
| | | byId.setStatus("å·²åè´§"); |
| | | byId.setShippingCarNumber(req.getShippingCarNumber()); |
| | | boolean update = this.updateById(req); |
| | | //æ£ååºå |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(req.getSalesLedgerProductId()); |
| | | stockUtils.substractStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId()); |
| | | boolean update = this.updateById(byId); |
| | | // è¿ç§»æä»¶ |
| | | if(CollectionUtils.isNotEmpty(req.getTempFileIds())){ |
| | | tempFileService.migrateTempFilesToFormal(req.getId(), req.getTempFileIds(), FileNameType.SHIP.getValue()); |
| | |
| | | // æ´æ°å¯¹åºç¨æ·ç¶æä¸ºåç¨ |
| | | // æ ¹æ®åå·¥ç¼å·æ¥è¯¢ç¨æ· |
| | | SysUser sysUser = sysUserMapper.selectUserByUserName(staffOnJob.getStaffNo()); |
| | | sysUser.setStatus("1"); |
| | | sysUserMapper.updateUser(sysUser); |
| | | if (sysUser != null) { |
| | | sysUser.setStatus("1"); |
| | | sysUserMapper.updateUser(sysUser); |
| | | } |
| | | |
| | | // æ´æ°ç¦»èç¶æä¸ºç¦»è |
| | | staffOnJob.setStaffState(0); |
| | |
| | | throw new BaseException("ç¼å·ä¸º"+staffOnJobParams.getStaffNo()+"çåå·¥ä¸åå¨,æ æ³æ´æ°!!!"); |
| | | } |
| | | |
| | | String[] ignoreProperties = {"id"};//æé¤id屿§ |
| | | String[] ignoreProperties = {"id"};//æé¤æ´æ°å±æ§ |
| | | |
| | | // è·åææ°ååæ°æ®ï¼å¹¶ä¸æ´æ° |
| | | StaffContract contract = staffContractMapper.selectOne(Wrappers.<StaffContract>lambdaQuery() |
| | |
| | | } |
| | | |
| | | // æ´æ°åå·¥æ°æ® |
| | | BeanUtils.copyProperties(staffOnJobParams,job,ignoreProperties); |
| | | job.setContractExpireTime(staffOnJobParams.getContractEndTime()); |
| | | return staffOnJobMapper.updateById(job); |
| | | staffOnJobParams.setContractExpireTime(staffOnJobParams.getContractEndTime()); |
| | | return staffOnJobMapper.updateById(staffOnJobParams); |
| | | } |
| | | |
| | | //å é¤å
¥è |
| | |
| | | slp.specification_model, |
| | | ppr.process_route_code, |
| | | pb.bom_no, |
| | | ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus |
| | | ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus, |
| | | DATEDIFF(sl.delivery_date, CURDATE()) AS delivery_days_diff |
| | | from product_order po |
| | | left join sales_ledger sl on po.sales_ledger_id = sl.id |
| | | left join sales_ledger_product slp on po.product_model_id = slp.id |
| | |
| | | </resultMap> |
| | | <select id="pageSafeAccident" resultType="com.ruoyi.safe.pojo.SafeAccident"> |
| | | select sa.*, |
| | | su.nick_name createUserName, |
| | | su.nick_name createUserName |
| | | from safe_accident sa |
| | | left join sys_user su on sa.create_user = su.user_id |
| | | where 1=1 |
| | |
| | | and sa.accident_code like concat('%', #{c.accidentCode}, '%') |
| | | </if> |
| | | <if test="c.accidentName != null and c.accidentName != ''"> |
| | | and sa.accident_name like concat('%', #{accidentName}, '%') |
| | | and sa.accident_name like concat('%', #{c.accidentName}, '%') |
| | | </if> |
| | | <if test="c.accidentType != null and c.accidentType != ''"> |
| | | and sa.accident_type like concat('%', #{accidentType}, '%') |
| | | and sa.accident_type like concat('%', #{c.accidentType}, '%') |
| | | </if> |
| | | <if test="c.accidentGrade != null and c.accidentGrade != ''"> |
| | | and sa.accident_grade like concat('%', #{accidentGrade}, '%') |
| | | and sa.accident_grade like concat('%', #{c.accidentGrade}, '%') |
| | | </if> |
| | | </select> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safe.mapper.SafeTrainingDetailsMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.safe.pojo.SafeTrainingDetails"> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="safe_training_id" property="safeTrainingId"/> |
| | | <result column="examination_results" property="examinationResults"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | <select id="getSafeTraining" resultType="com.ruoyi.safe.dto.SafeTrainingDetailsDto"> |
| | | select std.*, |
| | | su.user_name, |
| | | su.nick_name, |
| | | su.phonenumber |
| | | from safe_training_details std |
| | | left join sys_user su on std.user_id = su.user_id |
| | | where std.safe_training_id = #{id} |
| | | </select> |
| | | <select id="pageDetails" resultType="com.ruoyi.safe.pojo.SafeTrainingDetails"> |
| | | select std.*, |
| | | st.* |
| | | from safe_training_details std |
| | | left join safe_training st on std.safe_training_id = st.id |
| | | where std.user_id = #{c.userId} |
| | | <if test="c.trainingDate != null"> |
| | | and st.training_date = #{c.trainingDate} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safe.mapper.SafeTrainingFileMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.safe.pojo.SafeTrainingFile"> |
| | | <id column="id" property="id" /> |
| | | <result column="safe_training_id" property="safeTrainingId" /> |
| | | <result column="name" property="name" /> |
| | | <result column="url" property="url" /> |
| | | <result column="file_size" property="fileSize" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safe.mapper.SafeTrainingMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.safe.pojo.SafeTraining"> |
| | | <id column="id" property="id" /> |
| | | <result column="course_code" property="courseCode" /> |
| | | <result column="training_objectives" property="trainingObjectives" /> |
| | | <result column="training_content" property="trainingContent" /> |
| | | <result column="training_mode" property="trainingMode" /> |
| | | <result column="state" property="state" /> |
| | | <result column="participants" property="participants" /> |
| | | <result column="place_training" property="placeTraining" /> |
| | | <result column="training_lecturer" property="trainingLecturer" /> |
| | | <result column="training_date" property="trainingDate" /> |
| | | <result column="opening_time" property="openingTime" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="project_credits" property="projectCredits" /> |
| | | <result column="class_hour" property="classHour" /> |
| | | <result column="assessment_method" property="assessmentMethod" /> |
| | | <result column="comprehensive_assessment" property="comprehensiveAssessment" /> |
| | | <result column="remarks" property="remarks" /> |
| | | <result column="assessment_user_id" property="assessmentUserId" /> |
| | | <result column="assessment_date" property="assessmentDate" /> |
| | | <result column="training_abstract" property="trainingAbstract" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | </resultMap> |
| | | <select id="pageSafeTraining" resultType="com.ruoyi.safe.dto.SafeTrainingDto"> |
| | | select st.*, |
| | | su.nick_name assessmentUserName, |
| | | count(std.id) nums |
| | | from safe_training st |
| | | left join safe_training_details std on std.safe_training_id = st.id |
| | | left join sys_user su on st.assessment_user_id = su.user_id |
| | | where 1=1 |
| | | <if test="c.placeTraining != null and c.placeTraining != ''"> |
| | | and st.place_training like concat('%', #{c.placeTraining}, '%') |
| | | </if> |
| | | <if test="c.trainingDate != null and c.trainingDate != ''"> |
| | | and st.training_date = #{c.trainingDate} |
| | | </if> |
| | | <if test="c.state != null and c.state != ''"> |
| | | and st.state like concat('%', #{c.state}, '%') |
| | | </if> |
| | | </select> |
| | | <select id="getSafeTraining" resultType="com.ruoyi.safe.dto.SafeTrainingDto"> |
| | | select st.*, |
| | | su.nick_name assessmentUserName |
| | | from safe_training st |
| | | left join sys_user su on st.assessment_user_id = su.user_id |
| | | where st.id=#{id} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="selectSalesLedgerList" resultType="com.ruoyi.sales.pojo.SalesLedger"> |
| | | SELECT |
| | | T1.id, |
| | | T1.sales_contract_no, |
| | | T1.customer_contract_no, |
| | | T1.project_name, |
| | | T1.entry_date, |
| | | T1.salesman, |
| | | T1.customer_id, |
| | | T1.customer_name, |
| | | T1.entry_person, |
| | | T1.remarks, |
| | | T1.attachment_materials, |
| | | T1.tenant_id, |
| | | T1.contract_amount, |
| | | T1.execution_date, |
| | | T2.nick_name AS entry_person_name, |
| | | T1.payment_method |
| | | T1.id, |
| | | T1.sales_contract_no, |
| | | T1.customer_contract_no, |
| | | T1.project_name, |
| | | T1.entry_date, |
| | | T1.salesman, |
| | | T1.customer_id, |
| | | T1.customer_name, |
| | | T1.entry_person, |
| | | T1.remarks, |
| | | T1.attachment_materials, |
| | | T1.tenant_id, |
| | | T1.contract_amount, |
| | | T1.execution_date, |
| | | T2.nick_name AS entry_person_name, |
| | | T1.payment_method, |
| | | DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff |
| | | FROM |
| | | sales_ledger T1 |
| | | sales_ledger T1 |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | | <where> |
| | | <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' "> |
| | |
| | | T1.contract_amount as noInvoiceAmountTotal, |
| | | T1.execution_date, |
| | | T2.nick_name AS entry_person_name, |
| | | T1.payment_method |
| | | T1.payment_method, |
| | | T1.delivery_date, |
| | | DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff |
| | | FROM |
| | | sales_ledger T1 |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | |
| | | <if test="req.purchaseContractNumber != null and req.purchaseContractNumber != '' "> |
| | | AND sl.purchase_contract_number like concat('%',#{req.purchaseContractNumber},'%') |
| | | </if> |
| | | <if test="req.approvalStatus != null and req.approvalStatus != ''"> |
| | | and sl.approval_status = #{req.approvalStatus} |
| | | </if> |
| | | <if test="req.customerContractNo != null and req.customerContractNo != '' "> |
| | | AND sl.customer_contract_no like concat('%',#{req.customerContractNo},'%') |
| | | </if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.sales.mapper.ShippingInfoMapper"> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.sales.pojo.ShippingInfo"> |
| | | <select id="listPage" resultType="com.ruoyi.sales.dto.ShippingInfoDto"> |
| | | SELECT |
| | | s.id, |
| | | s.sales_ledger_id, |