feat(芯导): 仓储物流出库 / 人力资源(离职/在职/合同/薪资) / 环保门禁(门禁+智能巡检) 后端
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.envaccess.pojo.EnvAccessVehicle; |
| | | import com.ruoyi.envaccess.service.IEnvAccessVehicleService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¯ä¿é¨ç¦--车è¾/ç§»å¨æºæ¢°å°è´¦ï¼è¿åºå车è¾ãåå
车è¾ãééè·¯ç§»å¨æºæ¢°ï¼ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/environmentAccess/vehicle") |
| | | public class EnvAccessVehicleController { |
| | | |
| | | @Resource |
| | | private IEnvAccessVehicleService envAccessVehicleService; |
| | | |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page, EnvAccessVehicle req) { |
| | | return AjaxResult.success(envAccessVehicleService.listPage(page, req)); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(envAccessVehicleService.getById(id)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "é¨ç¦ç®¡ç-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody EnvAccessVehicle vehicle) { |
| | | vehicle.setId(null); |
| | | return envAccessVehicleService.save(vehicle) ? AjaxResult.success() : AjaxResult.error("æ°å¢å¤±è´¥"); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "é¨ç¦ç®¡ç-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody EnvAccessVehicle vehicle) { |
| | | return envAccessVehicleService.updateById(vehicle) ? AjaxResult.success() : AjaxResult.error("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "é¨ç¦ç®¡ç-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return envAccessVehicleService.removeByIds(ids) ? AjaxResult.success() : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, EnvAccessVehicle req) { |
| | | envAccessVehicleService.export(response, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.envaccess.pojo.EnvInspection; |
| | | import com.ruoyi.envaccess.service.IEnvInspectionService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¯ä¿é¨ç¦--æºè½å·¡æ£å°è´¦ï¼å«è·¯å¾è§å/AIè§é¢åæ/æ¥å/æ äººæºæºå¨äººï¼AI䏿 人æºå段é¢çï¼ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/environmentAccess/inspection") |
| | | public class EnvInspectionController { |
| | | |
| | | @Resource |
| | | private IEnvInspectionService envInspectionService; |
| | | |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page, EnvInspection req) { |
| | | return AjaxResult.success(envInspectionService.listPage(page, req)); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(envInspectionService.getById(id)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "æºè½å·¡æ£-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody EnvInspection inspection) { |
| | | inspection.setId(null); |
| | | if (inspection.getStatus() == null) { |
| | | inspection.setStatus(0); |
| | | } |
| | | return envInspectionService.save(inspection) ? AjaxResult.success() : AjaxResult.error("æ°å¢å¤±è´¥"); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "æºè½å·¡æ£-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody EnvInspection inspection) { |
| | | return envInspectionService.updateById(inspection) ? AjaxResult.success() : AjaxResult.error("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "æºè½å·¡æ£-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return envInspectionService.removeByIds(ids) ? AjaxResult.success() : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * èªå¨çæå·¡æ£æ¥å |
| | | */ |
| | | @GetMapping("/report/{id}") |
| | | @Log(title = "æºè½å·¡æ£-çææ¥å", businessType = BusinessType.OTHER) |
| | | public AjaxResult generateReport(@PathVariable Long id) { |
| | | return AjaxResult.success((Object) envInspectionService.generateReport(id)); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, EnvInspection req) { |
| | | envInspectionService.export(response, req); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.envaccess.pojo.EnvAccessVehicle; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface EnvAccessVehicleMapper extends BaseMapper<EnvAccessVehicle> { |
| | | |
| | | IPage<EnvAccessVehicle> listPage(Page page, @Param("req") EnvAccessVehicle req); |
| | | |
| | | List<EnvAccessVehicle> list(@Param("req") EnvAccessVehicle req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.envaccess.pojo.EnvInspection; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface EnvInspectionMapper extends BaseMapper<EnvInspection> { |
| | | |
| | | IPage<EnvInspection> listPage(Page page, @Param("req") EnvInspection req); |
| | | |
| | | List<EnvInspection> list(@Param("req") EnvInspection req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¯ä¿é¨ç¦--车è¾/ç§»å¨æºæ¢°å°è´¦ |
| | | * env_access_vehicle |
| | | */ |
| | | @TableName(value = "env_access_vehicle") |
| | | @Data |
| | | public class EnvAccessVehicle extends DateQueryDto implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç±»å 1è¿åºå 2åå
3ééè·¯ç§»å¨æºæ¢° |
| | | */ |
| | | @Excel(name = "ç±»å", readConverterExp = "1=è¿åºå车è¾,2=åå
车è¾,3=ééè·¯ç§»å¨æºæ¢°") |
| | | private Integer vehicleType; |
| | | |
| | | @Excel(name = "车ç/æºæ¢°ç¼å·") |
| | | private String plateNo; |
| | | |
| | | @Excel(name = "车è¾/æºæ¢°åå·") |
| | | private String vehicleModel; |
| | | |
| | | @Excel(name = "使ç¨äºº") |
| | | private String driverName; |
| | | |
| | | @Excel(name = "èç³»çµè¯") |
| | | private String driverPhone; |
| | | |
| | | @Excel(name = "ç¨é") |
| | | private String usePurpose; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date occurTime; |
| | | |
| | | /** |
| | | * 1è¿å 0åºåï¼è¿åºåç¨ï¼ |
| | | */ |
| | | @Excel(name = "æ¹å", readConverterExp = "1=è¿å,0=åºå") |
| | | private Integer direction; |
| | | |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¯ä¿é¨ç¦--æºè½å·¡æ£å°è´¦ |
| | | * env_inspection |
| | | */ |
| | | @TableName(value = "env_inspection") |
| | | @Data |
| | | public class EnvInspection extends DateQueryDto implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @Excel(name = "å·¡æ£åç§°") |
| | | private String inspectionName; |
| | | |
| | | /** |
| | | * 1宿 2ä¸´æ¶ 3æ
é |
| | | */ |
| | | @Excel(name = "å·¡æ£ç±»å", readConverterExp = "1=宿巡æ£,2=临æ¶å·¡æ£,3=æ
éå·¡æ£") |
| | | private Integer inspectionType; |
| | | |
| | | @Excel(name = "å·¡æ£è·¯å¾è§å") |
| | | private String routePlan; |
| | | |
| | | @Excel(name = "å·¡æ£åºå") |
| | | private String area; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计åå¼å§æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planStartTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计åç»ææ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planEndTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "å®é
å¼å§æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date actualStartTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "å®é
ç»ææ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date actualEndTime; |
| | | |
| | | @Excel(name = "å·¡æ£äººå") |
| | | private String inspector; |
| | | |
| | | @Excel(name = "å·¡æ£ç»æ") |
| | | private String inspectionResult; |
| | | |
| | | @ApiModelProperty(value = "AIè§é¢åæç»æ(é¢ç)") |
| | | private String aiAnalysis; |
| | | |
| | | @ApiModelProperty(value = "æ 人æº/æºå¨äººåä¼ æ°æ®(é¢ç)") |
| | | private String uavData; |
| | | |
| | | @ApiModelProperty(value = "èªå¨çæå·¡æ£æ¥å") |
| | | private String reportPath; |
| | | |
| | | /** |
| | | * 0å¾
æ§è¡ 1æ§è¡ä¸ 2已宿 3已忶 |
| | | */ |
| | | @Excel(name = "ç¶æ", readConverterExp = "0=å¾
æ§è¡,1=æ§è¡ä¸,2=已宿,3=已忶") |
| | | private Integer status; |
| | | |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.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.envaccess.pojo.EnvAccessVehicle; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | public interface IEnvAccessVehicleService extends IService<EnvAccessVehicle> { |
| | | |
| | | IPage<EnvAccessVehicle> listPage(Page page, EnvAccessVehicle req); |
| | | |
| | | void export(HttpServletResponse response, EnvAccessVehicle req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.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.envaccess.pojo.EnvInspection; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | public interface IEnvInspectionService extends IService<EnvInspection> { |
| | | |
| | | IPage<EnvInspection> listPage(Page page, EnvInspection req); |
| | | |
| | | String generateReport(Long id); |
| | | |
| | | void export(HttpServletResponse response, EnvInspection req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.envaccess.mapper.EnvAccessVehicleMapper; |
| | | import com.ruoyi.envaccess.pojo.EnvAccessVehicle; |
| | | import com.ruoyi.envaccess.service.IEnvAccessVehicleService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class EnvAccessVehicleServiceImpl extends ServiceImpl<EnvAccessVehicleMapper, EnvAccessVehicle> implements IEnvAccessVehicleService { |
| | | |
| | | private EnvAccessVehicleMapper envAccessVehicleMapper; |
| | | |
| | | @Override |
| | | public IPage<EnvAccessVehicle> listPage(Page page, EnvAccessVehicle req) { |
| | | return envAccessVehicleMapper.listPage(page, req); |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, EnvAccessVehicle req) { |
| | | List<EnvAccessVehicle> list = envAccessVehicleMapper.list(req); |
| | | ExcelUtil<EnvAccessVehicle> util = new ExcelUtil<EnvAccessVehicle>(EnvAccessVehicle.class); |
| | | util.exportExcel(response, list, "é¨ç¦ç®¡çå°è´¦"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.envaccess.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.envaccess.mapper.EnvInspectionMapper; |
| | | import com.ruoyi.envaccess.pojo.EnvInspection; |
| | | import com.ruoyi.envaccess.service.IEnvInspectionService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class EnvInspectionServiceImpl extends ServiceImpl<EnvInspectionMapper, EnvInspection> implements IEnvInspectionService { |
| | | |
| | | private EnvInspectionMapper envInspectionMapper; |
| | | |
| | | @Override |
| | | public IPage<EnvInspection> listPage(Page page, EnvInspection req) { |
| | | return envInspectionMapper.listPage(page, req); |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, EnvInspection req) { |
| | | List<EnvInspection> list = envInspectionMapper.list(req); |
| | | ExcelUtil<EnvInspection> util = new ExcelUtil<EnvInspection>(EnvInspection.class); |
| | | util.exportExcel(response, list, "æºè½å·¡æ£å°è´¦"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å·¡æ£è®°å½èªå¨çæå·¡æ£æ¥åï¼HTMLï¼ï¼å¹¶åå report_path |
| | | */ |
| | | @Override |
| | | public String generateReport(Long id) { |
| | | EnvInspection it = getById(id); |
| | | if (it == null) { |
| | | throw new BaseException("å·¡æ£è®°å½ä¸åå¨"); |
| | | } |
| | | String typeText = it.getInspectionType() == null ? "" : |
| | | (it.getInspectionType() == 1 ? "宿巡æ£" : it.getInspectionType() == 2 ? "临æ¶å·¡æ£" : |
| | | it.getInspectionType() == 3 ? "æ
éå·¡æ£" : ""); |
| | | String statusText = it.getStatus() == null ? "" : |
| | | (it.getStatus() == 0 ? "å¾
æ§è¡" : it.getStatus() == 1 ? "æ§è¡ä¸" : |
| | | it.getStatus() == 2 ? "已宿" : it.getStatus() == 3 ? "已忶" : ""); |
| | | String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word'>") |
| | | .append("<head><meta charset='utf-8'><title>æºè½å·¡æ£æ¥å</title></head><body>"); |
| | | sb.append("<h2 style='text-align:center;'>æºè½å·¡æ£æ¥å</h2>"); |
| | | sb.append("<p style='text-align:right;'>æ¥åçææ¶é´ï¼").append(now).append("</p>"); |
| | | sb.append("<table border='1' cellspacing='0' cellpadding='6' style='border-collapse:collapse;width:100%;font-size:14px;'>"); |
| | | row(sb, "å·¡æ£åç§°", it.getInspectionName()); |
| | | row(sb, "å·¡æ£ç±»å", typeText); |
| | | row(sb, "å·¡æ£åºå", it.getArea()); |
| | | row(sb, "å·¡æ£è·¯å¾è§å", it.getRoutePlan()); |
| | | row(sb, "è®¡åæ¶é´", fmt(it.getPlanStartTime()) + " ~ " + fmt(it.getPlanEndTime())); |
| | | row(sb, "å®é
æ¶é´", fmt(it.getActualStartTime()) + " ~ " + fmt(it.getActualEndTime())); |
| | | row(sb, "å·¡æ£äººå", it.getInspector()); |
| | | row(sb, "å·¡æ£ç¶æ", statusText); |
| | | row(sb, "å·¡æ£ç»æ/è®°å½", it.getInspectionResult()); |
| | | row(sb, "AIè§é¢åæç»æ", it.getAiAnalysis()); |
| | | row(sb, "æ 人æº/æºå¨äººæ°æ®", it.getUavData()); |
| | | row(sb, "夿³¨", it.getRemark()); |
| | | sb.append("</table>"); |
| | | sb.append("<p style='margin-top:30px;'>å·¡æ£äººç¾åï¼________________ 审æ¹äººç¾åï¼________________</p>"); |
| | | sb.append("</body></html>"); |
| | | |
| | | String content = sb.toString(); |
| | | EnvInspection upd = new EnvInspection(); |
| | | upd.setId(id); |
| | | upd.setReportPath(content); |
| | | updateById(upd); |
| | | return content; |
| | | } |
| | | |
| | | private static String fmt(java.util.Date d) { |
| | | if (d == null) { |
| | | return ""; |
| | | } |
| | | return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d); |
| | | } |
| | | |
| | | private static void row(StringBuilder sb, String label, Object value) { |
| | | sb.append("<tr><td style='background:#f0f1f5;width:180px;'>").append(label) |
| | | .append("</td><td>").append(value == null ? "" : String.valueOf(value).replace("\n", "<br/>")) |
| | | .append("</td></tr>"); |
| | | } |
| | | } |
| | |
| | | util.exportExcel(response, list, "ç产åºåºå°è´¦"); |
| | | } |
| | | |
| | | /** |
| | | * éè´§åºåºï¼éè´éè´§åºåºï¼å°è´¦æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/listPageByPurchaseReturn") |
| | | @Log(title = "éè´§åºåº-åºåºå°è´¦-åºåºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageByPurchaseReturn(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | IPage<ProcurementRecordOutPageDto> result = procurementRecordOutService.listPageByPurchaseReturn(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | /** |
| | | * éè´§åºåºï¼éè´éè´§åºåºï¼å°è´¦å¯¼åº |
| | | */ |
| | | @PostMapping("/exportPurchaseReturn") |
| | | public void exportPurchaseReturn(HttpServletResponse response) { |
| | | procurementRecordOutService.exportPurchaseReturn(response); |
| | | } |
| | | |
| | | } |
| | |
| | | private Integer salesLedgerProductId; |
| | | |
| | | /** |
| | | * åºåºç±»å 1-éè´åºåº 2-éå®åºåº 3-èªå®ä¹ |
| | | * åºåºç±»å 1-éè´åºåº 2-éå®åºåº 3-èªå®ä¹åºåº(åæ/é¢ç¨) 5-éè´§åºåº(éè´éè´§) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * ä¾åºååç§°ï¼éè´§åºåº-éåä¾åºåæ¶ä½¿ç¨ï¼ |
| | | */ |
| | | private String supplierName; |
| | | |
| | | } |
| | |
| | | IPage<ProcurementRecordOutPageDto> listPageByProduct(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | IPage<ProcurementRecordOutPageDto> listPageByCustom(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | /** |
| | | * éè´§åºåºï¼éè´éè´§åºåºï¼å°è´¦å页 |
| | | */ |
| | | IPage<ProcurementRecordOutPageDto> listPageByPurchaseReturn(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | /** |
| | | * éè´§åºåºå°è´¦å¯¼åºæ°æ® |
| | | */ |
| | | List<ProcurementRecordOutPageDto> listPurchaseReturn(); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * åºåºç±»å 1-éè´ 2-éå® 3-èªå®ä¹ |
| | | * åºåºç±»å 1-éè´åºåº 2-éå®åºåº 3-èªå®ä¹åºåº(åæ/é¢ç¨) 5-éè´§åºåº(éè´éè´§) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * ä¾åºååç§°ï¼éè´§åºåº-éåä¾åºåæ¶è®°å½ï¼ |
| | | */ |
| | | private String supplierName; |
| | | |
| | | /** |
| | | * åºåºç¨æ· |
| | | */ |
| | | private String createBy; |
| | |
| | | IPage<ProcurementRecordOutPageDto> listPageByProduct(Page page, ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | IPage<ProcurementRecordOutPageDto> listPageByCustom(Page page, ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | IPage<ProcurementRecordOutPageDto> listPageByPurchaseReturn(Page page, ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | void exportPurchaseReturn(HttpServletResponse response); |
| | | } |
| | |
| | | .inboundBatches(aLong.equals(0L) ? "第1æ¹æ¬¡" : "第"+ (aLong + 1) + "æ¹æ¬¡") |
| | | .inboundNum(new BigDecimal(procurementRecordOutAdd.getQuantity())) |
| | | .type(procurementRecordOutAdd.getType()) |
| | | .supplierName(procurementRecordOutAdd.getSupplierName()) |
| | | .createTime(localDateTime == null ? LocalDateTime.now() : localDateTime) |
| | | .createUser(Long.valueOf(procurementRecordOutAdd.getUserId())) |
| | | .createBy(sysUser.getNickName()) |
| | |
| | | public IPage<ProcurementRecordOutPageDto> listPageByCustom(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | return procurementRecordOutMapper.listPageByCustom(page, procurementDto); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProcurementRecordOutPageDto> listPageByPurchaseReturn(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | return procurementRecordOutMapper.listPageByPurchaseReturn(page, procurementDto); |
| | | } |
| | | |
| | | @Override |
| | | public void exportPurchaseReturn(HttpServletResponse response) { |
| | | List<ProcurementRecordOutPageDto> list = procurementRecordOutMapper.listPurchaseReturn(); |
| | | ExcelUtil<ProcurementRecordOutPageDto> util = new ExcelUtil<>(ProcurementRecordOutPageDto.class); |
| | | util.exportExcel(response, list, "éè´§åºåºå°è´¦"); |
| | | } |
| | | } |
| | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | } |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect) |
| | | .eq(ProcurementRecordOut::getType, 1); |
| | | .in(ProcurementRecordOut::getType, Arrays.asList(1, 5)); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | return procurementPageDtoIPage; |
| | |
| | | } |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); |
| | | procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType,1); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getType, Arrays.asList(1, 5)); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | return procurementPageDtoCopyIPage; |
| | |
| | | for (ProcurementPageDtoCopy dto : procurementPageDtoCopyList) { |
| | | // æ ¹æ®éè´å°è´¦IDçé对åºçåºåºè®°å½ |
| | | List<ProcurementRecordOut> collect1 = procurementRecords.stream() |
| | | .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId()) && ProcurementRecordOut.getType().equals(1)) |
| | | .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId()) && (ProcurementRecordOut.getType().equals(1) || ProcurementRecordOut.getType().equals(5))) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // å¦ææ²¡æç¸å
³çåºåºè®°å½ï¼è·³è¿è¯¥æ¡æ°æ® |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.StaffContract; |
| | | import com.ruoyi.staff.service.IStaffContractService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åå管çï¼åå·¥å³å¨ååï¼ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staff/contract") |
| | | public class StaffContractController { |
| | | |
| | | @Resource |
| | | private IStaffContractService staffContractService; |
| | | |
| | | /** |
| | | * ååå°è´¦å页æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, StaffContract req) { |
| | | return AjaxResult.success(staffContractService.listPage(page, req)); |
| | | } |
| | | |
| | | /** |
| | | * åå详æ
|
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(staffContractService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå |
| | | */ |
| | | @PostMapping("/add") |
| | | @Log(title = "åå管ç-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody StaffContract staffContract) { |
| | | staffContract.setId(null); |
| | | if (staffContract.getStatus() == null) { |
| | | staffContract.setStatus(0); |
| | | } |
| | | return staffContractService.save(staffContract) ? AjaxResult.success() : AjaxResult.error("æ°å¢å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åå |
| | | */ |
| | | @PostMapping("/update") |
| | | @Log(title = "åå管ç-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody StaffContract staffContract) { |
| | | return staffContractService.updateById(staffContract) ? AjaxResult.success() : AjaxResult.error("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @Log(title = "åå管ç-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | return staffContractService.removeByIds(ids) ? AjaxResult.success() : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * ç»ç¾åå |
| | | */ |
| | | @PostMapping("/renew/{id}") |
| | | @Log(title = "åå管ç-ç»ç¾", businessType = BusinessType.UPDATE) |
| | | public AjaxResult renew(@PathVariable Long id, @RequestBody StaffContract staffContract) { |
| | | return staffContractService.renew(id, staffContract) > 0 ? AjaxResult.success() : AjaxResult.error("ç»ç¾å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * è§£é¤åå |
| | | */ |
| | | @PostMapping("/terminate/{id}") |
| | | @Log(title = "åå管ç-è§£é¤", businessType = BusinessType.UPDATE) |
| | | public AjaxResult terminate(@PathVariable Long id, @RequestBody StaffContract staffContract) { |
| | | return staffContractService.terminate(id, staffContract) > 0 ? AjaxResult.success() : AjaxResult.error("è§£é¤å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * ååå¯¼åº |
| | | */ |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, StaffContract req) { |
| | | staffContractService.export(response, req); |
| | | } |
| | | } |
| | |
| | | staffOnJobService.staffOnJobExport(response, staffOnJob); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å¨èåå·¥ |
| | | */ |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody StaffOnJob staffOnJob) { |
| | | if (staffOnJob.getStaffState() == null) { |
| | | staffOnJob.setStaffState(1); |
| | | } |
| | | return staffOnJobService.save(staffOnJob) ? AjaxResult.success() : AjaxResult.error("æ°å¢å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å¨èåå·¥ |
| | | */ |
| | | @PutMapping("/{id}") |
| | | public AjaxResult update(@PathVariable Long id, @RequestBody StaffOnJob staffOnJob) { |
| | | staffOnJob.setId(id); |
| | | return staffOnJobService.updateById(staffOnJob) ? AjaxResult.success() : AjaxResult.error("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å¨èåå·¥ |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | return staffOnJobService.removeByIds(ids) ? AjaxResult.success() : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * å¨èåå·¥ç»è®¡ï¼å¨èäººæ° / èªèµåè®¡ï¼ |
| | | */ |
| | | @GetMapping("/statistics") |
| | | public AjaxResult statistics() { |
| | | List<StaffOnJob> list = staffOnJobService.list(); |
| | | long onJobCount = list.stream() |
| | | .filter(s -> s.getStaffState() != null && s.getStaffState() == 1).count(); |
| | | java.math.BigDecimal salaryTotal = list.stream() |
| | | .filter(s -> s.getStaffState() != null && s.getStaffState() == 1 && s.getSalary() != null) |
| | | .map(StaffOnJob::getSalary) |
| | | .reduce(java.math.BigDecimal.ZERO, java.math.BigDecimal::add); |
| | | java.util.Map<String, Object> map = new java.util.HashMap<>(); |
| | | map.put("onJobCount", onJobCount); |
| | | map.put("salaryTotal", salaryTotal); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.staff.pojo.StaffContract; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface StaffContractMapper extends BaseMapper<StaffContract> { |
| | | |
| | | IPage<StaffContract> listPage(Page page, @Param("req") StaffContract req); |
| | | |
| | | List<StaffContract> list(@Param("req") StaffContract req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 人å管ç--å³å¨åå |
| | | * staff_contract |
| | | */ |
| | | @TableName(value = "staff_contract") |
| | | @Data |
| | | public class StaffContract extends DateQueryDto implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * åå·¥ç¼å· |
| | | */ |
| | | @Excel(name = "åå·¥ç¼å·") |
| | | private String staffNo; |
| | | |
| | | /** |
| | | * åå·¥å§å |
| | | */ |
| | | @Excel(name = "åå·¥å§å") |
| | | private String staffName; |
| | | |
| | | /** |
| | | * å²ä½ |
| | | */ |
| | | @Excel(name = "å²ä½") |
| | | private String postJob; |
| | | |
| | | /** |
| | | * ç¾è®¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç¾è®¢æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date signDate; |
| | | |
| | | /** |
| | | * ååå¼å§æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ååå¼å§æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | /** |
| | | * ååç»ææ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ååç»ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | /** |
| | | * ååå¹´é |
| | | */ |
| | | @Excel(name = "ååå¹´é") |
| | | private Integer contractTerm; |
| | | |
| | | /** |
| | | * ååå
容 |
| | | */ |
| | | @Excel(name = "ååå
容") |
| | | private String contractContent; |
| | | |
| | | /** |
| | | * ç¶æ 0ææ 1å·²ç»ç¾ 2å·²è§£é¤ |
| | | */ |
| | | @ApiModelProperty(value = "ç¶æ 0ææ 1å·²ç»ç¾ 2已解é¤") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * ç»ç¾æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç»ç¾æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date renewDate; |
| | | |
| | | /** |
| | | * ç»ç¾åå°ææ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç»ç¾åå°ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date renewEndDate; |
| | | |
| | | /** |
| | | * è§£é¤æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "è§£é¤æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date terminateDate; |
| | | |
| | | /** |
| | | * è§£é¤åå |
| | | */ |
| | | @Excel(name = "è§£é¤åå ") |
| | | private String terminateReason; |
| | | |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| | |
| | | @Excel(name = "ååç»ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date contractEndTime; |
| | | |
| | | /** |
| | | * ç¦»èæ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç¦»èæ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date leaveDate; |
| | | |
| | | /** |
| | | * 离èåå |
| | | */ |
| | | @Excel(name = "离èåå ") |
| | | private String leaveReason; |
| | | |
| | | /** |
| | | * å·¥ä½äº¤æ¥æ
åµ |
| | | */ |
| | | @Excel(name = "å·¥ä½äº¤æ¥æ
åµ") |
| | | private String handoverInfo; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | |
| | | @Excel(name = "ååå°ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date contractExpireTime; |
| | | |
| | | /** |
| | | * å
¥èæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å
¥èæ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date entryDate; |
| | | |
| | | /** |
| | | * èªèµ |
| | | */ |
| | | @Excel(name = "èªèµ") |
| | | private java.math.BigDecimal salary; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.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.staff.pojo.StaffContract; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | public interface IStaffContractService extends IService<StaffContract> { |
| | | |
| | | IPage<StaffContract> listPage(Page page, StaffContract req); |
| | | |
| | | int renew(Long id, StaffContract req); |
| | | |
| | | int terminate(Long id, StaffContract req); |
| | | |
| | | void export(HttpServletResponse response, StaffContract req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.staff.mapper.StaffContractMapper; |
| | | import com.ruoyi.staff.pojo.StaffContract; |
| | | import com.ruoyi.staff.service.IStaffContractService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class StaffContractServiceImpl extends ServiceImpl<StaffContractMapper, StaffContract> implements IStaffContractService { |
| | | |
| | | private StaffContractMapper staffContractMapper; |
| | | |
| | | @Override |
| | | public IPage<StaffContract> listPage(Page page, StaffContract req) { |
| | | return staffContractMapper.listPage(page, req); |
| | | } |
| | | |
| | | /** |
| | | * ç»ç¾ï¼è®°å½ç»ç¾æ¥æ/ç»ç¾åå°ææ¥æï¼ç¶æç½®"å·²ç»ç¾"ï¼å¹¶æ´æ°ååç»ææ¥æ |
| | | */ |
| | | @Override |
| | | public int renew(Long id, StaffContract req) { |
| | | StaffContract contract = staffContractMapper.selectById(id); |
| | | if (contract == null) { |
| | | throw new BaseException("ååä¸åå¨"); |
| | | } |
| | | contract.setStatus(1); |
| | | if (req.getRenewDate() != null) { |
| | | contract.setRenewDate(req.getRenewDate()); |
| | | } |
| | | if (req.getRenewEndDate() != null) { |
| | | contract.setRenewEndDate(req.getRenewEndDate()); |
| | | contract.setEndDate(req.getRenewEndDate()); |
| | | } |
| | | if (req.getContractTerm() != null) { |
| | | contract.setContractTerm(req.getContractTerm()); |
| | | } |
| | | return staffContractMapper.updateById(contract); |
| | | } |
| | | |
| | | /** |
| | | * è§£é¤ï¼è®°å½è§£é¤æ¥æ/åå ï¼ç¶æç½®"已解é¤" |
| | | */ |
| | | @Override |
| | | public int terminate(Long id, StaffContract req) { |
| | | StaffContract contract = staffContractMapper.selectById(id); |
| | | if (contract == null) { |
| | | throw new BaseException("ååä¸åå¨"); |
| | | } |
| | | contract.setStatus(2); |
| | | contract.setTerminateDate(req.getTerminateDate()); |
| | | contract.setTerminateReason(req.getTerminateReason()); |
| | | return staffContractMapper.updateById(contract); |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, StaffContract req) { |
| | | List<StaffContract> list = staffContractMapper.list(req); |
| | | ExcelUtil<StaffContract> util = new ExcelUtil<StaffContract>(StaffContract.class); |
| | | util.exportExcel(response, list, "åå管ç"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.envaccess.mapper.EnvAccessVehicleMapper"> |
| | | <select id="listPage" resultType="com.ruoyi.envaccess.pojo.EnvAccessVehicle"> |
| | | SELECT * FROM env_access_vehicle |
| | | <where> |
| | | <if test="req.vehicleType != null"> |
| | | AND vehicle_type = #{req.vehicleType} |
| | | </if> |
| | | <if test="req.plateNo != null and req.plateNo != ''"> |
| | | AND plate_no LIKE CONCAT('%',#{req.plateNo},'%') |
| | | </if> |
| | | <if test="req.driverName != null and req.driverName != ''"> |
| | | AND driver_name LIKE CONCAT('%',#{req.driverName},'%') |
| | | </if> |
| | | <if test="req.entryDateStart != null and req.entryDateStart != ''"> |
| | | AND occur_time >= #{req.entryDateStart} |
| | | </if> |
| | | <if test="req.entryDateEnd != null and req.entryDateEnd != ''"> |
| | | AND occur_time <= CONCAT(#{req.entryDateEnd},' 23:59:59') |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.envaccess.pojo.EnvAccessVehicle"> |
| | | SELECT * FROM env_access_vehicle |
| | | <where> |
| | | <if test="req.vehicleType != null"> |
| | | AND vehicle_type = #{req.vehicleType} |
| | | </if> |
| | | <if test="req.plateNo != null and req.plateNo != ''"> |
| | | AND plate_no LIKE CONCAT('%',#{req.plateNo},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY 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.envaccess.mapper.EnvInspectionMapper"> |
| | | <select id="listPage" resultType="com.ruoyi.envaccess.pojo.EnvInspection"> |
| | | SELECT * FROM env_inspection |
| | | <where> |
| | | <if test="req.inspectionName != null and req.inspectionName != ''"> |
| | | AND inspection_name LIKE CONCAT('%',#{req.inspectionName},'%') |
| | | </if> |
| | | <if test="req.inspectionType != null"> |
| | | AND inspection_type = #{req.inspectionType} |
| | | </if> |
| | | <if test="req.status != null"> |
| | | AND status = #{req.status} |
| | | </if> |
| | | <if test="req.entryDateStart != null and req.entryDateStart != ''"> |
| | | AND plan_start_time >= #{req.entryDateStart} |
| | | </if> |
| | | <if test="req.entryDateEnd != null and req.entryDateEnd != ''"> |
| | | AND plan_start_time <= CONCAT(#{req.entryDateEnd},' 23:59:59') |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.envaccess.pojo.EnvInspection"> |
| | | SELECT * FROM env_inspection |
| | | <where> |
| | | <if test="req.inspectionName != null and req.inspectionName != ''"> |
| | | AND inspection_name LIKE CONCAT('%',#{req.inspectionName},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | left join procurement_record_out t4 on t1.id = t4.procurement_record_storage_id and t4.type = 1 |
| | | left join procurement_record_out t4 on t1.id = t4.procurement_record_storage_id and t4.type in (1, 5) |
| | | <where> |
| | | t1.type = 1 |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | left join procurement_record_out t4 on t1.id = t4.procurement_record_storage_id and t4.type = 1 |
| | | left join procurement_record_out t4 on t1.id = t4.procurement_record_storage_id and t4.type in (1, 5) |
| | | <where> |
| | | t1.type = 1 and t4.type = 1 |
| | | t1.type = 1 and t4.type in (1, 5) |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | and t3.supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listPageByPurchaseReturn" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t3.supplier_name, |
| | | t3.purchase_contract_number, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.code, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by, |
| | | t4.unit_price, |
| | | t4.unit_price * t1.inbound_num as totalPrice |
| | | from procurement_record_out t1 |
| | | left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id |
| | | left join sales_ledger_product t2 on t2.id = t4.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | <where> |
| | | t1.type = 5 |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | and t3.supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t2.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listPurchaseReturn" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t3.supplier_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_time as time, |
| | | t1.create_by |
| | | from procurement_record_out t1 |
| | | left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id |
| | | left join sales_ledger_product t2 on t2.id = t4.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 5 |
| | | </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.staff.mapper.StaffContractMapper"> |
| | | <select id="listPage" resultType="com.ruoyi.staff.pojo.StaffContract"> |
| | | SELECT * FROM staff_contract |
| | | <where> |
| | | <if test="req.staffName != null and req.staffName != ''"> |
| | | AND staff_name LIKE CONCAT('%',#{req.staffName},'%') |
| | | </if> |
| | | <if test="req.staffNo != null and req.staffNo != ''"> |
| | | AND staff_no = #{req.staffNo} |
| | | </if> |
| | | <if test="req.status != null"> |
| | | AND status = #{req.status} |
| | | </if> |
| | | <if test="req.entryDateStart != null and req.entryDateStart != ''"> |
| | | AND end_date >= #{req.entryDateStart} |
| | | </if> |
| | | <if test="req.entryDateEnd != null and req.entryDateEnd != ''"> |
| | | AND end_date <= #{req.entryDateEnd} |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.staff.pojo.StaffContract"> |
| | | SELECT * FROM staff_contract |
| | | <where> |
| | | <if test="req.staffName != null and req.staffName != ''"> |
| | | AND staff_name LIKE CONCAT('%',#{req.staffName},'%') |
| | | </if> |
| | | <if test="req.status != null"> |
| | | AND status = #{req.status} |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | </mapper> |