Merge branch 'dev_cr' into dev
| | |
| | | |
| | | @ApiOperation(value = "人åæç»å页æ¥è¯¢") |
| | | @GetMapping("basicInformationOfPersonnelSelectPage") |
| | | public Result<IPage<Map<String, Object>>> basicInformationOfPersonnelSelectPage(Page<List<PersonBasicInfoDetailsDto>> page, String name, Integer departmentId) { |
| | | public Result<IPage<Map<String, Object>>> basicInformationOfPersonnelSelectPage(Page page, String name, Integer departmentId) { |
| | | return Result.success(personBasicInfoService.basicInformationOfPersonnelSelectPage(page, name, departmentId)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/saveCNASFile") |
| | | public Result saveFile(@RequestPart("file") MultipartFile file) { |
| | | String s = FileSaveUtil.uploadWordFile(file); |
| | | return Result.success("ä¸ä¼ æå", s); |
| | | return Result.success(s, "ä¸ä¼ æå"); |
| | | } |
| | | |
| | | @GetMapping("/getAnnexByUserId") |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "人åå¹è®åºæ¬ä¿¡æ¯éä»¶å é¤") |
| | | @GetMapping("/delBasicInfoFileList") |
| | | @DeleteMapping("/delBasicInfoFileList") |
| | | public Result delBasicInfoFileList(Integer basicInfoFileId){ |
| | | return Result.success(personBasicInfoFileService.removeById(basicInfoFileId)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "人åå·¥ä½ç»åå é¤") |
| | | @GetMapping("/delBasicInfoWorkList") |
| | | @DeleteMapping("/delBasicInfoWorkList") |
| | | public Result delBasicInfoWorkList(Integer basicInfoWorkId){ |
| | | return Result.success(personBasicInfoWorkService.removeById(basicInfoWorkId)); |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.entity.DepartmentDto; |
| | | import com.ruoyi.personnel.dto.PersonBasicInfoDto; |
| | | import com.ruoyi.personnel.pojo.PersonBasicInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectPersonBasecInfoAndUser(Page page, String name, Integer departmentId); |
| | | IPage<Map<String, Object>> selectPersonBasecInfoAndUser(Page page, @Param("name") String name, @Param("departmentId") Integer departmentId); |
| | | |
| | | /** |
| | | * å¯¼åºæ¥è¯¢äººåä¿¡æ¯ |
| | |
| | | public interface PersonTrainingDetailedMapper extends MyBaseMapper<PersonTrainingDetailed> { |
| | | |
| | | IPage<PersonTrainingDetailedDto> queryTheAnnualPlanDetailsTable(Page page, |
| | | String trainingLecturerName, |
| | | String courseCode, String trainingDate, |
| | | Integer id, |
| | | Integer userId, |
| | | Integer loginUserId); |
| | | @Param("trainingLecturerName") String trainingLecturerName, |
| | | @Param("courseCode") String courseCode, |
| | | @Param("trainingDate") String trainingDate, |
| | | @Param("id") Integer id, |
| | | @Param("userId") Integer userId, |
| | | @Param("loginUserId") Integer loginUserId); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»è¡¨idæ¥è¯¢è¯¦æ
|
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.personnel.dto.PersonTrainingDto; |
| | | import com.ruoyi.personnel.pojo.PersonTraining; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface PersonTrainingMapper extends BaseMapper<PersonTraining> { |
| | | |
| | | IPage<PersonTrainingDto> personTrainingSelect(Page page, String compilerName, String departLimsId); |
| | | IPage<PersonTrainingDto> personTrainingSelect(Page page, @Param("compilerName") String compilerName,@Param("departLimsId") String departLimsId); |
| | | } |
| | |
| | | */ |
| | | public interface PersonTrainingRecordMapper extends BaseMapper<PersonTrainingRecord> { |
| | | |
| | | List<PersonTrainingRecordDto> trainingAndAssessmentRecordsPage(Integer trainingDetailedId, String userName); |
| | | List<PersonTrainingRecordDto> trainingAndAssessmentRecordsPage(@Param("trainingDetailedId") Integer trainingDetailedId,@Param("userName") String userName); |
| | | |
| | | IPage<PersonTrainingRecordListDto> personnelTrainingPersonnel(Page page, String userName, Integer userId, Integer departLimsId); |
| | | |
| | |
| | | import com.ruoyi.personnel.dto.PersonTrainingDto; |
| | | import com.ruoyi.personnel.pojo.PersonTraining; |
| | | import com.ruoyi.personnel.pojo.PersonTrainingDetailed; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | public interface PersonTrainingService extends IService<PersonTraining> { |
| | | |
| | | IPage<PersonTrainingDto> personTrainingSelect(Page page, |
| | | String compilerName, String departmentId); |
| | | @Param("compilerName") String compilerName, @Param("departmentId") String departmentId); |
| | | |
| | | void personTrainingImport(MultipartFile file, PersonTraining training); |
| | | |
| | |
| | | cpbi.professional_title professionalTitle |
| | | from user u |
| | | left join cnas_person_basic_info cpbi on cpbi.user_id = u.id |
| | | left join user u1 on u1.id = u.create_user |
| | | <where> |
| | | FIND_IN_SET(#{departmentId},u.depart_lims_id) |
| | | <if test="name != null and name != ''"> |
| | |
| | | <mapper namespace="com.ruoyi.personnel.mapper.PersonTrainingRecordMapper"> |
| | | |
| | | <select id="trainingAndAssessmentRecordsPage" resultType="com.ruoyi.personnel.dto.PersonTrainingRecordDto"> |
| | | select cptr.*, u.account, u.name user_name, u.phone, r.name role_name |
| | | select cptr.*, u.account, u.name user_name, u.phone |
| | | from cnas_person_training_record cptr |
| | | left join user u on u.id = cptr.user_id |
| | | left join role r on r.id = u.role_id |
| | | where cptr.course_id = #{trainingDetailedId} |
| | | <if test="userName != null and userName != ''"> |
| | | and u.name like concat('%', #{userName}, '%') |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "å§æåæ¥è¯¢æå订å") |
| | | @PostMapping("/getInsOrderOnInspection") |
| | | public Result<IPage<InsOrder>> getInsOrderOnInspection(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | InsOrder insOrder = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InsOrder.class); |
| | | @GetMapping("/getInsOrderOnInspection") |
| | | public Result<IPage<InsOrder>> getInsOrderOnInspection(Page page ,InsOrder insOrder) throws Exception { |
| | | return Result.success(inspectionOrderService.getInsOrderOnInspection(page, insOrder)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "æ¥è¯¢åæ¡£") |
| | | @GetMapping("/pageSearchNewArchived") |
| | | public Result<IPage<ProcessMethodSearchNewArchivedDto>> pageSearchNewArchived(ProcessMethodSearchNewArchivedDto archived,Page page) throws Exception { |
| | | public Result pageSearchNewArchived(ProcessMethodSearchNewArchivedDto archived,Page page) throws Exception { |
| | | return Result.success(processMethodSearchNewService.pageSearchNewArchived(page, archived)); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "çæ§è®¡åå é¤") |
| | | @GetMapping("/delQualitySupervise") |
| | | @DeleteMapping("/delQualitySupervise") |
| | | public Result delQualitySupervise(Integer qualityMonitorId) { |
| | | return Result.success(qualityMonitorService.removeById(qualityMonitorId)); |
| | | } |
| | |
| | | |
| | | /** |
| | | * çç£è®¡å详æ
å表 |
| | | * @param data |
| | | * @param qualitySuperviseDetails |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "çç£è®¡å详æ
å表") |
| | | @PostMapping("/pageQualitySuperviseDetail") |
| | | @GetMapping("/pageQualitySuperviseDetail") |
| | | public Result<IPage<QualitySuperviseDetailsDto>> pageQualitySuperviseDetail(QualitySuperviseDetailsDto qualitySuperviseDetails,Page page) throws Exception { |
| | | return Result.success(qualitySuperviseService.pageQualitySuperviseDetail(page, qualitySuperviseDetails)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "å é¤çç£è®¡å详æ
") |
| | | @GetMapping("/delQualitySuperviseDetail") |
| | | @DeleteMapping("/delQualitySuperviseDetail") |
| | | public Result delQualitySuperviseDetail(Integer superviseDetailsId){ |
| | | return Result.success(qualitySuperviseDetailsService.removeById(superviseDetailsId)); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.process.pojo.ProcessMethodSearchNewBackups; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param ew |
| | | * @return |
| | | */ |
| | | IPage<ProcessMethodSearchNewBackups> pageSearchNewBackups(Page page, QueryWrapper<ProcessMethodSearchNewBackups> ew); |
| | | IPage<ProcessMethodSearchNewBackups> pageSearchNewBackups(Page page, @Param("ew") QueryWrapper<ProcessMethodSearchNewBackups> ew); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, String>> getRecordUser(Integer superviseDetailsId) { |
| | | List<Map<String, String>> recordUser = baseMapper.getRecordUser(superviseDetailsId); |
| | | return baseMapper.getRecordUser(superviseDetailsId); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 夿¥äººåç»è®°å页æ¥è¯¢ |
| | | * @param data |
| | | * @param page |
| | | * @param foreignRegister |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "夿¥äººåç»è®°å页æ¥è¯¢") |
| | | @PostMapping("/pageForeignRegister") |
| | | public Result<IPage<ForeignRegisterDto>> pageForeignRegister(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | ForeignRegisterDto foreignRegister = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), ForeignRegisterDto.class); |
| | | @GetMapping("/pageForeignRegister") |
| | | public Result<IPage<ForeignRegisterDto>> pageForeignRegister(Page page,ForeignRegisterDto foreignRegister) throws Exception { |
| | | return Result.success(foreignRegisterService.pageForeignRegister(page, foreignRegister)); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "夿¥äººåç»è®°å é¤") |
| | | @GetMapping("/delForeignRegister") |
| | | @DeleteMapping("/delForeignRegister") |
| | | public Result delForeignRegister(Integer registerId){ |
| | | return Result.success(foreignRegisterService.removeById(registerId)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导åºå¤æ¥äººåç»è®°") |
| | | @PostMapping("/exportForeignRegister") |
| | | public void exportForeignRegister(@RequestBody ForeignRegisterDto foreignRegister, HttpServletResponse response){ |
| | | @GetMapping("/exportForeignRegister") |
| | | public void exportForeignRegister(ForeignRegisterDto foreignRegister, HttpServletResponse response){ |
| | | foreignRegisterService.exportForeignRegister(foreignRegister, response); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * å®å
¨å
å¡ä¸åºå¤çå页æ¥è¯¢ |
| | | * @param data |
| | | * @param page |
| | | * @param internalWastes |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "å®å
¨å
å¡ä¸åºå¤çå页æ¥è¯¢") |
| | | @PostMapping("/pageInternalWastes") |
| | | public Result<IPage<InternalWastesDto>> pageInternalWastes(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | InternalWastes internalWastes = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InternalWastes.class); |
| | | @GetMapping("/pageInternalWastes") |
| | | public Result<IPage<InternalWastesDto>> pageInternalWastes(Page page,InternalWastes internalWastes) throws Exception { |
| | | return Result.success(internalWastesService.pageInternalWastes(page, internalWastes)); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "å®å
¨å
å¡ä¸åºå¤çå é¤") |
| | | @GetMapping("/delInternalWastes") |
| | | @DeleteMapping("/delInternalWastes") |
| | | public Result delInternalWastes(Integer wastesId){ |
| | | return Result.success(internalWastesService.delInternalWastes(wastesId)); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesContents; |
| | | import com.ruoyi.require.service.ProcurementSuppliesContentsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "æå¡åä¾åºåéè´å
¬å¸å表") |
| | | @RestController |
| | | @RequestMapping("/procurementSuppliesContents") |
| | | @AllArgsConstructor |
| | | public class ProcurementSuppliesContentsController { |
| | | |
| | | private ProcurementSuppliesContentsService procurementSuppliesService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ç®å½å表") |
| | | @GetMapping("/directoryListing") |
| | | public Result directoryListing() { |
| | | return Result.success(procurementSuppliesService.directoryListing()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®idæ¥è¯¢") |
| | | @GetMapping("/selectProcurementSuppliesContentById") |
| | | public Result selectProcurementSuppliesContentById(Integer id) { |
| | | return Result.success(procurementSuppliesService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å åèç¹") |
| | | @PostMapping("/addProcurementSuppliesContents") |
| | | public Result addProcurementSuppliesContents(@RequestBody ProcurementSuppliesContents procurementSupplies) { |
| | | procurementSupplies.setUpdateTime(LocalDateTime.now()); |
| | | procurementSuppliesService.save(procurementSupplies); |
| | | return Result.success(procurementSupplies.getId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ´æ°åèç¹") |
| | | @PostMapping("/updateProcurementSuppliesContents") |
| | | public Result updateProcurementSuppliesContents(@RequestBody ProcurementSuppliesContents procurementSupplies) { |
| | | return Result.success(procurementSuppliesService.updateById(procurementSupplies)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤åèç¹") |
| | | @DeleteMapping("/deleteProcurementSuppliesContentById") |
| | | public Result deleteProcurementSuppliesContentById(Integer id) { |
| | | List<ProcurementSuppliesContents> list = procurementSuppliesService.list(new LambdaQueryWrapper<ProcurementSuppliesContents>() |
| | | .eq(ProcurementSuppliesContents::getParentId, id)); |
| | | if(list.size() > 0) { |
| | | throw new ErrorException("该èç¹å«æåèç¹,请å
å é¤åèç¹"); |
| | | } |
| | | procurementSuppliesService.removeById(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææèç¹") |
| | | @GetMapping("/getNodeNames") |
| | | public Result getNodeNames() { |
| | | return Result.success(procurementSuppliesService.getNodeNames()); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åææäººå") |
| | | @GetMapping("/getUserList") |
| | | public Result getUserList() { |
| | | return Result.success(procurementSuppliesService.getUserList()); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.require.dto.ProcurementSuppliesExpendDto; |
| | | import com.ruoyi.require.service.ProcurementSuppliesExpendsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-11-15 03:47:19 |
| | | */ |
| | | @Api(tags = "æå¡åä¾åºåéè´èææ¶è") |
| | | @RestController |
| | | @RequestMapping("/procurementSuppliesExpends") |
| | | public class ProcurementSuppliesExpendsController { |
| | | @Autowired |
| | | private ProcurementSuppliesExpendsService procurementSuppliesExpendsService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææè®°å½") |
| | | @GetMapping("/procurementSuppliesExpendlist") |
| | | public Result procurementSuppliesExpendlist(Long procurementSuppliesListId) { |
| | | return Result.success(procurementSuppliesExpendsService.selectAll(procurementSuppliesListId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æ¶èè®°å½") |
| | | @PostMapping("/addProcurementSuppliesExpends") |
| | | public Result addProcurementSuppliesExpends(@RequestBody ProcurementSuppliesExpendDto dto) throws ServiceException { |
| | | Integer added = procurementSuppliesExpendsService.addExpends(dto); |
| | | |
| | | if ( added == 0) { |
| | | return Result.fail("å½ååºåä¸è¶³"); |
| | | } |
| | | return Result.success(added); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿¶èè®°å½") |
| | | @DeleteMapping("/deleteProcurementSuppliesExpends") |
| | | public Result deleteProcurementSuppliesExpends(Long expendId) throws ServiceException { |
| | | return Result.success(procurementSuppliesExpendsService.deleteExpends(expendId)); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤èæ") |
| | | @PostMapping("/deleteProcurementSuppliesList") |
| | | public Result deleteProcurementSuppliesList(@RequestBody ProcurementSuppliesListDto dto) { |
| | | return Result.success(listMapper.deleteById(dto.getId())); |
| | | @DeleteMapping("/deleteProcurementSuppliesList") |
| | | public Result deleteProcurementSuppliesList(Long id) { |
| | | return Result.success(listMapper.deleteById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åºèæå表") |
| | | @PostMapping("/exportProcurementSuppliesList/{parentId}") |
| | | public void exportProcurementSuppliesList( @PathVariable Integer parentId ,HttpServletResponse response) throws Exception { |
| | | @GetMapping("/exportProcurementSuppliesList") |
| | | public void exportProcurementSuppliesList(Integer parentId ,HttpServletResponse response) throws Exception { |
| | | procurementSuppliesListService.exportProcurementSuppliesList(parentId,response); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.require.dto.StoreDto; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesConsumables; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesStore; |
| | | import com.ruoyi.require.service.ProcurementSuppliesConsumablesService; |
| | | import com.ruoyi.require.service.ProcurementSuppliesStoreService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags = "æå¡åä¾åºåéè´èæå
¥åº") |
| | | @RestController |
| | | @RequestMapping("/procurementSuppliesStore") |
| | | @AllArgsConstructor |
| | | public class ProcurementSuppliesStoreController { |
| | | |
| | | private ProcurementSuppliesStoreService storeService; |
| | | |
| | | private ProcurementSuppliesConsumablesService consumablesService; |
| | | |
| | | |
| | | @ApiOperation(value = "èæå
¥åºå页æ¥è¯¢") |
| | | @GetMapping("/storeList") |
| | | public Result storeList(Page page,StoreDto storeDto) throws Exception { |
| | | return Result.success(storeService.selectStoreList(page, storeDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å èæå
¥åºå表") |
| | | @PostMapping("/addStore") |
| | | public Result addStore(@RequestBody Map<String,Object> map) { |
| | | storeService.addStore(map); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤èæå
¥åº") |
| | | @DeleteMapping("/deleteStore") |
| | | public Result deleteStore(@RequestParam("id") Integer id,@RequestParam("consumablesId") Integer consumablesId) { |
| | | storeService.deleteStore(id,consumablesId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ´æ°èæå
¥åº") |
| | | @PostMapping("/updateStore") |
| | | public Result updateStore(@RequestBody Map<String,Object> map) { |
| | | storeService.updateStore(map); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®idæ¥è¯¢èæå
¥åº") |
| | | @GetMapping("/selectStoreById") |
| | | public Result selectStore(Integer id) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | ProcurementSuppliesStore procurementSuppliesStore = storeService.getById(id); |
| | | List<ProcurementSuppliesConsumables> list = consumablesService.list(new LambdaQueryWrapper<ProcurementSuppliesConsumables>() |
| | | .eq(ProcurementSuppliesConsumables::getStoreId, id)); |
| | | map.put("store", procurementSuppliesStore); |
| | | map.put("consumables", list); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @GetMapping("/exportExcel") |
| | | public void exportExcel(Integer parentId, HttpServletResponse response) throws IOException { |
| | | storeService.exportExcel(parentId, response); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation("å é¤ä¾åºå") |
| | | @PostMapping("/delSupplierManagement") |
| | | @DeleteMapping("/delSupplierManagement") |
| | | public Result delSupplierManagement(Integer supplierManagementId) { |
| | | return Result.success(supplierManagementService.removeById(supplierManagementId)); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.require.pojo.SuppliersDirectoryContents; |
| | | import com.ruoyi.require.service.SuppliersDirectoryContentsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡åä¾åºåéè´ç®å½ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-17 06:14:51 |
| | | */ |
| | | @Api(tags = "ä¾åºåç®¡çæ ") |
| | | @RestController |
| | | @RequestMapping("/suppliersDirectoryContents") |
| | | public class SuppliersDirectoryContentsController { |
| | | |
| | | @Autowired |
| | | private SuppliersDirectoryContentsService suppliersDirectoryContentsService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ç®å½å表") |
| | | @GetMapping("/suppliersDirectoryContentsListing") |
| | | public Result suppliersDirectoryContentsListing() { |
| | | return Result.success(suppliersDirectoryContentsService.directoryListing()); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®idæ¥è¯¢") |
| | | @GetMapping("/selectSuppliersDirectoryContentsById") |
| | | public Result selectSuppliersDirectoryContentsById(Integer id) { |
| | | return Result.success(suppliersDirectoryContentsService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å åèç¹") |
| | | @PostMapping("/addSuppliersDirectoryContents") |
| | | public Result addSuppliersDirectoryContents(@RequestBody SuppliersDirectoryContents suppliersDirectoryContents ) { |
| | | suppliersDirectoryContents.setUpdateTime(LocalDateTime.now()); |
| | | suppliersDirectoryContentsService.save(suppliersDirectoryContents); |
| | | return Result.success(suppliersDirectoryContents.getId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ´æ°åèç¹") |
| | | @PostMapping("/updateSuppliersDirectoryContents") |
| | | public Result updateSuppliersDirectoryContents(@RequestBody SuppliersDirectoryContents suppliersDirectoryContents) { |
| | | return Result.success(suppliersDirectoryContentsService.updateById(suppliersDirectoryContents)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤åèç¹") |
| | | @DeleteMapping("/deleteSuppliersDirectoryContentsById") |
| | | public Result deleteSuppliersDirectoryContentsById(Integer id) { |
| | | List<SuppliersDirectoryContents> list = suppliersDirectoryContentsService.list(new LambdaQueryWrapper<SuppliersDirectoryContents>() |
| | | .eq(SuppliersDirectoryContents::getParentId, id)); |
| | | if(list.size() > 0) { |
| | | throw new ErrorException("该èç¹å«æåèç¹,请å
å é¤åèç¹"); |
| | | } |
| | | suppliersDirectoryContentsService.removeById(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææèç¹") |
| | | @GetMapping("/getSuppliersDirectoryContentsNodeNames") |
| | | public Result getSuppliersDirectoryContentsNodeNames() { |
| | | return Result.success(suppliersDirectoryContentsService.getSuppliersDirectoryContentsNodeNames()); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.dto; |
| | | |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesExpends; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProcurementSuppliesExpendDto extends ProcurementSuppliesExpends { |
| | | private String listName; // 项ç®èæåç§° |
| | | private String enterUserName; // å½å
¥äººåç§° |
| | | private String updateUserName; // æ´æ°äººåç§° |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.dto; |
| | | |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesStore; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreDto extends ProcurementSuppliesStore { |
| | | |
| | | |
| | | private String consumablesName; |
| | | |
| | | private Integer storeNumber; |
| | | |
| | | private Double totalPrice; |
| | | |
| | | private String registrantName; |
| | | |
| | | private String storageUserName; |
| | | |
| | | private Integer consumablesId; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class StoreExcel { |
| | | @ExcelProperty("å
¥åºåå·") |
| | | private String oddNumbers; |
| | | |
| | | @ExcelProperty("èæåç§°") |
| | | private String consumablesName; |
| | | |
| | | @ExcelProperty("å
¥åºæ°é") |
| | | private Integer storeNumber; |
| | | |
| | | @ExcelProperty("å
¥åºæ»ä»·") |
| | | private Double totalPrice; |
| | | |
| | | @ExcelProperty("å
¥åºäºº") |
| | | private String storageUserName; |
| | | |
| | | @ExcelProperty("å
¥åºæ¥æ") |
| | | private LocalDate storageTime; |
| | | |
| | | @ExcelProperty("说æ") |
| | | private String remark; |
| | | |
| | | @ExcelProperty("ç»è®°äºº") |
| | | private String registrantName; |
| | | |
| | | @ExcelProperty("ç»è®°æ¥æ") |
| | | private LocalDate registrantTime; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.require.dto.FeTempHumRecordDto; |
| | | import com.ruoyi.require.pojo.FeTempHumRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface FeTempHumRecordMapper extends BaseMapper<FeTempHumRecord> { |
| | | |
| | | IPage<FeTempHumRecordDto> getFeTempHumRecordPage(Page page, Integer dateId); |
| | | IPage<FeTempHumRecordDto> getFeTempHumRecordPage(Page page, @Param("dateId") Integer dateId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesConsumables; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface ProcurementSuppliesConsumablesMapper extends BaseMapper<ProcurementSuppliesConsumables> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesExpends; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-11-15 03:47:19 |
| | | */ |
| | | public interface ProcurementSuppliesExpendsMapper extends BaseMapper<ProcurementSuppliesExpends> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.require.dto.StoreDto; |
| | | import com.ruoyi.require.excel.StoreExcel; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesStore; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface ProcurementSuppliesStoreMapper extends BaseMapper<ProcurementSuppliesStore> { |
| | | |
| | | IPage<StoreDto> selectStoreList(Page page, @Param("ew") QueryWrapper<StoreDto> ew); |
| | | |
| | | /** |
| | | * åæ å
³èçæ¡ä»¶ï¼ï¼ï¼ç®å没æå
³èå
³ç³» WHERE s.contents_id = #{contentsId} |
| | | * @param contentsId |
| | | * @return |
| | | */ |
| | | List<StoreExcel> exportExcel(Integer contentsId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.require.pojo.SuppliersDirectoryContents; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡åä¾åºåéè´ç®å½ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-17 06:14:51 |
| | | */ |
| | | public interface SuppliersDirectoryContentsMapper extends BaseMapper<SuppliersDirectoryContents> { |
| | | |
| | | } |
| | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | private Integer registerId; |
| | | |
| | | @ApiModelProperty("ç»è®°å¦æ") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate registerDate; |
| | | |
| | | @ApiModelProperty("è¿å
¥åºå") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("procurement_supplies_consumables") |
| | | @ApiModel("èæéè´æç»è¡¨") |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | | public class ProcurementSuppliesConsumables { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("èæä¸»è¡¨id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty("èæåç§°") |
| | | private String consumablesName; |
| | | |
| | | @ApiModelProperty("åä»·") |
| | | private Double unitPrice; |
| | | |
| | | @ApiModelProperty("å
¥åºæ°é") |
| | | private Integer storeNumber; |
| | | |
| | | @ApiModelProperty("æ»ä»·") |
| | | private Double totalPrice; |
| | | |
| | | @ApiModelProperty("è´§å·") |
| | | private String itemNumber; |
| | | |
| | | @ApiModelProperty("ç±»å«") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("è§æ ¼") |
| | | private String specifications; |
| | | |
| | | @ApiModelProperty("åèä¾åºå") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty("计éåä½") |
| | | private String unit; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-11-15 03:47:19 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("procurement_supplies_expends") |
| | | @ApiModel(value = "ProcurementSuppliesExpends对象", description = "") |
| | | public class ProcurementSuppliesExpends implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty("主表Id") |
| | | @TableId(value = "expend_id", type = IdType.AUTO) |
| | | private Long expendId; |
| | | |
| | | @ApiModelProperty("èæId") |
| | | private Long listId; |
| | | |
| | | @ApiModelProperty("æ¶èæ°é") |
| | | private Integer amount; |
| | | |
| | | @ApiModelProperty("å½å
¥äººid") |
| | | private Integer enterUserId; |
| | | |
| | | @ApiModelProperty("æ´æ°äººid") |
| | | private Integer updateUserId; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @TableName("procurement_supplies_store") |
| | | @ApiModel("èæå
¥åºè¡¨") |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | | public class ProcurementSuppliesStore implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("ç®å½id") |
| | | private Integer contentsId; |
| | | |
| | | @ApiModelProperty("å
¥åºåå·") |
| | | private String oddNumbers; |
| | | |
| | | @ApiModelProperty("å
¥åºåºå") |
| | | private String inventory; |
| | | |
| | | @ApiModelProperty("å
¥åºæ»éé¢") |
| | | private Double totalAmount; |
| | | |
| | | @ApiModelProperty("å
¥åºäºº") |
| | | private Integer storageUser; |
| | | |
| | | @ApiModelProperty("å
¥åºæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate storageTime; |
| | | |
| | | @ApiModelProperty("å
¥åºè¯´æ") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("ç»è®°äºº") |
| | | private Integer registrant; |
| | | |
| | | @ApiModelProperty("ç»è®°æ¶é´") |
| | | private LocalDate registrantTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡åä¾åºåéè´ç®å½ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-17 06:14:51 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("suppliers_directory_contents") |
| | | @ApiModel(value = "SuppliersDirectoryContents对象", description = "æå¡åä¾åºåéè´ç®å½") |
| | | public class SuppliersDirectoryContents implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("èç¹åç§°") |
| | | private String nodeName; |
| | | |
| | | @ApiModelProperty("代å·") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("æ´æ°äºº") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("ç¶èç¹") |
| | | private Integer parentId; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private List<SuppliersDirectoryContents> children; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesConsumables; |
| | | |
| | | public interface ProcurementSuppliesConsumablesService extends IService<ProcurementSuppliesConsumables> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.require.dto.ProcurementSuppliesExpendDto; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesExpends; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-11-15 03:47:19 |
| | | */ |
| | | public interface ProcurementSuppliesExpendsService extends IService<ProcurementSuppliesExpends> { |
| | | public List<ProcurementSuppliesExpendDto> selectAll(Long procurementSuppliesListId); |
| | | public Integer addExpends(ProcurementSuppliesExpendDto expendDto) throws ServiceException; |
| | | public Integer deleteExpends(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.require.dto.StoreDto; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesStore; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | |
| | | public interface ProcurementSuppliesStoreService extends IService<ProcurementSuppliesStore> { |
| | | void addStore(Map<String,Object> map); |
| | | void updateStore(Map<String,Object> map); |
| | | |
| | | void deleteStore(Integer id, Integer consumablesId); |
| | | IPage<StoreDto> selectStoreList(Page page, StoreDto storeDto); |
| | | |
| | | void exportExcel(Integer contentsId, HttpServletResponse response) throws IOException; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.require.pojo.SuppliersDirectoryContents; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡åä¾åºåéè´ç®å½ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-17 06:14:51 |
| | | */ |
| | | public interface SuppliersDirectoryContentsService extends IService<SuppliersDirectoryContents> { |
| | | |
| | | ArrayList<SuppliersDirectoryContents> directoryListing(); |
| | | List<Map<String, Object>> getSuppliersDirectoryContentsNodeNames(); |
| | | } |
| | |
| | | detail.setIndex(index); |
| | | index++; |
| | | } |
| | | |
| | | |
| | | // è·åè·¯å¾ |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/internal-wastes.docx"); |
| | | Configure configure = Configure.builder() |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.require.mapper.ProcurementSuppliesConsumablesMapper; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesConsumables; |
| | | import com.ruoyi.require.service.ProcurementSuppliesConsumablesService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProcurementSuppliesConsumablesServiceImpl extends ServiceImpl<ProcurementSuppliesConsumablesMapper, ProcurementSuppliesConsumables> |
| | | implements ProcurementSuppliesConsumablesService { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.require.dto.ProcurementSuppliesExpendDto; |
| | | import com.ruoyi.require.mapper.ProcurementSuppliesExpendsMapper; |
| | | import com.ruoyi.require.mapper.ProcurementSuppliesListMapper; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesExpends; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesList; |
| | | import com.ruoyi.require.service.ProcurementSuppliesExpendsService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-11-15 03:47:19 |
| | | */ |
| | | @Service |
| | | public class ProcurementSuppliesExpendsServiceImpl extends ServiceImpl<ProcurementSuppliesExpendsMapper, ProcurementSuppliesExpends> implements ProcurementSuppliesExpendsService { |
| | | @Autowired |
| | | private ProcurementSuppliesExpendsMapper expendsMapper; |
| | | |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | private ProcurementSuppliesListMapper listMapper; |
| | | |
| | | @Override |
| | | public List<ProcurementSuppliesExpendDto> selectAll(Long procurementSuppliesListId) { |
| | | List<ProcurementSuppliesExpendDto> res = new ArrayList<>(); |
| | | List<ProcurementSuppliesExpends> list = expendsMapper.selectList(new QueryWrapper<ProcurementSuppliesExpends>().lambda().eq(ProcurementSuppliesExpends::getListId, procurementSuppliesListId)); |
| | | for (ProcurementSuppliesExpends procurementSuppliesExpend : list) { |
| | | ProcurementSuppliesExpendDto dto = new ProcurementSuppliesExpendDto(); |
| | | BeanUtils.copyProperties(procurementSuppliesExpend, dto); |
| | | |
| | | User enterUser = userMapper.selectById(procurementSuppliesExpend.getEnterUserId()); |
| | | User updateUser = userMapper.selectById(procurementSuppliesExpend.getUpdateUserId()); |
| | | dto.setEnterUserName(enterUser.getName()); |
| | | dto.setUpdateUserName(updateUser.getName()); |
| | | res.add(dto); |
| | | } |
| | | |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Integer addExpends(ProcurementSuppliesExpendDto expendDto) throws ServiceException { |
| | | ProcurementSuppliesList list = listMapper.selectProcurementSuppliesListForUpdate(expendDto.getListId()); |
| | | |
| | | ProcurementSuppliesExpends expends = new ProcurementSuppliesExpends(); |
| | | BeanUtils.copyProperties(expendDto, expends); |
| | | expends.setEnterUserId(SecurityUtils.getUserId().intValue()); |
| | | expends.setUpdateUserId(SecurityUtils.getUserId().intValue()); |
| | | if (list.getCurrentAmount() < expendDto.getAmount()) { |
| | | return 0; |
| | | } |
| | | |
| | | list.setCurrentAmount(list.getCurrentAmount() - expendDto.getAmount()); |
| | | |
| | | listMapper.updateById(list); |
| | | return expendsMapper.insert(expends); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Integer deleteExpends(Long id) { |
| | | ProcurementSuppliesExpends expend = expendsMapper.selectById(id); |
| | | ProcurementSuppliesList list = listMapper.selectProcurementSuppliesListForUpdate(expend.getListId()); |
| | | list.setCurrentAmount(list.getCurrentAmount() + expend.getAmount()); |
| | | list.setUpdateUser(SecurityUtils.getUserId().intValue()); |
| | | listMapper.updateById(list); |
| | | return expendsMapper.deleteById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.common.PrintChina; |
| | | import com.ruoyi.require.dto.StoreDto; |
| | | import com.ruoyi.require.excel.StoreExcel; |
| | | import com.ruoyi.require.mapper.ProcurementSuppliesConsumablesMapper; |
| | | import com.ruoyi.require.mapper.ProcurementSuppliesStoreMapper; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesConsumables; |
| | | import com.ruoyi.require.pojo.ProcurementSuppliesStore; |
| | | import com.ruoyi.require.service.ProcurementSuppliesStoreService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProcurementSuppliesStoreServiceImpl extends ServiceImpl<ProcurementSuppliesStoreMapper, ProcurementSuppliesStore> |
| | | implements ProcurementSuppliesStoreService { |
| | | |
| | | private ProcurementSuppliesConsumablesMapper consumablesMapper; |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addStore(Map<String,Object> map) { |
| | | ProcurementSuppliesStore procurementSuppliesStore = JSONObject.parseObject(JSONObject.toJSONString(map.get("store")), ProcurementSuppliesStore.class); |
| | | procurementSuppliesStore.setRegistrant(SecurityUtils.getUserId().intValue()); |
| | | procurementSuppliesStore.setRegistrantTime(LocalDate.now()); |
| | | baseMapper.insert(procurementSuppliesStore); |
| | | List<ProcurementSuppliesConsumables> list = JSON.parseArray(JSONObject.toJSONString(map.get("consumables")), ProcurementSuppliesConsumables.class); |
| | | // çæè´§å· |
| | | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | if(!Objects.isNull(list) && list.size() > 0) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setStoreId(procurementSuppliesStore.getId()); |
| | | String itemNumber ="HCRK" + LocalDate.now().format(dateTimeFormatter) + String.format("%03d", i); |
| | | list.get(i).setItemNumber(itemNumber); |
| | | consumablesMapper.insert(list.get(i)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateStore(Map<String,Object> map) { |
| | | ProcurementSuppliesStore procurementSuppliesStore = JSONObject.parseObject(JSONObject.toJSONString(map.get("store")), ProcurementSuppliesStore.class); |
| | | baseMapper.updateById(procurementSuppliesStore); |
| | | List<ProcurementSuppliesConsumables> list = JSON.parseArray(JSONObject.toJSONString(map.get("consumables")), ProcurementSuppliesConsumables.class); |
| | | consumablesMapper.delete(new LambdaQueryWrapper<ProcurementSuppliesConsumables>() |
| | | .eq(ProcurementSuppliesConsumables::getStoreId, procurementSuppliesStore.getId())); |
| | | if(!Objects.isNull(list) && list.size() > 0) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setId(null); |
| | | list.get(i).setStoreId(procurementSuppliesStore.getId()); |
| | | consumablesMapper.insert(list.get(i)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteStore(Integer id, Integer consumablesId) { |
| | | consumablesMapper.deleteById(consumablesId); |
| | | List<ProcurementSuppliesConsumables> consumables = consumablesMapper.selectList(new LambdaQueryWrapper<ProcurementSuppliesConsumables>() |
| | | .eq(ProcurementSuppliesConsumables::getStoreId, id)); |
| | | // 夿æ¯å¦è¿æèæ æ²¡æå°±å°ä¸»è¡¨Storeå é¤ |
| | | if(CollectionUtils.isEmpty(consumables)) { |
| | | baseMapper.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<StoreDto> selectStoreList(Page page, StoreDto storeDto) { |
| | | IPage<StoreDto> iPage = baseMapper.selectStoreList(page, QueryWrappers.queryWrappers(storeDto)); |
| | | return iPage; |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * @param contentsId |
| | | * @param response |
| | | */ |
| | | @Override |
| | | public void exportExcel(Integer contentsId, HttpServletResponse response) throws IOException { |
| | | List<StoreExcel> storeExcels = baseMapper.exportExcel(contentsId); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // è¿éURLEncoder.encodeå¯ä»¥é²æ¢ä¸æä¹±ç å½ç¶åeasyexcel没æå
³ç³» |
| | | String fileName = null; |
| | | try { |
| | | fileName = URLEncoder.encode("èæå
¥åº", "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet(0, "èæå
¥åº").head(StoreExcel.class).build(); |
| | | excelWriter.write(storeExcels, writeSheet); |
| | | excelWriter.finish(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.require.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.require.mapper.SuppliersDirectoryContentsMapper; |
| | | import com.ruoyi.require.pojo.SuppliersDirectoryContents; |
| | | import com.ruoyi.require.service.SuppliersDirectoryContentsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡åä¾åºåéè´ç®å½ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-17 06:14:51 |
| | | */ |
| | | @Service |
| | | public class SuppliersDirectoryContentsServiceImpl extends ServiceImpl<SuppliersDirectoryContentsMapper, SuppliersDirectoryContents> implements SuppliersDirectoryContentsService { |
| | | |
| | | @Override |
| | | public ArrayList<SuppliersDirectoryContents> directoryListing() { |
| | | ArrayList<SuppliersDirectoryContents> list = new ArrayList<>(); |
| | | // æ¥åºä¸çº§ç®å½ |
| | | List<SuppliersDirectoryContents> firstLevel = baseMapper.selectList(new LambdaQueryWrapper<SuppliersDirectoryContents>() |
| | | .isNull(SuppliersDirectoryContents::getParentId)); |
| | | |
| | | // æ¥åºå«æç¶èç¹ç å¹¶éè¿ç¶èç¹åç» |
| | | List<SuppliersDirectoryContents> seconds = baseMapper.selectList(new LambdaQueryWrapper<SuppliersDirectoryContents>() |
| | | .isNotNull(SuppliersDirectoryContents::getParentId)); |
| | | if(firstLevel.size() > 0){ |
| | | Map<Integer, List<SuppliersDirectoryContents>> collect = seconds.stream() |
| | | .collect(Collectors.groupingBy(SuppliersDirectoryContents::getParentId)); |
| | | // æ ¹æ®åç»çkey èµå¼å¯¹åºçchildren |
| | | for (int i = 0; i < firstLevel.size(); i++) { |
| | | recursion(firstLevel.get(i),collect); |
| | | list.add(firstLevel.get(i)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getSuppliersDirectoryContentsNodeNames() { |
| | | List<SuppliersDirectoryContents> procurementSuppliesContents = baseMapper.selectList(null); |
| | | List<Map<String, Object>> collect = new ArrayList<>(); |
| | | if(procurementSuppliesContents.size() > 0) { |
| | | collect = procurementSuppliesContents.stream().map(item -> { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("id", item.getId()); |
| | | map.put("nodeName", item.getNodeName()); |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | return collect; |
| | | } |
| | | |
| | | |
| | | public SuppliersDirectoryContents recursion(SuppliersDirectoryContents firstLevel, Map<Integer, List<SuppliersDirectoryContents>> collect) { |
| | | // å°ç¶èç¹çchildrenèµå¼ |
| | | if(collect.containsKey(firstLevel.getId())) { |
| | | List<SuppliersDirectoryContents> procurementSupplies = collect.get(firstLevel.getId()); |
| | | firstLevel.setChildren(procurementSupplies); |
| | | for (int i = 0; i < procurementSupplies.size(); i++) { |
| | | recursion(procurementSupplies.get(i),collect); |
| | | } |
| | | } |
| | | return firstLevel; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.require.mapper.FeIlluminationMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.require.pojo.FeIllumination"> |
| | | <id column="intensity_illumination_id" property="intensityIlluminationId" /> |
| | | <result column="device_id" property="deviceId" /> |
| | | <result column="conclusion" property="conclusion" /> |
| | | <result column="tester_id" property="testerId" /> |
| | | <result column="checker_id" property="checkerId" /> |
| | | <result column="test_date" property="testDate" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="getFeLightningProtection" resultType="com.ruoyi.require.dto.FeIlluminationDto"> |
| | | SELECT cdi.*, u1.name checker_user, u2.name tester_user, dv.device_name, dv.management_number |
| | | FROM cnas_fe_illumination cdi |
| | | left join device dv on dv.id = cdi.device_id |
| | | left join user u1 on u1.id = cdi.checker_id |
| | | left join user u2 on u2.id = cdi.tester_id |
| | | </select> |
| | | |
| | | <!-- æ¥è¯¢ç
§æè®°å½ --> |
| | | <select id="selectFeIllumination" resultType="com.ruoyi.require.dto.FeIlluminationExportDto"> |
| | | SELECT cdi.*, |
| | | dv.device_name, |
| | | dv.management_number, |
| | | DATE_FORMAT(d.calibration_date, '%Y-%m-%d') calibrationDateString, |
| | | DATE_FORMAT(d.next_calibration_date, '%Y-%m-%d') nextCalibrationDateString |
| | | FROM cnas_fe_illumination cdi |
| | | left join device dv on dv.id = cdi.device_id |
| | | LEFT JOIN (SELECT d.id, |
| | | dmr.calibration_date, |
| | | dmr.next_calibration_date |
| | | FROM device d |
| | | LEFT JOIN device_metric_record dmr ON dmr.device_id = d.id |
| | | AND dmr.type = 'calibrate' |
| | | GROUP BY d.id |
| | | HAVING max(dmr.id)) d ON d.id = cdi.device_id |
| | | left join user u1 on u1.id = cdi.checker_id |
| | | left join user u2 on u2.id = cdi.tester_id |
| | | where cdi.intensity_illumination_id = #{intensityIlluminationId} |
| | | </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.require.mapper.FeLightningProtectionMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.require.pojo.FeLightningProtection"> |
| | | <id column="lightning_protection_id" property="lightningProtectionId" /> |
| | | <result column="file_name" property="fileName" /> |
| | | <result column="system_file_name" property="systemFileName" /> |
| | | <result column="detection_date" property="detectionDate" /> |
| | | <result column="term_validity" property="termValidity" /> |
| | | <result column="detection_unit" property="detectionUnit" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="exportOfLightningProtectionDetection" resultType="com.ruoyi.require.excel.FeLightningProtectionExcel"> |
| | | select * from cnas_fe_lightning_protection |
| | | </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.require.mapper.FePowerStableMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.require.pojo.FePowerStable"> |
| | | <id column="power_stable_id" property="powerStableId" /> |
| | | <result column="test_location" property="testLocation" /> |
| | | <result column="test_date" property="testDate" /> |
| | | <result column="device_id" property="deviceId" /> |
| | | <result column="conclusion" property="conclusion" /> |
| | | <result column="tester_id" property="testerId" /> |
| | | <result column="checker_id" property="checkerId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="getLaboratoryFacilityPowerStablePage" resultType="com.ruoyi.require.dto.FePowerStableDto"> |
| | | SELECT cfps.*, u1.name checker_user, u2.name tester_user, dv.device_name, dv.management_number |
| | | FROM cnas_fe_power_stable cfps |
| | | left join device dv on dv.id = cfps.device_id |
| | | left join user u1 on u1.id = cfps.checker_id |
| | | left join user u2 on u2.id = cfps.tester_id |
| | | </select> |
| | | |
| | | <select id="getCalibrationDate" resultType="java.util.Map"> |
| | | SELECT |
| | | d.device_name deviceName, |
| | | d.management_number managementNumber, |
| | | date_format(dmr.calibration_date,'%Y-%m-%d') calibrationDate, |
| | | date_format(dmr.next_calibration_date,'%Y-%m-%d') nextCalibrationDate |
| | | FROM |
| | | device d |
| | | LEFT JOIN device_metric_record dmr ON dmr.device_id = d.id |
| | | AND dmr.type = 'calibrate' |
| | | where d.id = #{deviceId} |
| | | GROUP BY |
| | | d.id |
| | | </select> |
| | | |
| | | <!-- æ¥è¯¢çµæºç¨³å®æ§ --> |
| | | <select id="selectPowerStable" resultType="com.ruoyi.require.dto.FePowerStableExportDto"> |
| | | SELECT cfps.*, |
| | | dv.device_name, |
| | | dv.management_number, |
| | | DATE_FORMAT(cfps.test_date, '%Y-%m-%d') testDateString, |
| | | DATE_FORMAT(d.calibration_date, '%Y-%m-%d') calibrationDateString, |
| | | DATE_FORMAT(d.next_calibration_date, '%Y-%m-%d') nextCalibrationDateString |
| | | FROM cnas_fe_power_stable cfps |
| | | left join device dv on dv.id = cfps.device_id |
| | | LEFT JOIN (SELECT d.id, |
| | | dmr.calibration_date, |
| | | dmr.next_calibration_date |
| | | FROM device d |
| | | LEFT JOIN device_metric_record dmr ON dmr.device_id = d.id |
| | | AND dmr.type = 'calibrate' |
| | | GROUP BY d.id |
| | | HAVING max(dmr.id)) d ON d.id = cfps.device_id |
| | | left join user u1 on u1.id = cfps.checker_id |
| | | left join user u2 on u2.id = cfps.tester_id |
| | | where cfps.power_stable_id = #{powerStableId} |
| | | </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.require.mapper.FeTempHumDateMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.require.pojo.FeTempHumDate"> |
| | | <id column="date_id" property="dateId" /> |
| | | <result column="month_date" property="monthDate" /> |
| | | <result column="test_area_name" property="testAreaName" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | </resultMap> |
| | | |
| | | <select id="getFeTempHumDate" resultType="com.ruoyi.require.dto.FeTempHumDateDto"> |
| | | select * from ( |
| | | select c.*, u.name create_name |
| | | from cnas_fe_temp_hum_date c |
| | | left join user u on c.create_user = u.id) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selectFeTempHumDateIncludeFormattedDate" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from cnas_fe_temp_hum_date |
| | | where test_area_name = #{laboratory} |
| | | and month_date = #{formattedDate} |
| | | </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.require.mapper.FeTempHumRecordMapper"> |
| | | |
| | | <select id="getFeTempHumRecordPage" resultType="com.ruoyi.require.dto.FeTempHumRecordDto"> |
| | | select c.*, u1.name afternoon_recorder_user, u2.name morning_recorder_user |
| | | from cnas_fe_temp_hum_record c |
| | | left join user u1 on u1.id = c.afternoon_recorder_id |
| | | left join user u2 on u2.id = c.morning_recorder_id |
| | | where c.date_id = #{dateId} |
| | | ORDER BY c.temp_hum_id desc |
| | | </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.require.mapper.ForeignRegisterMapper"> |
| | | |
| | | <!-- 夿¥äººåç»è®°å页æ¥è¯¢ --> |
| | | <select id="pageForeignRegister" resultType="com.ruoyi.require.dto.ForeignRegisterDto"> |
| | | select * |
| | | from (select * |
| | | from cnas_foreign_register |
| | | <where> |
| | | <if test="beginDate != null and beginDate != '' and endDate != null and endDate != ''"> |
| | | register_date between #{beginDate} and #{endDate} |
| | | </if> |
| | | </where> |
| | | order by create_time desc) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="getForeignRegisterList" resultType="com.ruoyi.require.dto.ForeignRegisterDto"> |
| | | select * |
| | | from (select cfr.*, |
| | | u1.signature_url accompanyingUrl, |
| | | u2.signature_url approveUrl |
| | | from cnas_foreign_register cfr |
| | | left join user u1 on u1.id = cfr.accompanying_id |
| | | left join user u2 on u2.id = cfr.approve_id |
| | | <where> |
| | | <if test="beginDate != null and beginDate != '' and endDate != null and endDate != ''"> |
| | | cfr.register_date between #{beginDate} and #{endDate} |
| | | </if> |
| | | </where> |
| | | order by cfr.create_time desc) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </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.require.mapper.InternalWastesMapper"> |
| | | |
| | | <!-- å®å
¨å
å¡ä¸åºç»è®°å表 --> |
| | | <select id="pageInternalWastes" resultType="com.ruoyi.require.dto.InternalWastesDto"> |
| | | select * |
| | | from (select ciw.*, |
| | | u1.name create_user_name, |
| | | u2.name update_user_name |
| | | from cnas_internal_wastes ciw |
| | | left join user u1 on u1.id = ciw.create_user |
| | | left join user u2 on u2.id = ciw.update_user |
| | | order by ciw.create_time desc) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </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.require.mapper.ProcurementSuppliesStoreMapper"> |
| | | <resultMap id="map" type="com.ruoyi.require.dto.StoreDto"> |
| | | <id column="id" property="id"/> |
| | | <result column="consumables_id" property="consumablesId"/> |
| | | <result column="odd_numbers" property="oddNumbers"/> |
| | | <result column="consumables_name" property="consumablesName"/> |
| | | <result column="store_number" property="storeNumber"/> |
| | | <result column="total_price" property="totalPrice"/> |
| | | <result column="storage_user" property="storageUser"/> |
| | | <result column="storage_time" property="storageTime"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="registrant" property="registrant"/> |
| | | <result column="registrant_time" property="registrantTime"/> |
| | | <result column="storageUserName" property="storageUserName"/> |
| | | <result column="registrantName" property="registrantName"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="storeExcelMap" type="com.ruoyi.require.excel.StoreExcel"> |
| | | <result column="odd_numbers" property="oddNumbers"/> |
| | | <result column="consumables_name" property="consumablesName"/> |
| | | <result column="store_number" property="storeNumber"/> |
| | | <result column="total_price" property="totalPrice"/> |
| | | <result column="storage_time" property="storageTime"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="registrant_time" property="registrantTime"/> |
| | | <result column="storageUserName" property="storageUserName"/> |
| | | <result column="registrantName" property="registrantName"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectStoreList" resultMap="map"> |
| | | select * from ( |
| | | SELECT |
| | | s.id, |
| | | c.id AS consumables_id, |
| | | s.contents_id, |
| | | s.odd_numbers, |
| | | c.consumables_name, |
| | | c.store_number, |
| | | c.total_price, |
| | | s.storage_user, |
| | | s.storage_time, |
| | | s.remark, |
| | | s.registrant, |
| | | s.registrant_time, |
| | | u.name AS storageUserName, |
| | | u1.name AS registrantName |
| | | FROM |
| | | `procurement_supplies_store` s |
| | | LEFT JOIN procurement_supplies_consumables c ON s.id = c.store_id |
| | | LEFT JOIN user u ON u.id = s.storage_user |
| | | LEFT JOIN user u1 ON u1.id = s.registrant |
| | | )a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="exportExcel" resultMap="storeExcelMap"> |
| | | SELECT * FROM ( |
| | | SELECT |
| | | s.odd_numbers, |
| | | c.consumables_name, |
| | | c.store_number, |
| | | c.total_price, |
| | | s.storage_time, |
| | | s.remark, |
| | | s.registrant_time, |
| | | u.name AS storageUserName, |
| | | u1.name AS registrantName |
| | | FROM |
| | | `procurement_supplies_store` s |
| | | LEFT JOIN procurement_supplies_consumables c ON s.id = c.store_id |
| | | LEFT JOIN user u ON u.id = s.storage_user |
| | | LEFT JOIN user u1 ON u1.id = s.registrant |
| | | |
| | | ) a |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UpdateUserDto { |
| | | |
| | | private String id; |
| | | |
| | | private String ids; |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.system.service.UserService; |
| | | import com.ruoyi.web.controller.dto.UpdateUserDto; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | return Result.success(userService.getUserNow()); |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åç»å½ç¨æ·é¨é¨ |
| | | * @return |
| | | */ |
| | | @GetMapping ("/selectUserDepartmentLimsName") |
| | | @ApiOperation(value = "è·åå½åç»å½ç¨æ·é¨é¨") |
| | | public Result<?> selectUserDepartmentLimsName(){ |
| | | return Result.success("æå", userService.selectUserDepartmentLimsName()); |
| | | } |
| | | |
| | | @PostMapping("/upUserDepardLimsId") |
| | | @ApiOperation(value = "ä¿®æ¹äººåæç»æå¨ç»ç»æ¶æ") |
| | | public Result<?> upUserDepardLimsId(@RequestBody UpdateUserDto dto){ |
| | | return Result.success(userService.upUserDepardLimsId(dto.getIds(), dto.getId())); |
| | | } |
| | | |
| | | @DeleteMapping("/delUserDepardLimsId") |
| | | @ApiOperation(value = "å é¤äººåæç»æå¨ç»ç»æ¶æ") |
| | | public Result<?> delUserDepardLimsId(Integer id){ |
| | | return Result.success(userService.delUserDepardLimsId(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.annotation; |
| | | |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface ValueTableShow { |
| | | |
| | | int value() default 1; |
| | | |
| | | String name() default ""; |
| | | |
| | | int width() default 0; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.common; |
| | | |
| | | import com.ruoyi.framework.annotation.ValueTableShow; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | /*ææ |
| | | * éè¿æ³¨è§£å¿«éçætable表头*/ |
| | | |
| | | public class PrintChina { |
| | | |
| | | public static <T> List<Map<String, Object>> printChina(Class<T> tClass) { |
| | | //å°å®ä½ç±»ç屿§å注éè½¬æ¢æåæ° |
| | | List<Field> fieldList = new ArrayList<>(); |
| | | while (tClass != null){ |
| | | fieldList.addAll(new ArrayList<>(Arrays.asList(tClass.getDeclaredFields()))); |
| | | tClass = (Class<T>) tClass.getSuperclass(); |
| | | } |
| | | Field[] fields = new Field[fieldList.size()]; |
| | | fieldList.toArray(fields); |
| | | ArrayList<Map<String, Object>> list = new ArrayList<>(); |
| | | for (Field field : fields) { |
| | | Map<String, Object> soundVo = new HashMap<>(); |
| | | boolean bool = field.isAnnotationPresent(ApiModelProperty.class); |
| | | boolean bool2 = field.isAnnotationPresent(ValueTableShow.class); |
| | | if (bool2) { |
| | | int order = field.getAnnotation(ValueTableShow.class).value(); |
| | | String value = field.getAnnotation(ValueTableShow.class).name(); |
| | | int width = field.getAnnotation(ValueTableShow.class).width(); |
| | | if (bool){ |
| | | value = value.isEmpty() ? field.getAnnotation(ApiModelProperty.class).value() : value; |
| | | } |
| | | soundVo.put("label", field.getName()); |
| | | soundVo.put("value", value); |
| | | if(width>0){ |
| | | soundVo.put("width", width); |
| | | } |
| | | soundVo.put("order", order + ""); |
| | | if(list.isEmpty()){ |
| | | list.add(soundVo); |
| | | }else{ |
| | | boolean isAdd = false; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Map<String, Object> map = list.get(i); |
| | | if(order < Integer.parseInt(map.get("order").toString())){ |
| | | list.add(i, soundVo); |
| | | isAdd = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!isAdd) list.add(soundVo); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | User getUserNow(); |
| | | |
| | | /** |
| | | * è·åå½åç»å½ç¨æ·é¨é¨ |
| | | * @return |
| | | */ |
| | | String selectUserDepartmentLimsName(); |
| | | |
| | | |
| | | int upUserDepardLimsId(String ids, String id); |
| | | |
| | | int delUserDepardLimsId(Integer id); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | |
| | | import com.ruoyi.system.service.UserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public User getUserNow() { |
| | | return baseMapper.getUserNow(SecurityUtils.getUserId().intValue()); |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åç»å½ç¨æ·é¨é¨ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String selectUserDepartmentLimsName() { |
| | | return baseMapper.selectUserDepartmentLimsName(SecurityUtils.getUserId().intValue()); |
| | | } |
| | | |
| | | @Override |
| | | public int upUserDepardLimsId(String ids, String id) { |
| | | List<Integer> userIds = JSON.parseArray(ids, Integer.class); |
| | | return baseMapper.update(null, Wrappers.<User>lambdaUpdate().in(User::getId, userIds).set(User::getDepartLimsId, id).set(User::getUpdateTime, LocalDateTime.now()).set(User::getUpdateBy,SecurityUtils.getLoginUser().getUsername())); |
| | | } |
| | | |
| | | @Override |
| | | public int delUserDepardLimsId(Integer id) { |
| | | return baseMapper.update(null, Wrappers.<User>lambdaUpdate().eq(User::getId, id).set(User::getDepartLimsId, null).set(User::getUpdateTime, LocalDateTime.now()).set(User::getUpdateBy, SecurityUtils.getUsername())); |
| | | } |
| | | } |
| | | |