Merge branch 'master' into pim_zss
 
	
	
	
	
	
	
	
	
	
	
	
	
	
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.collaborativeApproval.controller; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.ruoyi.collaborativeApproval.dto.StaffContactsPersonalDTO; | 
 |  |  | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; | 
 |  |  | import com.ruoyi.collaborativeApproval.service.StaffContactsPersonalService; | 
 |  |  | import com.ruoyi.framework.web.domain.AjaxResult; | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | import lombok.AllArgsConstructor; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.util.CollectionUtils; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/staffContactsPersonal") | 
 |  |  | @AllArgsConstructor | 
 |  |  | public class StaffContactsPersonalController { | 
 |  |  |     @Autowired | 
 |  |  |     private StaffContactsPersonalService staffContactsPersonalService; | 
 |  |  |     @GetMapping("/getList") | 
 |  |  |     @ApiOperation("å页æ¥è¯¢") | 
 |  |  |     public AjaxResult listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO ){ | 
 |  |  |         return AjaxResult.success(staffContactsPersonalService.listPage(page, staffContactsPersonalDTO)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     @ApiOperation("æ°å¢") | 
 |  |  |     public AjaxResult add(@RequestBody StaffContactsPersonal staffContactsPersonal){ | 
 |  |  |         return AjaxResult.success(staffContactsPersonalService.save(staffContactsPersonal)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @DeleteMapping("/delete/{id}") | 
 |  |  |     @ApiOperation("å é¤") | 
 |  |  |     public AjaxResult delete(@PathVariable("id") Long id){ | 
 |  |  | //        if (CollectionUtils.isEmpty(id)) { | 
 |  |  | //            throw new RuntimeException("请传å
¥è¦å é¤çID"); | 
 |  |  | //        } | 
 |  |  |         return AjaxResult.success(staffContactsPersonalService.removeById(id)); | 
 |  |  |     } | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.collaborativeApproval.dto; | 
 |  |  |  | 
 |  |  | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; | 
 |  |  | import com.ruoyi.framework.aspectj.lang.annotation.Excel; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | public class StaffContactsPersonalDTO extends StaffContactsPersonal { | 
 |  |  |     private String staffNo; | 
 |  |  |     private String staffName; | 
 |  |  |     private String sex; | 
 |  |  |     private String postJob; | 
 |  |  |     private String adress; | 
 |  |  |     private String profession; | 
 |  |  |     private String identityCard; | 
 |  |  |     private String phone; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.StaffContactsPersonalDTO; | 
 |  |  | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  | import org.apache.ibatis.annotations.Param; | 
 |  |  |  | 
 |  |  | @Mapper | 
 |  |  | public interface StaffContactsPersonalMapper extends BaseMapper<StaffContactsPersonal> { | 
 |  |  |     IPage listPage(Page page,@Param("staffContactsPersonalDTO") StaffContactsPersonalDTO staffContactsPersonalDTO); | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     @TableField(value = "tags",typeHandler = ListToStringTypeHandler.class,jdbcType = JdbcType.VARCHAR) | 
 |  |  |     private List<String> tags; | 
 |  |  |     /** | 
 |  |  |      * å建è
 | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Integer createUser; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å建æ¶é´ | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |     /** | 
 |  |  |      * ä¿®æ¹äºº | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private Integer updateUser; | 
 |  |  |     /** | 
 |  |  |      * ä¿®æ¹æ¶é´ | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime updateTime; | 
 |  |  |     /** | 
 |  |  |      * ç§æ·ID | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.collaborativeApproval.pojo; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | @TableName("staff_contacts_personal") | 
 |  |  | @Data | 
 |  |  | public class StaffContactsPersonal { | 
 |  |  |     @TableId(value = "id", type = IdType.AUTO) | 
 |  |  |     private Long id; | 
 |  |  |  | 
 |  |  | //    /** | 
 |  |  | //     * ç¨æ·IDï¼æå±è
ï¼ | 
 |  |  | //     */ | 
 |  |  | //    @ApiModelProperty("ç¨æ·IDï¼æå±è
ï¼") | 
 |  |  | //    private Integer userId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åå·¥ID | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("åå·¥ID") | 
 |  |  |     private Integer contactId; | 
 |  |  |     /** | 
 |  |  |      * å建è
 | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Integer createUser; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å建æ¶é´ | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç§æ·ID | 
 |  |  |      */ | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Long tenantId; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.StaffContactsPersonalDTO; | 
 |  |  | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; | 
 |  |  |  | 
 |  |  | public interface StaffContactsPersonalService extends IService<StaffContactsPersonal> { | 
 |  |  |     IPage listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.collaborativeApproval.service.impl; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import com.ruoyi.collaborativeApproval.dto.StaffContactsPersonalDTO; | 
 |  |  | import com.ruoyi.collaborativeApproval.mapper.StaffContactsPersonalMapper; | 
 |  |  | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; | 
 |  |  | import com.ruoyi.collaborativeApproval.service.StaffContactsPersonalService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | @Service | 
 |  |  | public class StaffContactsPersonalServiceImpl extends ServiceImpl<StaffContactsPersonalMapper, StaffContactsPersonal> implements StaffContactsPersonalService { | 
 |  |  |     @Autowired | 
 |  |  |     private StaffContactsPersonalMapper staffContactsPersonalMapper; | 
 |  |  |     @Override | 
 |  |  |     public IPage listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO) { | 
 |  |  |         return staffContactsPersonalMapper.listPage(page, staffContactsPersonalDTO); | 
 |  |  |     } | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.device.controller; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.ruoyi.device.dto.DeviceDefectRecordDto; | 
 |  |  | import com.ruoyi.device.dto.DeviceRepairDto; | 
 |  |  | import com.ruoyi.device.pojo.DeviceDefectRecord; | 
 |  |  | import com.ruoyi.device.pojo.DeviceLedger; | 
 |  |  | import com.ruoyi.device.pojo.DeviceRepair; | 
 |  |  | import com.ruoyi.device.service.DeviceDefectRecordService; | 
 |  |  | import com.ruoyi.framework.web.domain.AjaxResult; | 
 |  |  | import io.swagger.annotations.Api; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | @Api(tags = "设å¤ç¼ºé·è®°å½ç®¡ç") | 
 |  |  | @RequestMapping("/defect") | 
 |  |  | @RestController | 
 |  |  | public class DeviceDefectRecordController { | 
 |  |  |     @Autowired | 
 |  |  |     private DeviceDefectRecordService deviceDefectRecordService; | 
 |  |  |     @ApiModelProperty("设å¤ç¼ºé·è®°å½å表") | 
 |  |  |     @GetMapping("/page") | 
 |  |  |     public AjaxResult page(Page page , DeviceDefectRecordDto deviceDefectRecordDto) { | 
 |  |  |         return AjaxResult.success(deviceDefectRecordService.listPage(page,deviceDefectRecordDto)); | 
 |  |  |     } | 
 |  |  |     @ApiModelProperty("设å¤idæ¥è¯¢è®¾å¤ç¼ºé·è®°å½å表") | 
 |  |  |     @GetMapping("/find/{deviceLedgerId}") | 
 |  |  |     public AjaxResult find(@PathVariable Long deviceLedgerId) { | 
 |  |  |         DeviceDefectRecordDto deviceDefectRecordDto = new DeviceDefectRecordDto(); | 
 |  |  |         deviceDefectRecordDto.setDeviceLedgerId(deviceLedgerId); | 
 |  |  |         return AjaxResult.success(deviceDefectRecordService.listPage(new Page<>(1,-1),deviceDefectRecordDto)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     @ApiModelProperty("æ·»å è®¾å¤ç¼ºé·è®°å½") | 
 |  |  |     public AjaxResult add(@RequestBody DeviceDefectRecord deviceDefectRecord) { | 
 |  |  |         return AjaxResult.success(deviceDefectRecordService.add(deviceDefectRecord)); | 
 |  |  |     } | 
 |  |  |     @PostMapping("/update") | 
 |  |  |     @ApiModelProperty("ä¿®æ¹è®¾å¤ç¼ºé·è®°å½") | 
 |  |  |     public AjaxResult update(@RequestBody DeviceDefectRecord deviceDefectRecord) { | 
 |  |  |         return AjaxResult.success(deviceDefectRecordService.updateByDDR(deviceDefectRecord)); | 
 |  |  |     } | 
 |  |  |     @DeleteMapping("/delete") | 
 |  |  |     @ApiModelProperty("å é¤è®¾å¤ç¼ºé·è®°å½") | 
 |  |  |     public AjaxResult delete(@PathVariable Long id) { | 
 |  |  |         return AjaxResult.success(deviceDefectRecordService.removeById(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     @PostMapping() | 
 |  |  |     @ApiModelProperty("æ·»å è®¾å¤æ¥ä¿®") | 
 |  |  |     public AjaxResult add( @RequestBody DeviceRepair deviceRepair) { | 
 |  |  |         DeviceLedger byId = deviceLedgerService.getById(deviceRepair.getDeviceLedgerId()); | 
 |  |  |         deviceRepair.setDeviceName(byId.getDeviceName()); | 
 |  |  |         deviceRepair.setDeviceModel(byId.getDeviceModel()); | 
 |  |  |         return deviceRepairService.saveDeviceRepair(deviceRepair); | 
 |  |  |     } | 
 |  |  |  | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.device.dto; | 
 |  |  |  | 
 |  |  | import com.ruoyi.device.pojo.DeviceDefectRecord; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | public class DeviceDefectRecordDto extends DeviceDefectRecord { | 
 |  |  |     @ApiModelProperty("设å¤åç§°") | 
 |  |  |     private String deviceName; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("设å¤åå·") | 
 |  |  |     private String deviceModel; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.device.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.device.dto.DeviceDefectRecordDto; | 
 |  |  | import com.ruoyi.device.pojo.DeviceDefectRecord; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  | import org.apache.ibatis.annotations.Param; | 
 |  |  |  | 
 |  |  | @Mapper | 
 |  |  | public interface DeviceDefectRecordMapper extends BaseMapper<DeviceDefectRecord> { | 
 |  |  |     IPage<DeviceDefectRecordDto> listPage(Page page,@Param("deviceDefectRecordDto") DeviceDefectRecordDto deviceDefectRecordDto); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.device.pojo; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.FieldFill; | 
 |  |  | import com.baomidou.mybatisplus.annotation.TableField; | 
 |  |  | import com.baomidou.mybatisplus.annotation.TableName; | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  |  | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | @TableName("device_defect_record") | 
 |  |  | public class DeviceDefectRecord { | 
 |  |  |     @ApiModelProperty("设å¤ç¼ºé·è®°å½id") | 
 |  |  |     private Long id; | 
 |  |  |     @ApiModelProperty("设å¤å°è´¦id") | 
 |  |  |     private Long deviceLedgerId; | 
 |  |  |     @ApiModelProperty("ç¼ºé·æè¿°") | 
 |  |  |     private String defectDescription; | 
 |  |  |     @ApiModelProperty("ç¶æ") | 
 |  |  |     private String status; | 
 |  |  |     @ApiModelProperty("æ¶é¤æ¶é´") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime eliminateTime; | 
 |  |  |     @ApiModelProperty("å建æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ´æ°æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime updateTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("å建人") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Integer createUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ´æ°äºº") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private Integer updateUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("ç§æ·id") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Long tenantId; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.device.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.device.dto.DeviceDefectRecordDto; | 
 |  |  | import com.ruoyi.device.pojo.DeviceDefectRecord; | 
 |  |  |  | 
 |  |  | public interface DeviceDefectRecordService extends IService<DeviceDefectRecord> { | 
 |  |  |     IPage<DeviceDefectRecordDto> listPage(Page page, DeviceDefectRecordDto deviceDefectRecordDto); | 
 |  |  |  | 
 |  |  |     boolean updateByDDR(DeviceDefectRecord deviceDefectRecord); | 
 |  |  |  | 
 |  |  |     boolean add(DeviceDefectRecord deviceDefectRecord); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.device.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.SecurityUtils; | 
 |  |  | import com.ruoyi.device.dto.DeviceDefectRecordDto; | 
 |  |  | import com.ruoyi.device.mapper.DeviceDefectRecordMapper; | 
 |  |  | import com.ruoyi.device.pojo.DeviceDefectRecord; | 
 |  |  | import com.ruoyi.device.pojo.DeviceRepair; | 
 |  |  | import com.ruoyi.device.service.DeviceDefectRecordService; | 
 |  |  | import com.ruoyi.device.service.IDeviceRepairService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  | @Service | 
 |  |  | @Transactional(rollbackFor = Exception.class) | 
 |  |  | public class DeviceDefectRecordServiceImpl extends ServiceImpl<DeviceDefectRecordMapper, DeviceDefectRecord> implements DeviceDefectRecordService { | 
 |  |  |     @Autowired | 
 |  |  |     private DeviceDefectRecordMapper deviceDefectRecordMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private IDeviceRepairService deviceRepairService; | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public IPage<DeviceDefectRecordDto> listPage(Page page, DeviceDefectRecordDto deviceDefectRecordDto) { | 
 |  |  |         return deviceDefectRecordMapper.listPage(page, deviceDefectRecordDto); | 
 |  |  |     } | 
 |  |  |     @Override | 
 |  |  |     public boolean add(DeviceDefectRecord deviceDefectRecord) { | 
 |  |  |         String status = deviceDefectRecord.getStatus(); | 
 |  |  |         if (status.equals("严é缺é·")) { | 
 |  |  |             DeviceRepair deviceRepair = new DeviceRepair(); | 
 |  |  |             deviceRepair.setDeviceLedgerId(deviceDefectRecord.getDeviceLedgerId()); | 
 |  |  |             deviceRepair.setRemark(deviceDefectRecord.getDefectDescription()); | 
 |  |  |             //è·åå½åç»å½ç¨æ· | 
 |  |  |             deviceRepair.setRepairName(SecurityUtils.getUsername()); | 
 |  |  |             deviceRepair.setRepairTime(new Date()); | 
 |  |  |             deviceRepairService.saveDeviceRepair(deviceRepair); | 
 |  |  |             return deviceDefectRecordMapper.insert(deviceDefectRecord) > 0; | 
 |  |  |         } else if (status.equals("ä¸è¬ç¼ºé·")) { | 
 |  |  |             return deviceDefectRecordMapper.insert(deviceDefectRecord) > 0; | 
 |  |  |         } | 
 |  |  |         return false; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public boolean updateByDDR(DeviceDefectRecord deviceDefectRecord) { | 
 |  |  |         String status = deviceDefectRecord.getStatus(); | 
 |  |  |         if (status.equals("严é缺é·")) { | 
 |  |  | //            deviceDefectRecord.setStatus("æ£å¸¸"); | 
 |  |  | //            deviceDefectRecord.setEliminateTime(LocalDateTime.now()); | 
 |  |  |             throw new RuntimeException("严é缺é·-设å¤ç»´ä¿®åæ´æ°ä¸ºæ£å¸¸ç¶æ"); | 
 |  |  |         } else if (status.equals("ä¸è¬ç¼ºé·")) { | 
 |  |  |             deviceDefectRecord.setStatus("æ£å¸¸"); | 
 |  |  |         } | 
 |  |  |         deviceDefectRecord.setEliminateTime(LocalDateTime.now()); | 
 |  |  |         return updateById(deviceDefectRecord); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import com.ruoyi.common.utils.bean.BeanUtils; | 
 |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
 |  |  | import com.ruoyi.device.dto.DeviceDefectRecordDto; | 
 |  |  | import com.ruoyi.device.dto.DeviceRepairDto; | 
 |  |  | import com.ruoyi.device.execl.DeviceRepairExeclDto; | 
 |  |  | import com.ruoyi.device.mapper.DeviceDefectRecordMapper; | 
 |  |  | import com.ruoyi.device.mapper.DeviceRepairMapper; | 
 |  |  | import com.ruoyi.device.pojo.DeviceDefectRecord; | 
 |  |  | import com.ruoyi.device.pojo.DeviceLedger; | 
 |  |  | import com.ruoyi.device.pojo.DeviceRepair; | 
 |  |  | import com.ruoyi.device.service.DeviceDefectRecordService; | 
 |  |  | import com.ruoyi.device.service.IDeviceLedgerService; | 
 |  |  | import com.ruoyi.device.service.IDeviceRepairService; | 
 |  |  | import com.ruoyi.framework.web.domain.AjaxResult; | 
 |  |  | import lombok.AllArgsConstructor; | 
 |  |  | 
 |  |  | @Slf4j | 
 |  |  | public class DeviceRepairServiceImpl extends ServiceImpl<DeviceRepairMapper, DeviceRepair> implements IDeviceRepairService { | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private DeviceDefectRecordService deviceDefectRecordService; | 
 |  |  |     @Autowired | 
 |  |  |     private DeviceRepairMapper deviceRepairMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private IDeviceLedgerService deviceLedgerService; | 
 |  |  |     @Override | 
 |  |  |     public IPage<DeviceRepairDto> queryPage(Page page, DeviceRepairDto deviceRepairDto) { | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public AjaxResult saveDeviceRepair(DeviceRepair deviceRepair) { | 
 |  |  |         DeviceLedger byId = deviceLedgerService.getById(deviceRepair.getDeviceLedgerId()); | 
 |  |  |         deviceRepair.setDeviceName(byId.getDeviceName()); | 
 |  |  |         deviceRepair.setDeviceModel(byId.getDeviceModel()); | 
 |  |  |         boolean save = this.save(deviceRepair); | 
 |  |  |         if (save){ | 
 |  |  |             return AjaxResult.success(); | 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     public AjaxResult updateDeviceRepair(DeviceRepair deviceRepair) { | 
 |  |  |         if (this.updateById(deviceRepair)) { | 
 |  |  |             Long id = deviceRepair.getId(); | 
 |  |  |             // | 
 |  |  |             DeviceDefectRecordDto deviceDefectRecordDto = new DeviceDefectRecordDto(); | 
 |  |  |             deviceDefectRecordDto.setDeviceLedgerId(id); | 
 |  |  |             deviceDefectRecordDto.setStatus("严é缺é·"); | 
 |  |  |             List<DeviceDefectRecordDto> records = deviceDefectRecordService.listPage(new Page<>(1, -1), deviceDefectRecordDto).getRecords(); | 
 |  |  |             if (!records.isEmpty()){ | 
 |  |  |                 records.forEach(deviceDefectRecord -> { | 
 |  |  |                     deviceDefectRecord.setStatus("æ£å¸¸"); | 
 |  |  |                     deviceDefectRecordService.updateByDDR(deviceDefectRecord); | 
 |  |  |                 }); | 
 |  |  |             } | 
 |  |  |             return AjaxResult.success(); | 
 |  |  |         } | 
 |  |  |         return AjaxResult.error(); | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.measuringinstrumentledger.controller; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | 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.measuringinstrumentledger.dto.SparePartsDto; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.service.SparePartsService; | 
 |  |  | 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.util.List; | 
 |  |  |  | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/spareParts") | 
 |  |  | @Api(tags = "å¤ä»¶åç±»æ¥å£") | 
 |  |  | public class SparePartsController { | 
 |  |  |     @Autowired | 
 |  |  |     private SparePartsService sparePartsService; | 
 |  |  |     @GetMapping("/getTree") | 
 |  |  |     @ApiOperation("å¤ä»¶åç±»-æ ç»æ") | 
 |  |  |     public AjaxResult getTree(){ | 
 |  |  |         List<SparePartsDto> tree = sparePartsService.getTree(); | 
 |  |  |         return AjaxResult.success(tree); | 
 |  |  |     } | 
 |  |  |     @GetMapping("/listPage") | 
 |  |  |     @ApiOperation("å¤ä»¶åç±»-å页æ¥è¯¢") | 
 |  |  |     public AjaxResult listPage(Page page, SpareParts spareParts){ | 
 |  |  |         IPage<SparePartsDto> listPage = sparePartsService.listPage(page, spareParts); | 
 |  |  |         return AjaxResult.success(listPage); | 
 |  |  |     } | 
 |  |  | //    @GetMapping("/list") | 
 |  |  | //    @ApiOperation("å¤ä»¶åç±»-æ¥è¯¢ææ") | 
 |  |  | //    public AjaxResult list(){ | 
 |  |  | //        return AjaxResult.success(sparePartsService.list()); | 
 |  |  | //    } | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     @ApiOperation("å¤ä»¶åç±»-æ·»å ") | 
 |  |  |     @Log(title = "å¤ä»¶åç±»-æ·»å ", businessType = BusinessType.INSERT) | 
 |  |  |     public AjaxResult add(@RequestBody SpareParts spareParts){ | 
 |  |  |         return AjaxResult.success(sparePartsService.save(spareParts)); | 
 |  |  |     } | 
 |  |  |     @PostMapping("/update") | 
 |  |  |     @ApiOperation("å¤ä»¶åç±»-æ´æ°") | 
 |  |  |     @Log(title = "å¤ä»¶åç±»-æ´æ°", businessType = BusinessType.UPDATE) | 
 |  |  |     public AjaxResult update(@RequestBody SpareParts spareParts){ | 
 |  |  |         return AjaxResult.success(sparePartsService.updateById(spareParts)); | 
 |  |  |     } | 
 |  |  |     @DeleteMapping("/delete/{id}") | 
 |  |  |     @ApiOperation("å¤ä»¶åç±»-å é¤") | 
 |  |  |     @Log(title = "å¤ä»¶åç±»-å é¤", businessType = BusinessType.DELETE) | 
 |  |  |     public AjaxResult delete(@PathVariable Long id){ | 
 |  |  |         return AjaxResult.success(sparePartsService.removeById(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.measuringinstrumentledger.dto; | 
 |  |  |  | 
 |  |  | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | public class SparePartsDto extends SpareParts { | 
 |  |  |     /** | 
 |  |  |      * å¤ä»¶åç±»ç¶åç§° | 
 |  |  |      */ | 
 |  |  |     private String parentName; | 
 |  |  |     private List<SparePartsDto> children; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.measuringinstrumentledger.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.measuringinstrumentledger.dto.SparePartsDto; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; | 
 |  |  | import io.lettuce.core.dynamic.annotation.Param; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  |  | 
 |  |  | @Mapper | 
 |  |  | public interface SparePartsMapper extends BaseMapper<SpareParts> { | 
 |  |  |     IPage<SparePartsDto> listPage(Page page,@Param("spareParts") SpareParts spareParts); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.measuringinstrumentledger.pojo; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  |  | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | @TableName("spare_parts") | 
 |  |  | public class SpareParts { | 
 |  |  |     @TableId(value = "id", type = IdType.AUTO) | 
 |  |  |     private Long id; | 
 |  |  |     /** | 
 |  |  |      * å¤ä»¶åç±»åç§° | 
 |  |  |      */ | 
 |  |  |     private String name; | 
 |  |  |     /** | 
 |  |  |      * å¤ä»¶åç±»ç¼å· | 
 |  |  |      */ | 
 |  |  |     private String sparePartsNo; | 
 |  |  |     /** | 
 |  |  |      * å¤ä»¶ç¶id | 
 |  |  |      */ | 
 |  |  |     private Long parentId; | 
 |  |  |     /** | 
 |  |  |      * å¤ä»¶ç¶æ | 
 |  |  |      */ | 
 |  |  |     private String status; | 
 |  |  |     /** | 
 |  |  |      * å¤ä»¶åç±»æè¿° | 
 |  |  |      */ | 
 |  |  |     private String description; | 
 |  |  |     @ApiModelProperty("å建æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ´æ°æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime updateTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("å建人") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Integer createUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ´æ°äºº") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private Integer updateUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("ç§æ·id") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Long tenantId; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.measuringinstrumentledger.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.measuringinstrumentledger.dto.SparePartsDto; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | public interface SparePartsService extends IService<SpareParts> { | 
 |  |  |     IPage<SparePartsDto> listPage(Page page, SpareParts spareParts); | 
 |  |  |  | 
 |  |  |     List<SparePartsDto> getTree(); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.measuringinstrumentledger.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.measuringinstrumentledger.dto.SparePartsDto; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.mapper.SparePartsMapper; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; | 
 |  |  | import com.ruoyi.measuringinstrumentledger.service.SparePartsService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.HashMap; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | @Service | 
 |  |  | public class SparePartsServiceImpl extends ServiceImpl<SparePartsMapper, SpareParts> implements SparePartsService { | 
 |  |  |     @Autowired | 
 |  |  |     private SparePartsMapper sparePartsMapper; | 
 |  |  |     @Override | 
 |  |  |     public IPage<SparePartsDto> listPage(Page page, SpareParts spareParts) { | 
 |  |  |         return sparePartsMapper.listPage(page,spareParts); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public List<SparePartsDto> getTree() { | 
 |  |  |         SpareParts spareParts = new SpareParts(); | 
 |  |  |         IPage<SparePartsDto> sparePartsDtoIPage = sparePartsMapper.listPage(new Page<>(1, -1), spareParts); | 
 |  |  |         List<SparePartsDto> records = sparePartsDtoIPage.getRecords(); | 
 |  |  |         return buildTree(records); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å°æå¹³ç»ææ°æ®è½¬æ¢ä¸ºæ å½¢ç»æ | 
 |  |  |      * @param flatData æå¹³èç¹å表 | 
 |  |  |      * @return æ å½¢ç»ææ ¹èç¹å表 | 
 |  |  |      */ | 
 |  |  |     public static List<SparePartsDto> buildTree(List<SparePartsDto> flatData) { | 
 |  |  |         List<SparePartsDto> result = new ArrayList<>(); | 
 |  |  |         if (flatData == null || flatData.isEmpty()) { | 
 |  |  |             return result;  // ç©ºè¾å
¥ç´æ¥è¿å空å表 | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 1. å建èç¹æ å°è¡¨ï¼å卿æèç¹å¹¶åå§ååèç¹å表 | 
 |  |  |         Map<Long, SparePartsDto> nodeMap = new HashMap<>(); | 
 |  |  |         for (SparePartsDto node : flatData) { | 
 |  |  |             // ç¡®ä¿åèç¹å表åå§å(é¿å
空æéå¼å¸¸) | 
 |  |  |             if (node.getChildren() == null) { | 
 |  |  |                 node.setChildren(new ArrayList<>()); | 
 |  |  |             } | 
 |  |  |             nodeMap.put(node.getId(), node); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 2. æå»ºæ å½¢ç»æ | 
 |  |  |         for (SparePartsDto node : flatData) { | 
 |  |  |             Long parentId = node.getParentId(); | 
 |  |  |             if (parentId == null || !nodeMap.containsKey(parentId)) { | 
 |  |  |                 // æ ç¶èç¹æç¶èç¹ä¸åå¨ï¼ä½ä¸ºæ ¹èç¹ | 
 |  |  |                 result.add(node); | 
 |  |  |             } else { | 
 |  |  |                 // æç¶èç¹ï¼æ·»å å°ç¶èç¹çåèç¹å表 | 
 |  |  |                 SparePartsDto parentNode = nodeMap.get(parentId); | 
 |  |  |                 parentNode.getChildren().add(node); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return result; | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         IPage<ProcurementPageDtoCopy> result =procurementRecordService.listPageCopy(page, procurementDto); | 
 |  |  |         return AjaxResult.success(result); | 
 |  |  |     } | 
 |  |  |     @GetMapping("/getReportList") | 
 |  |  |     @Log(title = "åºåæ¥è¡¨æ¥è¯¢", businessType = BusinessType.OTHER) | 
 |  |  |     public AjaxResult getReportList(Page page, ProcurementPageDto procurementDto) { | 
 |  |  |         return AjaxResult.success(procurementRecordService.getReportList(page, procurementDto)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å¯¼åº | 
 
 |  |  | 
 |  |  |     private BigDecimal quantity; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æä½åºåæ°é | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "æä½åºåæ°é") | 
 |  |  |     private BigDecimal minStock; | 
 |  |  |     /** | 
 |  |  |      * å¾
å
¥åºæ°é | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "å¾
å
¥åºæ°é") | 
 
 |  |  | 
 |  |  | package com.ruoyi.procurementrecord.dto; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import com.ruoyi.framework.aspectj.lang.annotation.Excel; | 
 |  |  | import lombok.Data; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  |  | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.time.LocalDate; | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "ä¸å«ç¨æ»ä»·") | 
 |  |  |     private BigDecimal taxExclusiveTotalPrice; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨æ¥æ¥ | 
 |  |  |      */ | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate reportDate; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate startMonth; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate endMonth; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate startDate; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate endDate; | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.time.LocalDate; | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | 
 |  |  |     @Excel(name = "å¾
åºåºæ°é") | 
 |  |  |     private BigDecimal inboundNum0; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æä½åºåæ°é | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "æä½åºåæ°é") | 
 |  |  |     private BigDecimal minStock; | 
 |  |  |     /** | 
 |  |  |      * åºå
¥åºæ¶é´ | 
 |  |  |      */ | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "ä¸å«ç¨æ»ä»·") | 
 |  |  |     private BigDecimal taxExclusiveTotalPrice; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨æ¥æ¥ | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "æ¥è¡¨æ¥æ¥") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     private LocalDate reportDate; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "æ¥è¡¨ææ¥å¼å§æ¶é´") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     private LocalDate startMonth; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "æ¥è¡¨ææ¥ç»ææ¶é´") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     private LocalDate endMonth; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "æ¥è¡¨ä½ä¸å¼å§æ¶é´") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     private LocalDate startDate; | 
 |  |  |     /** | 
 |  |  |      * æ¥è¡¨ææ¥ | 
 |  |  |      */ | 
 |  |  |     @Excel(name = "æ¥è¡¨ä½ä¸ç»ææ¶é´") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 
 |  |  |     private LocalDate endDate; | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |      * å
¥åºæ°é | 
 |  |  |      */ | 
 |  |  |     private BigDecimal inboundNum; | 
 |  |  | //    /** | 
 |  |  | //     * æä½åºåæ°é | 
 |  |  | //     */ | 
 |  |  | //    private BigDecimal minStock; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å
¥åºç¨æ· | 
 |  |  |      */ | 
 |  |  |     private String createBy; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å
¥åºç¨æ·id | 
 |  |  |      */ | 
 
 |  |  | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @author :yys | 
 |  |  | 
 |  |  |     int updateManagement(ProcurementManagementUpdateDto procurementDto); | 
 |  |  |  | 
 |  |  |     void exportCopy(HttpServletResponse response); | 
 |  |  |  | 
 |  |  |     Map<String, Object> getReportList(Page page, ProcurementPageDto procurementDto); | 
 |  |  | } | 
 
 |  |  | 
 |  |  | 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.DateUtils; | 
 |  |  | import com.ruoyi.common.utils.SecurityUtils; | 
 |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
 |  |  | import com.ruoyi.framework.security.LoginUser; | 
 |  |  | 
 |  |  | import com.ruoyi.project.system.domain.SysUser; | 
 |  |  | import com.ruoyi.project.system.mapper.SysUserMapper; | 
 |  |  | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; | 
 |  |  | import com.ruoyi.sales.pojo.SalesLedgerProduct; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.time.LocalDate; | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  | import java.time.format.DateTimeFormatter; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.*; | 
 |  |  | import java.util.stream.Collectors; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Map<String, Object> getReportList(Page page, ProcurementPageDto procurementDto) { | 
 |  |  |         // æå»ºæ¥è¡¨æ°æ®ç»æ | 
 |  |  |         Map<String, Object> reportData = new HashMap<>(); | 
 |  |  |         // 2. æå»ºå¾è¡¨æ°æ® | 
 |  |  |         Map<String, Object> chartData = new HashMap<>(); | 
 |  |  |  | 
 |  |  |         IPage<ProcurementPageDtoCopy> procurementPageDtoCopyIPage = procurementRecordMapper.listPageCopy(page, procurementDto); | 
 |  |  |         List<ProcurementPageDtoCopy> procurementPageDtoCopyList = procurementPageDtoCopyIPage.getRecords(); | 
 |  |  |         // è®¡ç®å¾
å
¥åºæ°é | 
 |  |  |         reportData.put("tableData", procurementPageDtoCopyList); | 
 |  |  |         // æ¥è¯¢éè´è®°å½å·²å
¥åºæ°é | 
 |  |  |         List<Integer> collect = procurementPageDtoCopyList.stream().map(ProcurementPageDtoCopy::getId).collect(Collectors.toList()); | 
 |  |  |         if(CollectionUtils.isEmpty(collect)){ | 
 |  |  |              return reportData; | 
 |  |  |         } | 
 |  |  |         LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); | 
 |  |  |         procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); | 
 |  |  |         List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); | 
 |  |  |         if(CollectionUtils.isEmpty( procurementRecords)){ | 
 |  |  |              return reportData; | 
 |  |  |         } | 
 |  |  |         int totalIn =0; | 
 |  |  |         int totalOut =0; | 
 |  |  |         int currentStock =0; | 
 |  |  |         int turnoverRate =0; | 
 |  |  |         List<String> dates = new ArrayList<>(); | 
 |  |  |         List<Integer> values = new ArrayList<>(); | 
 |  |  |         List<String> comparisonDates = new ArrayList<>(); | 
 |  |  |         List<Integer> inValues = new ArrayList<>(); | 
 |  |  |         List<Integer> outValues = new ArrayList<>(); | 
 |  |  |         // å®ä¹æ¥ææ ¼å¼åå¨ï¼æå®ä¸ºyyyy-MM-ddæ ¼å¼ | 
 |  |  |         DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE; | 
 |  |  |         for (ProcurementPageDtoCopy dto : procurementPageDtoCopyList) { | 
 |  |  |             dates.add(dto.getCreateTime().format(dateFormatter)); | 
 |  |  |             comparisonDates.add(dto.getCreateTime().format(dateFormatter)); | 
 |  |  |  | 
 |  |  |             // æ ¹æ®éè´å°è´¦IDçé对åºçåºåºè®°å½ | 
 |  |  |             List<ProcurementRecordOut> collect1 = procurementRecords.stream() | 
 |  |  |                     .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId())) | 
 |  |  |                     .collect(Collectors.toList()); | 
 |  |  |  | 
 |  |  |             // å¦ææ²¡æç¸å
³çåºåºè®°å½ï¼è·³è¿è¯¥æ¡æ°æ® | 
 |  |  |             if(CollectionUtils.isEmpty(collect1)){ | 
 |  |  |                 dto.setInboundNum0(dto.getInboundNum()); | 
 |  |  |                 continue; | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             // è®¡ç®å·²åºåºæ°éæ»åï¼å¹¶è®¾ç½®å¾
åºåºæ°é | 
 |  |  |             BigDecimal totalInboundNum = collect1.stream() | 
 |  |  |                     .map(ProcurementRecordOut::getInboundNum) | 
 |  |  |                     .reduce(BigDecimal.ZERO, BigDecimal::add); | 
 |  |  |  | 
 |  |  |             // å¾
åºåºæ°é = æ»æ°é - å·²åºåºæ°é | 
 |  |  |             dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum)); | 
 |  |  |  | 
 |  |  |             // è®¡ç®æ»å
¥åºæ°é | 
 |  |  |             totalIn += dto.getInboundNum().intValue(); | 
 |  |  |             inValues.add(totalIn); | 
 |  |  |             // è®¡ç®æ»åºåºæ°é | 
 |  |  |             totalOut += totalInboundNum.intValue(); | 
 |  |  |             outValues.add(totalOut); | 
 |  |  |             // è®¡ç®å½ååºå | 
 |  |  |             currentStock += dto.getInboundNum().intValue() - totalInboundNum.intValue(); | 
 |  |  |             values.add(currentStock); | 
 |  |  |             // è®¡ç®å¨è½¬ç | 
 |  |  |             if(totalIn > 0){ | 
 |  |  |                 turnoverRate = totalOut * 100 / totalIn; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         // 1. æå»ºæ±æ»æ°æ® | 
 |  |  |         Map<String, Object> summary = new HashMap<>(); | 
 |  |  |         summary.put("totalIn", totalIn);          // æ»å
¥åºéï¼å®é
åºä»æ°æ®è®¡ç® | 
 |  |  |         summary.put("totalOut", totalOut);         // æ»åºåºéï¼å®é
åºä»æ°æ®è®¡ç® | 
 |  |  |         summary.put("currentStock", currentStock);     // å½ååºåéï¼å®é
åºä»æ°æ®è®¡ç® | 
 |  |  |         summary.put("turnoverRate", turnoverRate);      // å¨è½¬çï¼å®é
åºä»æ°æ®è®¡ç® | 
 |  |  |         reportData.put("summary", summary); | 
 |  |  |  | 
 |  |  |         // 2. æå»ºå¾è¡¨æ°æ® | 
 |  |  | //        Map<String, Object> chartData = new HashMap<>(); | 
 |  |  | //        List<String> dates = Arrays.asList("2025-09-15", "2025-09-16", "2025-09-17", "2025-09-18", "2025-09-19"); | 
 |  |  | //        List<Integer> values = Arrays.asList(300, 350, 400, 380, 420); | 
 |  |  |  | 
 |  |  |         chartData.put("dates", dates); | 
 |  |  |         chartData.put("values", values); | 
 |  |  |         chartData.put("comparisonDates", comparisonDates);  // å®é
åºä»æ°æ®è®¡ç® | 
 |  |  |         chartData.put("inValues", inValues);         // å®é
åºä»æ°æ®è®¡ç® | 
 |  |  |         chartData.put("outValues", outValues);        // å®é
åºä»æ°æ®è®¡ç® | 
 |  |  |         reportData.put("chartData", chartData); | 
 |  |  |  | 
 |  |  |         // 3. è®¾ç½®è¡¨æ ¼æ°æ® | 
 |  |  |         reportData.put("tableData", procurementPageDtoCopyList); | 
 |  |  |  | 
 |  |  |         return reportData; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public int add(ProcurementAddDto procurementDto) { | 
 |  |  |         LoginUser loginUser = SecurityUtils.getLoginUser(); | 
 |  |  |         // æ¹éæ°å¢ | 
 
 |  |  | 
 |  |  | package com.ruoyi.sales.controller; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | 
 |  |  | import com.ruoyi.sales.dto.InvoiceLedgerDto; | 
 |  |  | import com.ruoyi.sales.dto.SalesLedgerDto; | 
 |  |  | import com.ruoyi.sales.mapper.InvoiceLedgerMapper; | 
 |  |  | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; | 
 |  |  | import com.ruoyi.sales.mapper.ReceiptPaymentMapper; | 
 |  |  | import com.ruoyi.sales.pojo.InvoiceLedger; | 
 |  |  | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; | 
 |  |  | import com.ruoyi.sales.pojo.ReceiptPayment; | 
 |  |  | import com.ruoyi.sales.pojo.SalesLedger; | 
 |  |  | import com.ruoyi.sales.service.ICommonFileService; | 
 |  |  | import com.ruoyi.sales.service.ISalesLedgerService; | 
 |  |  | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Objects; | 
 |  |  | import java.util.stream.Collectors; | 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private InvoiceLedgerMapper invoiceLedgerMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ReceiptPaymentMapper receiptPaymentMapper; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ¥è¯¢éå®å°è´¦å表 | 
 |  |  |      */ | 
 |  |  | 
 |  |  |                 if (salesLedger.getId().intValue() == invoiceLedgerDto.getSalesLedgerId()) { | 
 |  |  |                     BigDecimal noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); | 
 |  |  |                     salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return getDataTable(list); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |             iPage.setTotal(iPage.getRecords().size()); | 
 |  |  |             return iPage; | 
 |  |  |         } | 
 |  |  |         // è®¡ç®å款éé¢ï¼å¾
忬¾éé¢ | 
 |  |  |         List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(new LambdaQueryWrapper<InvoiceRegistrationProduct>() | 
 |  |  |                 .in(InvoiceRegistrationProduct::getSalesLedgerId, salesLedgerIds)); | 
 |  |  |  | 
 |  |  |         List<InvoiceLedger> invoiceLedgers = invoiceLedgerMapper.selectList(new LambdaQueryWrapper<InvoiceLedger>() | 
 |  |  |                 .in(InvoiceLedger::getInvoiceRegistrationProductId, invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()))); | 
 |  |  |         List<ReceiptPayment> receiptPayments = new ArrayList<>(); | 
 |  |  |         if(!CollectionUtils.isEmpty(invoiceLedgers)){ | 
 |  |  |             receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>() | 
 |  |  |                     .in(ReceiptPayment::getInvoiceLedgerId, invoiceLedgers.stream().map(InvoiceLedger::getId).collect(Collectors.toList()))); | 
 |  |  |         } | 
 |  |  |         for (SalesLedger salesLedger : iPage.getRecords()) { | 
 |  |  |             boolean existFlag = false; | 
 |  |  |             BigDecimal noInvoiceAmountTotal = BigDecimal.ZERO; | 
 |  |  | 
 |  |  |                     noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); | 
 |  |  |                     invoiceTotal = invoiceLedgerDto.getInvoiceTotal(); | 
 |  |  |                     existFlag = true; | 
 |  |  |                     if(!CollectionUtils.isEmpty(receiptPayments)){ | 
 |  |  |                         List<InvoiceRegistrationProduct> collect = invoiceRegistrationProducts.stream() | 
 |  |  |                                 .filter(item -> salesLedger.getId().equals(Long.parseLong(item.getSalesLedgerId().toString()))) | 
 |  |  |                                 .collect(Collectors.toList()); | 
 |  |  |                         List<Integer> collect1 = collect.stream() | 
 |  |  |                                 .map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()); | 
 |  |  |                         List<InvoiceLedger> collect2 = invoiceLedgers.stream() | 
 |  |  |                                 .filter(item -> collect1.contains(item.getInvoiceRegistrationProductId())) | 
 |  |  |                                 .collect(Collectors.toList()); | 
 |  |  |                         // è·å已忬¾éé¢ | 
 |  |  |                         List<ReceiptPayment> collect3 = receiptPayments.stream() | 
 |  |  |                                 .filter(item -> collect2.stream().anyMatch(item1 -> item1.getId().equals(item.getInvoiceLedgerId()))) | 
 |  |  |                                 .collect(Collectors.toList()); | 
 |  |  |                         BigDecimal receiptPaymentAmountTotal = collect3.stream().map(ReceiptPayment::getReceiptPaymentAmount) | 
 |  |  |                                 .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); | 
 |  |  |                         // è·åå¾
忬¾éé¢ | 
 |  |  |                         BigDecimal noReceiptPaymentAmountTotal = invoiceLedgerDto.getInvoiceTotal().subtract(receiptPaymentAmountTotal); | 
 |  |  |                         salesLedger.setReceiptPaymentAmountTotal(receiptPaymentAmountTotal); | 
 |  |  |                         salesLedger.setNoReceiptAmount(noReceiptPaymentAmountTotal); | 
 |  |  |                     } | 
 |  |  |                     break; | 
 |  |  |                 } | 
 |  |  |             } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.controller; | 
 |  |  |  | 
 |  |  | import com.ruoyi.framework.web.domain.AjaxResult; | 
 |  |  | import com.ruoyi.sales.dto.SalesQuotationDto; | 
 |  |  | import com.ruoyi.sales.service.SalesQuotationService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/sales/quotation") | 
 |  |  | public class SalesQuotationController { | 
 |  |  |     @Autowired | 
 |  |  |     private SalesQuotationService salesQuotationService; | 
 |  |  |     @GetMapping("/list") | 
 |  |  |     public AjaxResult getList(Page page, SalesQuotationDto salesQuotationDto) { | 
 |  |  |         return AjaxResult.success(salesQuotationService.listPage(page, salesQuotationDto)); | 
 |  |  |     } | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     public AjaxResult add(@RequestBody SalesQuotationDto salesQuotationDto) { | 
 |  |  |         return AjaxResult.success(salesQuotationService.add(salesQuotationDto)); | 
 |  |  |     } | 
 |  |  |     @PostMapping("/update") | 
 |  |  |     public AjaxResult update(@RequestBody SalesQuotationDto salesQuotationDto) { | 
 |  |  |         return AjaxResult.success(salesQuotationService.edit(salesQuotationDto)); | 
 |  |  |     } | 
 |  |  |     @DeleteMapping("/delete") | 
 |  |  |     public AjaxResult delete(@RequestBody Long id) { | 
 |  |  |         return AjaxResult.success(salesQuotationService.delete(id)); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  | package com.ruoyi.sales.dto; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.TableField; | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import com.ruoyi.framework.aspectj.lang.annotation.Excel; | 
 |  |  | import com.ruoyi.sales.pojo.ReceiptPayment; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  |  | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.time.LocalDate; | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | public class ReceiptPaymentDto extends ReceiptPayment { | 
 |  |  | 
 |  |  |     @Excel(name = "客æ·åç§°") | 
 |  |  |     private String customerName; | 
 |  |  |  | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @Excel(name = "å¼ç¥¨æ¥æ",width = 30,dateFormat = "yyyy-MM-dd") | 
 |  |  |     @ApiModelProperty(value = "å¼ç¥¨æ¥æ") | 
 |  |  |     private Date invoiceDate; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "æ¥è¯¢ææ¬") | 
 |  |  |     private String searchText; | 
 |  |  |  | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.dto; | 
 |  |  |  | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotation; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotationProduct; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | public class SalesQuotationDto extends SalesQuotation { | 
 |  |  |     @ApiModelProperty(value = "æ¥ä»·åå") | 
 |  |  |     private List<SalesQuotationProduct> products; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.mapper; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.ruoyi.sales.dto.SalesQuotationDto; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotation; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  | import org.springframework.data.repository.query.Param; | 
 |  |  |  | 
 |  |  | @Mapper | 
 |  |  | public interface SalesQuotationMapper extends BaseMapper<SalesQuotation> { | 
 |  |  |     IPage<SalesQuotationDto> listPage(Page page,@Param("salesQuotationDto") SalesQuotationDto salesQuotationDto); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.mapper; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotationProduct; | 
 |  |  | import io.lettuce.core.dynamic.annotation.Param; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | @Mapper | 
 |  |  | public interface SalesQuotationProductMapper extends BaseMapper<SalesQuotationProduct> { | 
 |  |  | //    List<SalesQuotationProduct> selectBySalesQuotationIds(List<Long> salesQuotationIds); | 
 |  |  |  | 
 |  |  |     List<SalesQuotationProduct> selectBySalesQuotationId(@Param("id") Long id); | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     @ApiModelProperty(value = "å·²å¼ç¥¨éé¢(å
)") | 
 |  |  |     private BigDecimal invoiceTotal; | 
 |  |  |  | 
 |  |  |     @TableField(exist = false) | 
 |  |  |     @ApiModelProperty(value = "忬¾éé¢") | 
 |  |  |     private BigDecimal receiptPaymentAmountTotal = BigDecimal.ZERO; | 
 |  |  |  | 
 |  |  |     @TableField(exist = false) | 
 |  |  |     @ApiModelProperty(value = "å¾
忬¾éé¢") | 
 |  |  |     private BigDecimal noReceiptAmount = BigDecimal.ZERO; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "仿¬¾æ¹å¼") | 
 |  |  |     private String paymentMethod; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.pojo; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  |  | 
 |  |  | import java.time.LocalDate; | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | @TableName("sales_quotation") | 
 |  |  | public class SalesQuotation { | 
 |  |  |     @TableId(value = "id", type = IdType.AUTO) | 
 |  |  |     private Long id; | 
 |  |  |     @ApiModelProperty(value = "æ¥ä»·åç¼å·") | 
 |  |  |     private String quotationNo; | 
 |  |  |     @ApiModelProperty(value = "客æ·åç§°") | 
 |  |  |     private String customer; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "ä¸å¡å") | 
 |  |  |     private String salesperson; | 
 |  |  |     @ApiModelProperty(value = "æ¥ä»·æ¥æ") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate quotationDate; | 
 |  |  |     @ApiModelProperty(value = "æææè³") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     private LocalDate validDate; | 
 |  |  |     @ApiModelProperty(value = "仿¬¾æ¹å¼") | 
 |  |  |     private String paymentMethod; | 
 |  |  |     @ApiModelProperty(value = "äº¤è´§å¨æå¤©æ°") | 
 |  |  |     private String deliveryPeriod; | 
 |  |  |     @ApiModelProperty(value = "ç¶æ") | 
 |  |  |     private String status; | 
 |  |  |     @ApiModelProperty(value = "æ¥ä»·æ»éé¢") | 
 |  |  |     private Double totalAmount; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "夿³¨") | 
 |  |  |     private String remark; | 
 |  |  |     @ApiModelProperty(value = "å建æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "ä¿®æ¹æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private LocalDateTime updateTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "åå»ºç¨æ·") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Integer createUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private Integer updateUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "ç§æ·ID") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Long tenantId; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.pojo; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | @TableName("sales_quotation_product") | 
 |  |  | public class SalesQuotationProduct { | 
 |  |  |     @ApiModelProperty(value = "æ¥ä»·ååID") | 
 |  |  |     @TableId(value = "id", type = IdType.AUTO) | 
 |  |  |     private Long id; | 
 |  |  |     @ApiModelProperty(value = "é宿¥ä»·åid") | 
 |  |  |     private Long salesQuotationId; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "åååç§°") | 
 |  |  |     private String product; | 
 |  |  |     @ApiModelProperty(value = "ååè§æ ¼") | 
 |  |  |     private String specification; | 
 |  |  |     @ApiModelProperty(value = "åä½") | 
 |  |  |     private String unit; | 
 |  |  |     @ApiModelProperty(value = "åä»·") | 
 |  |  |     private Double unitPrice; | 
 |  |  |     @ApiModelProperty(value = "æ°é") | 
 |  |  |     private Integer quantity; | 
 |  |  |     @ApiModelProperty(value = "éé¢") | 
 |  |  |     private Double amount; | 
 |  |  |     @ApiModelProperty(value = "å建æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "ä¿®æ¹æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private LocalDateTime updateTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "åå»ºç¨æ·") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Integer createUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private Integer updateUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "ç§æ·ID") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Long tenantId; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.service; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.service.IService; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotationProduct; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | public interface SalesQuotationProductService extends IService<SalesQuotationProduct> { | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.service; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.IService; | 
 |  |  | import com.ruoyi.sales.dto.SalesQuotationDto; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotation; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  |  | 
 |  |  | public interface SalesQuotationService extends IService<SalesQuotation> { | 
 |  |  |     IPage listPage(Page page, SalesQuotationDto salesQuotationDto); | 
 |  |  |  | 
 |  |  |     boolean add(SalesQuotationDto salesQuotationDto); | 
 |  |  |  | 
 |  |  |     boolean delete(Long id); | 
 |  |  |  | 
 |  |  |     boolean edit(SalesQuotationDto salesQuotationDto); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.service.impl; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotationProduct; | 
 |  |  | import com.ruoyi.sales.service.SalesQuotationProductService; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | @Service | 
 |  |  | public class SalesQuotationProductServiceImpl extends ServiceImpl<SalesQuotationProductMapper, SalesQuotationProduct> implements SalesQuotationProductService { | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.sales.service.impl; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 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.service.impl.ServiceImpl; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.utils.bean.BeanUtils; | 
 |  |  | import com.ruoyi.sales.dto.SalesQuotationDto; | 
 |  |  | import com.ruoyi.sales.mapper.SalesQuotationMapper; | 
 |  |  | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotation; | 
 |  |  | import com.ruoyi.sales.pojo.SalesQuotationProduct; | 
 |  |  | import com.ruoyi.sales.service.SalesQuotationProductService; | 
 |  |  | import com.ruoyi.sales.service.SalesQuotationService; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.stream.Collectors; | 
 |  |  |  | 
 |  |  | @Service | 
 |  |  | @Transactional(rollbackFor = Exception.class) | 
 |  |  | public class SalesQuotationServiceImpl extends ServiceImpl<SalesQuotationMapper, SalesQuotation> implements SalesQuotationService { | 
 |  |  |     @Autowired | 
 |  |  |     private SalesQuotationMapper salesQuotationMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private SalesQuotationProductMapper salesQuotationProductMapper; | 
 |  |  |     @Autowired | 
 |  |  |     private SalesQuotationProductService salesQuotationProductService; | 
 |  |  |     @Override | 
 |  |  |     public IPage<SalesQuotationDto> listPage(Page page, SalesQuotationDto salesQuotationDto) { | 
 |  |  |         IPage<SalesQuotationDto> salesQuotationDtoIPage = salesQuotationMapper.listPage(page, salesQuotationDto); | 
 |  |  |         if(CollectionUtils.isEmpty(salesQuotationDtoIPage.getRecords())){ | 
 |  |  |             return salesQuotationDtoIPage; | 
 |  |  |         } | 
 |  |  |         salesQuotationDtoIPage.getRecords().forEach(record -> { | 
 |  |  |             List<SalesQuotationProduct> products = salesQuotationProductMapper.selectBySalesQuotationId(record.getId()); | 
 |  |  |             record.setProducts(products); | 
 |  |  |         }); | 
 |  |  |         return salesQuotationDtoIPage; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public boolean add(SalesQuotationDto salesQuotationDto) { | 
 |  |  |         SalesQuotation salesQuotation = new SalesQuotation(); | 
 |  |  |         BeanUtils.copyProperties(salesQuotationDto, salesQuotation); | 
 |  |  |         String quotationNo = salesQuotation.getQuotationNo(); | 
 |  |  |         salesQuotationMapper.insert(salesQuotation); | 
 |  |  | //        if(salesQuotationMapper.insert(salesQuotation)!=1){ | 
 |  |  | //            return false; | 
 |  |  | //        } | 
 |  |  |         if(CollectionUtils.isEmpty(salesQuotationDto.getProducts())){ | 
 |  |  |             return true; | 
 |  |  |         } | 
 |  |  |         List<SalesQuotationProduct> products = salesQuotationDto.getProducts().stream().map(product -> { | 
 |  |  |             SalesQuotationProduct salesQuotationProduct = new SalesQuotationProduct(); | 
 |  |  |             BeanUtils.copyProperties(product, salesQuotationProduct); | 
 |  |  |             salesQuotationProduct.setSalesQuotationId(salesQuotationMapper.selectOne(new LambdaQueryWrapper<SalesQuotation>().eq(SalesQuotation::getQuotationNo, quotationNo)).getId()); | 
 |  |  |             return salesQuotationProduct; | 
 |  |  |         }).collect(Collectors.toList()); | 
 |  |  |         salesQuotationProductService.saveBatch(products); | 
 |  |  |         return true; | 
 |  |  |     } | 
 |  |  |     @Override | 
 |  |  |     public boolean edit(SalesQuotationDto salesQuotationDto) { | 
 |  |  |         SalesQuotation salesQuotation = new SalesQuotation(); | 
 |  |  |         BeanUtils.copyProperties(salesQuotationDto, salesQuotation); | 
 |  |  |         if(salesQuotationMapper.updateById(salesQuotation)!=1){ | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |         salesQuotationProductMapper.delete(new LambdaQueryWrapper<SalesQuotationProduct>().eq(SalesQuotationProduct::getSalesQuotationId, salesQuotationDto.getId())); | 
 |  |  |         if(CollectionUtils.isEmpty(salesQuotationDto.getProducts())){ | 
 |  |  |             return true; | 
 |  |  |         } | 
 |  |  |         List<SalesQuotationProduct> products = salesQuotationDto.getProducts().stream().map(product -> { | 
 |  |  |             SalesQuotationProduct salesQuotationProduct = new SalesQuotationProduct(); | 
 |  |  |             BeanUtils.copyProperties(product, salesQuotationProduct); | 
 |  |  |             salesQuotationProduct.setSalesQuotationId(salesQuotation.getId()); | 
 |  |  |             return salesQuotationProduct; | 
 |  |  |         }).collect(Collectors.toList()); | 
 |  |  |         salesQuotationProductService.saveBatch(products); | 
 |  |  |         return true; | 
 |  |  |     } | 
 |  |  |     @Override | 
 |  |  |     public boolean delete(Long id) { | 
 |  |  |         salesQuotationMapper.deleteById(id); | 
 |  |  |         salesQuotationProductMapper.delete(new LambdaQueryWrapper<SalesQuotationProduct>().eq(SalesQuotationProduct::getSalesQuotationId, id)); | 
 |  |  |         return true; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | <?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.collaborativeApproval.mapper.StaffContactsPersonalMapper"> | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     <select id="listPage" resultType="com.ruoyi.collaborativeApproval.dto.StaffContactsPersonalDTO"> | 
 |  |  |         SELECT | 
 |  |  |             scp.id, | 
 |  |  |             scp.contact_id, | 
 |  |  |             sjlr.staff_no, | 
 |  |  |             sjlr.staff_name, | 
 |  |  |             sjlr.sex, | 
 |  |  |             sjlr.post_job, | 
 |  |  |             sjlr.adress, | 
 |  |  |             sjlr.profession, | 
 |  |  |             sjlr.identity_card, | 
 |  |  |             sjlr.phone, | 
 |  |  |             scp.create_time | 
 |  |  |         FROM staff_contacts_personal scp | 
 |  |  |             LEFT JOIN (select * from staff_join_leave_record WHERE staff_state = 1) sjlr ON scp.contact_id=sjlr.id | 
 |  |  |         where 1=1 | 
 |  |  |         <if test="staffContactsPersonalDTO.staffName != null and staffContactsPersonalDTO.staffName != ''"> | 
 |  |  |             and sjlr.staff_name like concat('%',#{staffContactsPersonalDTO.staffName},'%') | 
 |  |  |         </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.device.mapper.DeviceDefectRecordMapper"> | 
 |  |  |  | 
 |  |  |     <select id="listPage" resultType="com.ruoyi.device.dto.DeviceDefectRecordDto"> | 
 |  |  |         select ddr.*,dl.device_name,dl.device_model | 
 |  |  |         from device_defect_record ddr | 
 |  |  |         left join device_ledger dl on ddr.device_ledger_id = dl.id | 
 |  |  |         <where> | 
 |  |  |             1=1 | 
 |  |  |             <if test="deviceDefectRecordDto.deviceLedgerId != null"> | 
 |  |  |                 and ddr.device_ledger_id = #{deviceDefectRecordDto.deviceLedgerId} | 
 |  |  |             </if> | 
 |  |  |             <if test="deviceDefectRecordDto.deviceName != null and deviceDefectRecordDto.deviceName != ''"> | 
 |  |  |                 and dl.device_name like concat('%',#{deviceDefectRecordDto.deviceName},'%') | 
 |  |  |             </if> | 
 |  |  |             <if test="deviceDefectRecordDto.status != null"> | 
 |  |  |                 and ddr.status = #{deviceDefectRecordDto.status} | 
 |  |  |             </if> | 
 |  |  |         </where> | 
 |  |  |  | 
 |  |  |     </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.measuringinstrumentledger.mapper.SparePartsMapper"> | 
 |  |  |     <select id="listPage" resultType="com.ruoyi.measuringinstrumentledger.dto.SparePartsDto"> | 
 |  |  |         select sp.*,sp1.name as parentName from spare_parts sp | 
 |  |  |         left join spare_parts sp1 on sp1.id = sp.parent_id | 
 |  |  |         <where> | 
 |  |  |             <if test="spareParts.name != null"> | 
 |  |  |                 and name like concat('%',#{spareParts.name},'%') | 
 |  |  |             </if> | 
 |  |  |         </where> | 
 |  |  |     </select> | 
 |  |  | </mapper> | 
 
 |  |  | 
 |  |  |             t2.specification_model, | 
 |  |  |             t2.unit, | 
 |  |  |             t2.quantity, | 
 |  |  |             t2.min_stock, | 
 |  |  |             t2.quantity as quantity0, | 
 |  |  |             t2.tax_rate, | 
 |  |  |             t2.tax_inclusive_unit_price, | 
 |  |  | 
 |  |  |         t1.create_user, | 
 |  |  |         t2.specification_model, | 
 |  |  |         t2.unit, | 
 |  |  |         t2.min_stock, | 
 |  |  |         t2.tax_rate, | 
 |  |  |         t2.tax_inclusive_unit_price, | 
 |  |  |         t2.tax_inclusive_total_price, | 
 |  |  | 
 |  |  |             <if test="req.supplierName != null and req.supplierName != ''"> | 
 |  |  |                 and t3.supplier_name like  concat('%',#{req.supplierName},'%') | 
 |  |  |             </if> | 
 |  |  |             <if test="req.reportDate != null"> | 
 |  |  |                 and t1.create_time >= #{req.reportDate} and t1.create_time < DATE_ADD(#{req.reportDate}, INTERVAL 1 DAY) | 
 |  |  |             </if> | 
 |  |  |             <if test="req.startMonth != null"> | 
 |  |  |                 and t1.create_time >= #{req.startMonth} | 
 |  |  |             </if> | 
 |  |  |             <if test="req.endMonth != null"> | 
 |  |  |                 and t1.create_time <= #{req.endMonth} | 
 |  |  |             </if> | 
 |  |  |             <if test="req.startDate != null"> | 
 |  |  |                 and t1.create_time >= #{req.startDate} | 
 |  |  |             </if> | 
 |  |  |             <if test="req.endDate != null"> | 
 |  |  |                 and t1.create_time <= #{req.endDate} | 
 |  |  |             </if> | 
 |  |  |         </where> | 
 |  |  |     </select> | 
 |  |  |     <select id="listCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | <?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.sales.mapper.SalesQuotationMapper"> | 
 |  |  |     <select id="listPage" resultType="com.ruoyi.sales.dto.SalesQuotationDto"> | 
 |  |  |         SELECT * FROM sales_quotation | 
 |  |  |         WHERE 1=1 | 
 |  |  |         <if test="salesQuotationDto.quotationNo != null and salesQuotationDto.quotationNo != '' "> | 
 |  |  |             AND quotation_no LIKE CONCAT('%',#{salesQuotationDto.quotationNo},'%') | 
 |  |  |         </if> | 
 |  |  |         <if test="salesQuotationDto.customer != null and salesQuotationDto.customer != '' "> | 
 |  |  |             AND customer = #{salesQuotationDto.customer} | 
 |  |  |         </if> | 
 |  |  |         <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' "> | 
 |  |  |             AND status = #{salesQuotationDto.status} | 
 |  |  |         </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.sales.mapper.SalesQuotationProductMapper"> | 
 |  |  | <!--    <select id="selectBySalesQuotationIds" resultType="com.ruoyi.sales.pojo.SalesQuotationProduct">--> | 
 |  |  | <!--        select * from sales_quotation_product where sales_quotation_id in--> | 
 |  |  | <!--        <foreach collection="salesQuotationIds" item="salesQuotationId" open="(" close=")" separator=",">--> | 
 |  |  | <!--            #{salesQuotationId}--> | 
 |  |  | <!--        </foreach>--> | 
 |  |  | <!--    </select>--> | 
 |  |  |     <select id="selectBySalesQuotationId" resultType="com.ruoyi.sales.pojo.SalesQuotationProduct"> | 
 |  |  |         select * from sales_quotation_product where sales_quotation_id = #{id} | 
 |  |  |     </select> | 
 |  |  | </mapper> |