¶Ô±ÈÐÂÎļþ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:inoutrecord:create', 'æ°å»ºåºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:inoutrecord:delete', 'å é¤åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:inoutrecord:update', 'ä¿®æ¹åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:inoutrecord:query', 'æ¥è¯¢åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:inoutrecord:exportExcel', '导åºåºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.dao.business.model.InoutRecord; |
| | | import com.doumee.service.business.InoutRecordService; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/04/28 16:19 |
| | | */ |
| | | @Api(tags = "åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨") |
| | | @RestController |
| | | @RequestMapping("/business/inoutRecord") |
| | | public class InoutRecordController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InoutRecordService inoutRecordService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:inoutrecord:create") |
| | | public ApiResponse create(@RequestBody InoutRecord inoutRecord) { |
| | | return ApiResponse.success(inoutRecordService.create(inoutRecord)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:inoutrecord:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | inoutRecordService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:inoutrecord:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | inoutRecordService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:inoutrecord:update") |
| | | public ApiResponse updateById(@RequestBody InoutRecord inoutRecord) { |
| | | inoutRecordService.updateById(inoutRecord); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:inoutrecord:query") |
| | | public ApiResponse<PageData<InoutRecord>> findPage (@RequestBody PageWrap<InoutRecord> pageWrap) { |
| | | return ApiResponse.success(inoutRecordService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:inoutrecord:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<InoutRecord> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(InoutRecord.class).export(inoutRecordService.findPage(pageWrap).getRecords(), "åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:inoutrecord:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(inoutRecordService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.InoutRecord; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/04/28 16:19 |
| | | */ |
| | | public interface InoutRecordMapper extends BaseMapper<InoutRecord> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/04/28 16:19 |
| | | */ |
| | | @Data |
| | | @ApiModel("åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨") |
| | | @TableName("`inout_record`") |
| | | public class InoutRecord { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主é®", example = "1") |
| | | @ExcelColumn(name="主é®") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "å建人ç¼ç ", example = "1") |
| | | @ExcelColumn(name="å建人ç¼ç ") |
| | | private Integer creator; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | | @ExcelColumn(name="æ´æ°äººç¼ç ") |
| | | private Integer editor; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @ExcelColumn(name="æ´æ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å é¤0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å é¤0å¦ 1æ¯") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "对象类å 0è½¦è¾ 1人å", example = "1") |
| | | @ExcelColumn(name="对象类å 0è½¦è¾ 1人å") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "海康äºä»¶ç¼ç ") |
| | | @ExcelColumn(name="海康äºä»¶ç¼ç ") |
| | | private String hkEventId; |
| | | |
| | | @ApiModelProperty(value = "海康äºä»¶å¯¹è±¡ç¼ç ") |
| | | @ExcelColumn(name="海康äºä»¶å¯¹è±¡ç¼ç ") |
| | | private String hkId; |
| | | |
| | | @ApiModelProperty(value = "å
³è人åç¼ç ï¼å
³èmember)", example = "1") |
| | | @ExcelColumn(name="å
³è人åç¼ç ï¼å
³èmember)") |
| | | private Integer memberId; |
| | | |
| | | @ApiModelProperty(value = "å
³è人åç¼ç ï¼å
³ècars)", example = "1") |
| | | @ExcelColumn(name="å
³è人åç¼ç ï¼å
³ècars)") |
| | | private Integer carId; |
| | | |
| | | @ApiModelProperty(value = "å
³èåç±»ç¼ç ï¼å
³ècategory)", example = "1") |
| | | @ExcelColumn(name="å
³èåç±»ç¼ç ï¼å
³ècategory)") |
| | | private Integer categoryId; |
| | | |
| | | @ApiModelProperty(value = "å
³èåç±»åç§°") |
| | | @ExcelColumn(name="å
³èåç±»åç§°") |
| | | private String categoryName; |
| | | |
| | | @ApiModelProperty(value = "", example = "1") |
| | | @ExcelColumn(name="") |
| | | private Integer carBizType; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ç±»å 0访客 1å
é¨äººå 2ç¸å
³æ¹äººå 3è´§è¿å¸æº", example = "1") |
| | | @ExcelColumn(name="ç¨æ·ç±»å 0访客 1å
é¨äººå 2ç¸å
³æ¹äººå 3è´§è¿å¸æº") |
| | | private Integer memberType; |
| | | |
| | | @ApiModelProperty(value = "人ååç§°") |
| | | @ExcelColumn(name="人ååç§°") |
| | | private String memberName; |
| | | |
| | | @ApiModelProperty(value = "车çå·") |
| | | @ExcelColumn(name="车çå·") |
| | | private String carCode; |
| | | |
| | | @ApiModelProperty(value = "å
³è对象类å 0è½¦è¾ 1人å 2访客ç³è¯·è®°å½ 3访客æ¥å¤ç³è¯·è®°å½ 4æå°ä½ä¸è®°å½", example = "1") |
| | | @ExcelColumn(name="å
³è对象类å 0è½¦è¾ 1人å 2访客ç³è¯·è®°å½ 3访客æ¥å¤ç³è¯·è®°å½ 4æå°ä½ä¸è®°å½") |
| | | private Integer objType; |
| | | |
| | | @ApiModelProperty(value = "å
³è对象ç¼ç ", example = "1") |
| | | @ExcelColumn(name="å
³è对象ç¼ç ") |
| | | private Integer objId; |
| | | |
| | | @ApiModelProperty(value = "è¿åºç±»å 0è¿ 1åº", example = "1") |
| | | @ExcelColumn(name="è¿åºç±»å 0è¿ 1åº") |
| | | private Integer inOrOut; |
| | | |
| | | @ApiModelProperty(value = "è¿åºè®¾å¤åç§°") |
| | | @ExcelColumn(name="è¿åºè®¾å¤åç§°") |
| | | private String deviceName; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "æ»æ°") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty(value = "å¾
å¤ç") |
| | | private Integer waitDeal; |
| | | |
| | | @ApiModelProperty(value = "å·²æ´æ¹") |
| | | private Integer dealFinish; |
| | | |
| | | @ApiModelProperty(value = "å·²éå") |
| | | private Integer back; |
| | | |
| | | @ApiModelProperty(value = "仿¥æ°å¢") |
| | | private Integer todayNew; |
| | | |
| | | @ApiModelProperty(value = "年度ç»è®¡ - 12æ¡è®°å½") |
| | | private List<GeneralDataVO> yearList; |
| | | |
| | | @ApiModelProperty(value = "éæ£ç±»åç»è®¡") |
| | | private List<GeneralDataVO> cateList ; |
| | | |
| | | @ApiModelProperty(value = "鿣é¨é¨ç»è®¡") |
| | | private List<GeneralDataVO> departmentList ; |
| | | |
| | | @ApiModelProperty(value = "鿣é¨é¨ç»è®¡ - æåº") |
| | | private List<GeneralDataVO> departmentSortList ; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.dao.business.model.InoutRecord; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨Serviceå®ä¹ |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/04/28 16:19 |
| | | */ |
| | | public interface InoutRecordService { |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param inoutRecord å®ä½å¯¹è±¡ |
| | | * @return Integer |
| | | */ |
| | | Integer create(InoutRecord inoutRecord); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(Integer id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param inoutRecord å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(InoutRecord inoutRecord); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<Integer> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param inoutRecord å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(InoutRecord inoutRecord); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param inoutRecords å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<InoutRecord> inoutRecords); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return InoutRecord |
| | | */ |
| | | InoutRecord findById(Integer id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param inoutRecord å®ä½å¯¹è±¡ |
| | | * @return InoutRecord |
| | | */ |
| | | InoutRecord findOne(InoutRecord inoutRecord); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param inoutRecord å®ä½å¯¹è±¡ |
| | | * @return List<InoutRecord> |
| | | */ |
| | | List<InoutRecord> findList(InoutRecord inoutRecord); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<InoutRecord> |
| | | */ |
| | | PageData<InoutRecord> findPage(PageWrap<InoutRecord> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param inoutRecord å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(InoutRecord inoutRecord); |
| | | } |
| | |
| | | @Override |
| | | public HiddenDangerDataVO hiddenDangerData(HiddenDanger hiddenDanger){ |
| | | HiddenDangerDataVO hiddenDangerDataVO = new HiddenDangerDataVO(); |
| | | List<HiddenDanger> hiddenDangerAllList = hiddenDangerMapper.selectJoinList(HiddenDanger.class, |
| | | List<HiddenDanger> hiddenDangerYearList = hiddenDangerMapper.selectJoinList(HiddenDanger.class, |
| | | new MPJLambdaWrapper<HiddenDanger>() |
| | | .selectAll(HiddenDanger.class) |
| | | .selectAs(HiddenDangerParam::getCompanyId, HiddenDanger::getAreaCompanyId) |
| | | .leftJoin(HiddenDangerParam.class,HiddenDangerParam::getId,HiddenDanger::getAreaId) //鿣åºå |
| | | .eq(HiddenDanger::getIsdeleted,Constants.ZERO) |
| | | .eq(Objects.nonNull(hiddenDanger.getStatus()),HiddenDanger::getStatus,hiddenDanger.getStatus()) |
| | | .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y') = DATE_FORMAT(now(), '%Y') ) ") |
| | | .ge(Objects.nonNull(hiddenDanger.getQueryStartTime()), HiddenDanger::getCreateDate,hiddenDanger.getQueryStartTime()) |
| | | .le(Objects.nonNull(hiddenDanger.getQueryEndTime()),HiddenDanger::getCreateDate,hiddenDanger.getQueryEndTime()) |
| | | ); |
| | | List<GeneralDataVO> yearDataList = new ArrayList<>(); |
| | | if(CollectionUtils.isEmpty(hiddenDangerYearList)){ |
| | | return hiddenDangerDataVO; |
| | | } |
| | | for (int i = 1; i <=12 ; i++) { |
| | | GeneralDataVO generalDataVO = new GeneralDataVO(); |
| | | generalDataVO.setName(Integer.toString(i)); |
| | | generalDataVO.setTotal(hiddenDangerYearList.stream().filter(j->Constants.equalsInteger(Integer.valueOf(generalDataVO.getName()),Integer.valueOf(DateUtil.formatDate(j.getCreateDate(),"MM")))).collect(Collectors.toList()).size()); |
| | | yearDataList.add(generalDataVO); |
| | | } |
| | | hiddenDangerDataVO.setYearList(yearDataList); |
| | | |
| | | List<HiddenDanger> hiddenDangerAllList = hiddenDangerYearList.stream().filter(i->DateUtil.formatDate(i.getCreateDate(),"yyyy-MM-dd").equals(DateUtil.formatDate(new Date(),"yyyy-MM-dd"))).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(hiddenDangerAllList)){ |
| | | return hiddenDangerDataVO; |
| | | } |
| | | |
| | | |
| | | hiddenDangerDataVO.setTotal(hiddenDangerAllList.size()); |
| | | hiddenDangerDataVO.setWaitDeal(hiddenDangerAllList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ZERO)).collect(Collectors.toList()).size()); |
| | | hiddenDangerDataVO.setBack(hiddenDangerAllList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.TWO)).collect(Collectors.toList()).size()); |
| | | hiddenDangerDataVO.setDealFinish(hiddenDangerAllList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)).collect(Collectors.toList()).size()); |
| | | hiddenDangerDataVO.setTodayNew(hiddenDangerAllList.stream().filter(i->DateUtil.formatDate(i.getCreateDate(),"yyyy-MM-dd").equals(DateUtil.formatDate(new Date(),"yyyy-MM-dd"))).collect(Collectors.toList()).size()); |
| | | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(hiddenDangerAllList)){ |
| | | List<Integer> cateList = hiddenDangerAllList.stream().map(i->i.getCateId()).collect(Collectors.toList()); |
| | | //å
¨é¨éæ£åç±»æ°æ® |
| | |
| | | } |
| | | hiddenDangerDataVO.setDepartmentList(companyGeneralDataList); |
| | | } |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(hiddenDangerDataVO.getDepartmentList())){ |
| | | List<GeneralDataVO> topList = hiddenDangerDataVO.getDepartmentList(); |
| | | Collections.sort(topList, new Comparator<GeneralDataVO>() { |
| | | @Override |
| | | public int compare(GeneralDataVO o1, GeneralDataVO o2) { |
| | | // è¿åå¼ä¸ºintç±»åï¼å¤§äº0表示æ£åºï¼å°äº0表示éåº |
| | | return o2.getTotal() - o1.getTotal(); |
| | | } |
| | | }); |
| | | hiddenDangerDataVO.setDepartmentSortList(topList); |
| | | } |
| | | } |
| | | |
| | | return hiddenDangerDataVO; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.InoutRecordMapper; |
| | | import com.doumee.dao.business.model.InoutRecord; |
| | | import com.doumee.service.business.InoutRecordService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åºå
¥åºäººæ¬¡è½¦æ¬¡æ¯æ¥ç»è®¡è¡¨Serviceå®ç° |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/04/28 16:19 |
| | | */ |
| | | @Service |
| | | public class InoutRecordServiceImpl implements InoutRecordService { |
| | | |
| | | @Autowired |
| | | private InoutRecordMapper inoutRecordMapper; |
| | | |
| | | @Override |
| | | public Integer create(InoutRecord inoutRecord) { |
| | | inoutRecordMapper.insert(inoutRecord); |
| | | return inoutRecord.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | inoutRecordMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(InoutRecord inoutRecord) { |
| | | UpdateWrapper<InoutRecord> deleteWrapper = new UpdateWrapper<>(inoutRecord); |
| | | inoutRecordMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | inoutRecordMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(InoutRecord inoutRecord) { |
| | | inoutRecordMapper.updateById(inoutRecord); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<InoutRecord> inoutRecords) { |
| | | if (CollectionUtils.isEmpty(inoutRecords)) { |
| | | return; |
| | | } |
| | | for (InoutRecord inoutRecord: inoutRecords) { |
| | | this.updateById(inoutRecord); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public InoutRecord findById(Integer id) { |
| | | return inoutRecordMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public InoutRecord findOne(InoutRecord inoutRecord) { |
| | | QueryWrapper<InoutRecord> wrapper = new QueryWrapper<>(inoutRecord); |
| | | return inoutRecordMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<InoutRecord> findList(InoutRecord inoutRecord) { |
| | | QueryWrapper<InoutRecord> wrapper = new QueryWrapper<>(inoutRecord); |
| | | return inoutRecordMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<InoutRecord> findPage(PageWrap<InoutRecord> pageWrap) { |
| | | IPage<InoutRecord> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(InoutRecord::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(InoutRecord::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(InoutRecord::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(InoutRecord::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getRemark() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getRemark, pageWrap.getModel().getRemark()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getHkEventId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getHkEventId, pageWrap.getModel().getHkEventId()); |
| | | } |
| | | if (pageWrap.getModel().getHkId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getHkId, pageWrap.getModel().getHkId()); |
| | | } |
| | | if (pageWrap.getModel().getMemberId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberId, pageWrap.getModel().getMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getCarId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarId, pageWrap.getModel().getCarId()); |
| | | } |
| | | if (pageWrap.getModel().getCategoryId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCategoryId, pageWrap.getModel().getCategoryId()); |
| | | } |
| | | if (pageWrap.getModel().getCategoryName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCategoryName, pageWrap.getModel().getCategoryName()); |
| | | } |
| | | if (pageWrap.getModel().getCarBizType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarBizType, pageWrap.getModel().getCarBizType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberType, pageWrap.getModel().getMemberType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberName, pageWrap.getModel().getMemberName()); |
| | | } |
| | | if (pageWrap.getModel().getCarCode() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarCode, pageWrap.getModel().getCarCode()); |
| | | } |
| | | if (pageWrap.getModel().getObjType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getObjType, pageWrap.getModel().getObjType()); |
| | | } |
| | | if (pageWrap.getModel().getObjId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getObjId, pageWrap.getModel().getObjId()); |
| | | } |
| | | if (pageWrap.getModel().getInOrOut() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getInOrOut, pageWrap.getModel().getInOrOut()); |
| | | } |
| | | if (pageWrap.getModel().getDeviceName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getDeviceName, pageWrap.getModel().getDeviceName()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(inoutRecordMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public long count(InoutRecord inoutRecord) { |
| | | QueryWrapper<InoutRecord> wrapper = new QueryWrapper<>(inoutRecord); |
| | | return inoutRecordMapper.selectCount(wrapper); |
| | | } |
| | | } |