feat: 科室设备经营分析功能
							parent
							
								
									01225469b4
								
							
						
					
					
						commit
						2f58a0d25b
					
				| @ -0,0 +1,131 @@ | |||||||
|  | package com.glxp.api.controller.dev; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | import cn.hutool.json.JSONUtil; | ||||||
|  | import com.github.pagehelper.PageInfo; | ||||||
|  | import com.glxp.api.annotation.AuthRuleAnnotation; | ||||||
|  | import com.glxp.api.common.enums.ResultEnum; | ||||||
|  | import com.glxp.api.common.res.BaseResponse; | ||||||
|  | import com.glxp.api.common.util.ResultVOUtils; | ||||||
|  | import com.glxp.api.controller.BaseController; | ||||||
|  | import com.glxp.api.entity.auth.AuthAdmin; | ||||||
|  | import com.glxp.api.entity.auth.InvBusUserEntity; | ||||||
|  | import com.glxp.api.entity.auth.InvWarehouseEntity; | ||||||
|  | import com.glxp.api.entity.auth.WarehouseUserEntity; | ||||||
|  | import com.glxp.api.entity.dev.DeviceBusinessProject; | ||||||
|  | import com.glxp.api.entity.dev.DeviceBusinessProjectDevice; | ||||||
|  | import com.glxp.api.entity.dev.DeviceInfoEntity; | ||||||
|  | import com.glxp.api.req.dev.DeviceBusinessProjectRequest; | ||||||
|  | import com.glxp.api.req.dev.DeviceCheckQuery; | ||||||
|  | import com.glxp.api.res.PageSimpleResponse; | ||||||
|  | import com.glxp.api.service.thrsys.DeviceBusinessProjectDeviceService; | ||||||
|  | import com.glxp.api.service.thrsys.DeviceBusinessProjectService; | ||||||
|  | import com.glxp.api.vo.dev.DeviceCheckVo; | ||||||
|  | import com.glxp.api.vo.dev.DeviceInfoVo; | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||||
|  | import org.springframework.web.bind.annotation.RequestMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.lang.reflect.Array; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | @RestController | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | @Slf4j | ||||||
|  | @RequestMapping | ||||||
|  | public class DeviceBusinessProjectController extends BaseController { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     DeviceBusinessProjectService deviceBusinessProjectService; | ||||||
|  |     @Resource | ||||||
|  |     DeviceBusinessProjectDeviceService deviceBusinessProjectDeviceService; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 分组查询收费项目接口 | ||||||
|  |      * | ||||||
|  |      * @param query | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @PostMapping("/udi/device/businessProject/page") | ||||||
|  |     public BaseResponse page(@RequestBody DeviceBusinessProjectRequest query) { | ||||||
|  |         List<DeviceBusinessProject> list = deviceBusinessProjectService.pageList(query); | ||||||
|  |         PageInfo pageInfo = new PageInfo<>(list); | ||||||
|  |         PageSimpleResponse page = new PageSimpleResponse(); | ||||||
|  |         page.setTotal(pageInfo.getTotal()); | ||||||
|  |         page.setList(pageInfo.getList()); | ||||||
|  |         return ResultVOUtils.success(page); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询收费项目下的设备明细接口 | ||||||
|  |      * | ||||||
|  |      * @param query | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @PostMapping("/udi/device/businessProject/detailList") | ||||||
|  |     public BaseResponse detailList(@RequestBody DeviceBusinessProjectRequest query) { | ||||||
|  |         List<DeviceInfoVo> list = deviceBusinessProjectDeviceService.detailList(query); | ||||||
|  |         PageInfo pageInfo = new PageInfo<>(list); | ||||||
|  |         PageSimpleResponse page = new PageSimpleResponse(); | ||||||
|  |         page.setTotal(pageInfo.getTotal()); | ||||||
|  |         page.setList(pageInfo.getList()); | ||||||
|  |         return ResultVOUtils.success(page); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询收费项目下可进行绑定的设备列表接口 | ||||||
|  |      * | ||||||
|  |      * @param query | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @PostMapping("/udi/device/businessProject/selectNotSelectDevice") | ||||||
|  |     public BaseResponse selectNotSelectDevice(@RequestBody DeviceBusinessProjectRequest query) { | ||||||
|  |         List<DeviceInfoVo> list = deviceBusinessProjectDeviceService.selectNotSelectDevice(query); | ||||||
|  |         PageInfo pageInfo = new PageInfo<>(list); | ||||||
|  |         PageSimpleResponse page = new PageSimpleResponse(); | ||||||
|  |         page.setTotal(pageInfo.getTotal()); | ||||||
|  |         page.setList(pageInfo.getList()); | ||||||
|  |         return ResultVOUtils.success(page); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @PostMapping("/udi/device/businessProject/addDeviceProject") | ||||||
|  |     public BaseResponse addDeviceProject(@RequestBody Map<String, Object> params) { | ||||||
|  |         String sfxm = String.valueOf(params.get("sfxm")); | ||||||
|  |         List<String> userListJson = (List<String>) params.get("deviceList"); | ||||||
|  |         if (StrUtil.isBlank(sfxm) || CollUtil.isEmpty(userListJson)) | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); | ||||||
|  | 
 | ||||||
|  |         deviceBusinessProjectDeviceService.addDeviceProject(sfxm, userListJson); | ||||||
|  |         return ResultVOUtils.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @AuthRuleAnnotation("") | ||||||
|  |     @PostMapping("/udi/device/businessProject/deleteDeviceProject") | ||||||
|  |     public BaseResponse deleteDeviceProject(@RequestBody DeviceBusinessProjectDevice deviceBusinessProjectDevice) { | ||||||
|  |         if (null == deviceBusinessProjectDevice || deviceBusinessProjectDevice.getDeviceCode() == null) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); | ||||||
|  |         deviceBusinessProjectDeviceService.deleteDeviceProject(deviceBusinessProjectDevice.getDeviceCode()); | ||||||
|  |         return ResultVOUtils.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | package com.glxp.api.dao.dev; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||||
|  | import com.glxp.api.entity.dev.DeviceBusinessProjectDevice; | ||||||
|  | import com.glxp.api.entity.dev.DeviceInfoEntity; | ||||||
|  | import com.glxp.api.req.dev.DeviceBusinessProjectRequest; | ||||||
|  | import com.glxp.api.vo.dev.DeviceInfoVo; | ||||||
|  | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | import org.apache.ibatis.annotations.Param; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Mapper | ||||||
|  | public interface DeviceBusinessProjectDeviceMapper extends BaseMapper<DeviceBusinessProjectDevice> { | ||||||
|  |     List<DeviceInfoVo> detailList(DeviceBusinessProjectRequest sfxm); | ||||||
|  | 
 | ||||||
|  |     List<DeviceInfoVo> selectNotSelectDevice(DeviceBusinessProjectRequest query); | ||||||
|  | } | ||||||
| @ -0,0 +1,16 @@ | |||||||
|  | package com.glxp.api.dao.dev; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||||
|  | import com.glxp.api.entity.dev.DeviceBusinessProject; | ||||||
|  | import com.glxp.api.req.dev.DeviceBusinessProjectRequest; | ||||||
|  | import com.glxp.api.req.dev.DeviceCheckQuery; | ||||||
|  | import com.glxp.api.vo.dev.DeviceCheckVo; | ||||||
|  | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Mapper | ||||||
|  | public interface DeviceBusinessProjectMapper extends BaseMapper<DeviceBusinessProject> { | ||||||
|  | 
 | ||||||
|  |     List<DeviceBusinessProject> pageVo(DeviceBusinessProjectRequest query); | ||||||
|  | } | ||||||
| @ -0,0 +1,124 @@ | |||||||
|  | package com.glxp.api.entity.dev; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.IdType; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | import java.util.Date; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @ApiModel(value="com-glxp-api-entity-dev-DeviceBusinessProject") | ||||||
|  | @Data | ||||||
|  | @TableName(value = "device_business_project") | ||||||
|  | public class DeviceBusinessProject implements Serializable { | ||||||
|  |     @TableId(value = "id", type = IdType.AUTO) | ||||||
|  |     @ApiModelProperty(value="") | ||||||
|  |     private Long id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "chargTime") | ||||||
|  |     @ApiModelProperty(value="收费时间") | ||||||
|  |     private Date chargTime; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费项目 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "sfxm") | ||||||
|  |     @ApiModelProperty(value="收费项目") | ||||||
|  |     private String sfxm; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费名称 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "sfmc") | ||||||
|  |     @ApiModelProperty(value="收费名称") | ||||||
|  |     private String sfmc; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费金额 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "je") | ||||||
|  |     @ApiModelProperty(value="收费金额") | ||||||
|  |     private BigDecimal je; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费mz | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "sfmz") | ||||||
|  |     @ApiModelProperty(value="收费mz") | ||||||
|  |     private String sfmz; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 当前部门编码 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "deptCode") | ||||||
|  |     @ApiModelProperty(value="当前部门编码") | ||||||
|  |     private String deptCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 当前部门编码 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "deptName") | ||||||
|  |     @ApiModelProperty(value="当前部门编码") | ||||||
|  |     private String deptName; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 创建人 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "createUser") | ||||||
|  |     @ApiModelProperty(value="创建人") | ||||||
|  |     private String createUser; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 创建时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "createTime") | ||||||
|  |     @ApiModelProperty(value="创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新人 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "updateUser") | ||||||
|  |     @ApiModelProperty(value="更新人") | ||||||
|  |     private String updateUser; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "updateTime") | ||||||
|  |     @ApiModelProperty(value="更新时间") | ||||||
|  |     private Date updateTime; | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_ID = "id"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_CHARGTIME = "chargTime"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_SFXM = "sfxm"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_SFMC = "sfmc"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_JE = "je"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_SFMZ = "sfmz"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_DEPTCODE = "deptCode"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_DEPTNAME = "deptName"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_CREATEUSER = "createUser"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_CREATETIME = "createTime"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_UPDATEUSER = "updateUser"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_UPDATETIME = "updateTime"; | ||||||
|  | } | ||||||
| @ -0,0 +1,52 @@ | |||||||
|  | package com.glxp.api.entity.dev; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.IdType; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.util.Date; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |     * 设备收费项目-设备关联表 | ||||||
|  |     */ | ||||||
|  | @ApiModel(value="com-glxp-api-entity-dev-DeviceBusinessProjectDevice") | ||||||
|  | @Data | ||||||
|  | @TableName(value = "device_business_project_device") | ||||||
|  | public class DeviceBusinessProjectDevice implements Serializable { | ||||||
|  | 
 | ||||||
|  |     @TableId(value = "id", type = IdType.AUTO) | ||||||
|  |     @ApiModelProperty(value="") | ||||||
|  |     private Long id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 设备编码 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "deviceCode") | ||||||
|  |     @ApiModelProperty(value="设备编码") | ||||||
|  |     private String deviceCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费项目 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "sfxm") | ||||||
|  |     @ApiModelProperty(value="收费项目") | ||||||
|  |     private String sfxm; | ||||||
|  | 
 | ||||||
|  |     @TableField(value = "updateTime") | ||||||
|  |     @ApiModelProperty(value="") | ||||||
|  |     private Date updateTime; | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_ID = "id"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_DEVICECODE = "deviceCode"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_SFXM = "sfxm"; | ||||||
|  | 
 | ||||||
|  |     public static final String COL_UPDATETIME = "updateTime"; | ||||||
|  | } | ||||||
| @ -0,0 +1,99 @@ | |||||||
|  | package com.glxp.api.req.dev; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.IdType; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class DeviceBusinessProjectRequest extends ListPageRequest { | ||||||
|  |     @TableId(value = "id", type = IdType.AUTO) | ||||||
|  |     @ApiModelProperty(value="") | ||||||
|  |     private Long id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "chargTime") | ||||||
|  |     @ApiModelProperty(value="收费时间") | ||||||
|  |     private Date chargTime; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费项目 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "sfxm") | ||||||
|  |     @ApiModelProperty(value="收费项目") | ||||||
|  |     private String sfxm; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费名称 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "sfmc") | ||||||
|  |     @ApiModelProperty(value="收费名称") | ||||||
|  |     private String sfmc; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费金额 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "je") | ||||||
|  |     @ApiModelProperty(value="收费金额") | ||||||
|  |     private BigDecimal je; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 收费mz | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "sfmz") | ||||||
|  |     @ApiModelProperty(value="收费mz") | ||||||
|  |     private String sfmz; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 当前部门编码 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "deptCode") | ||||||
|  |     @ApiModelProperty(value="当前部门编码") | ||||||
|  |     private String deptCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 当前部门编码 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "deptName") | ||||||
|  |     @ApiModelProperty(value="当前部门编码") | ||||||
|  |     private String deptName; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 创建人 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "createUser") | ||||||
|  |     @ApiModelProperty(value="创建人") | ||||||
|  |     private String createUser; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 创建时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "createTime") | ||||||
|  |     @ApiModelProperty(value="创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新人 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "updateUser") | ||||||
|  |     @ApiModelProperty(value="更新人") | ||||||
|  |     private String updateUser; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "updateTime") | ||||||
|  |     @ApiModelProperty(value="更新时间") | ||||||
|  |     private Date updateTime; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private String key; | ||||||
|  | } | ||||||
| @ -0,0 +1,62 @@ | |||||||
|  | package com.glxp.api.service.thrsys; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.entity.dev.DeviceBusinessProject; | ||||||
|  | import com.glxp.api.entity.dev.DeviceInfoEntity; | ||||||
|  | import com.glxp.api.exception.JsonException; | ||||||
|  | import com.glxp.api.req.dev.DeviceBusinessProjectRequest; | ||||||
|  | import com.glxp.api.vo.dev.DeviceInfoVo; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.List; | ||||||
|  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
|  | import com.glxp.api.entity.dev.DeviceBusinessProjectDevice; | ||||||
|  | import com.glxp.api.dao.dev.DeviceBusinessProjectDeviceMapper; | ||||||
|  | @Service | ||||||
|  | public class DeviceBusinessProjectDeviceService extends ServiceImpl<DeviceBusinessProjectDeviceMapper, DeviceBusinessProjectDevice> { | ||||||
|  | 
 | ||||||
|  |     public List<DeviceInfoVo> detailList(DeviceBusinessProjectRequest query) { | ||||||
|  |         if (query == null || StrUtil.isEmpty(query.getSfxm())){ | ||||||
|  |             throw new JsonException("收费项目编码不可为空"); | ||||||
|  |         } | ||||||
|  |         if (query.getPage() != null) { | ||||||
|  |             PageHelper.startPage(query.getPage(), query.getLimit()); | ||||||
|  |         } | ||||||
|  |         List<DeviceInfoVo> list = this.baseMapper.detailList(query); | ||||||
|  |         return list; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public List<DeviceInfoVo> selectNotSelectDevice(DeviceBusinessProjectRequest query) { | ||||||
|  |         if (query == null || StrUtil.isEmpty(query.getSfxm())){ | ||||||
|  |             throw new JsonException("收费项目编码不可为空"); | ||||||
|  |         } | ||||||
|  |         if (query.getPage() != null) { | ||||||
|  |             PageHelper.startPage(query.getPage(), query.getLimit()); | ||||||
|  |         } | ||||||
|  |         List<DeviceInfoVo> list = this.baseMapper.selectNotSelectDevice(query); | ||||||
|  |         return list; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void addDeviceProject(String sfxm, List<String> userList) { | ||||||
|  |         if (CollUtil.isNotEmpty(userList)){ | ||||||
|  |             List<DeviceBusinessProjectDevice> objects = new ArrayList<>(); | ||||||
|  |             for (int i = 0; i < userList.size(); i++) { | ||||||
|  |                 String s = userList.get(i); | ||||||
|  |                 DeviceBusinessProjectDevice deviceBusinessProjectDevice = new DeviceBusinessProjectDevice(); | ||||||
|  |                 deviceBusinessProjectDevice.setSfxm(sfxm); | ||||||
|  |                 deviceBusinessProjectDevice.setDeviceCode(s); | ||||||
|  |                 objects.add(deviceBusinessProjectDevice); | ||||||
|  |             } | ||||||
|  |             this.saveBatch(objects); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public void deleteDeviceProject(String getDeviceCode) { | ||||||
|  |         remove(new LambdaQueryWrapper<DeviceBusinessProjectDevice>().eq(DeviceBusinessProjectDevice::getDeviceCode,getDeviceCode)); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | package com.glxp.api.service.thrsys; | ||||||
|  | 
 | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.req.dev.DeviceBusinessProjectRequest; | ||||||
|  | import com.glxp.api.vo.dev.DeviceCheckVo; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.List; | ||||||
|  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
|  | import com.glxp.api.dao.dev.DeviceBusinessProjectMapper; | ||||||
|  | import com.glxp.api.entity.dev.DeviceBusinessProject; | ||||||
|  | @Service | ||||||
|  | public class DeviceBusinessProjectService extends ServiceImpl<DeviceBusinessProjectMapper, DeviceBusinessProject> { | ||||||
|  | 
 | ||||||
|  |     public List<DeviceBusinessProject> pageList(DeviceBusinessProjectRequest query) { | ||||||
|  |         if (query.getPage() != null) { | ||||||
|  |             PageHelper.startPage(query.getPage(), query.getLimit()); | ||||||
|  |         } | ||||||
|  |         List<DeviceBusinessProject> list = this.baseMapper.pageVo(query); | ||||||
|  | 
 | ||||||
|  |         return list; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,48 @@ | |||||||
|  | <?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.glxp.api.dao.dev.DeviceBusinessProjectDeviceMapper"> | ||||||
|  |   <resultMap id="BaseResultMap" type="com.glxp.api.entity.dev.DeviceBusinessProjectDevice"> | ||||||
|  |     <!--@mbg.generated--> | ||||||
|  |     <!--@Table device_business_project_device--> | ||||||
|  |     <id column="id" jdbcType="BIGINT" property="id" /> | ||||||
|  |     <result column="deviceCode" jdbcType="VARCHAR" property="deviceCode" /> | ||||||
|  |     <result column="sfxm" jdbcType="VARCHAR" property="sfxm" /> | ||||||
|  |     <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" /> | ||||||
|  |   </resultMap> | ||||||
|  |   <sql id="Base_Column_List"> | ||||||
|  |     <!--@mbg.generated--> | ||||||
|  |     id, deviceCode, sfxm, updateTime | ||||||
|  |   </sql> | ||||||
|  | 
 | ||||||
|  |     <select id="detailList" resultType="com.glxp.api.vo.dev.DeviceInfoVo"> | ||||||
|  |         select di.* | ||||||
|  |         from device_business_project_device | ||||||
|  |                      left join device_info di on di.deviceCode = device_business_project_device.deviceCode | ||||||
|  |         <where> | ||||||
|  |             <if test="sfxm != null and sfxm != ''"> | ||||||
|  |                 AND sfxm like concat('%', #{sfxm}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="key != null and key != ''"> | ||||||
|  |                 AND ( | ||||||
|  |                         deviceCode like concat('%', #{key}, '%') OR productName like concat('%', #{key}, '%') | ||||||
|  |                         ) | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |         order by createTime desc | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <select id="selectNotSelectDevice" resultType="com.glxp.api.vo.dev.DeviceInfoVo"> | ||||||
|  |         select device_info.* | ||||||
|  |         from device_info | ||||||
|  |         left join device_business_project_device on device_info.deviceCode = device_business_project_device.deviceCode | ||||||
|  |         <where> | ||||||
|  |           AND sfxm is null | ||||||
|  |             <if test="key != null and key != ''"> | ||||||
|  |                 AND ( | ||||||
|  |                         deviceCode like concat('%', #{key}, '%') OR productName like concat('%', #{key}, '%') | ||||||
|  |                         ) | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |         order by createTime desc | ||||||
|  |     </select> | ||||||
|  | </mapper> | ||||||
| @ -0,0 +1,41 @@ | |||||||
|  | <?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.glxp.api.dao.dev.DeviceBusinessProjectMapper"> | ||||||
|  |   <resultMap id="BaseResultMap" type="com.glxp.api.entity.dev.DeviceBusinessProject"> | ||||||
|  |     <!--@mbg.generated--> | ||||||
|  |     <!--@Table device_business_project--> | ||||||
|  |     <id column="id" jdbcType="BIGINT" property="id" /> | ||||||
|  |     <result column="chargTime" jdbcType="TIMESTAMP" property="chargTime" /> | ||||||
|  |     <result column="sfxm" jdbcType="VARCHAR" property="sfxm" /> | ||||||
|  |     <result column="sfmc" jdbcType="VARCHAR" property="sfmc" /> | ||||||
|  |     <result column="je" jdbcType="DECIMAL" property="je" /> | ||||||
|  |     <result column="sfmz" jdbcType="VARCHAR" property="sfmz" /> | ||||||
|  |     <result column="deptCode" jdbcType="VARCHAR" property="deptCode" /> | ||||||
|  |     <result column="deptName" jdbcType="VARCHAR" property="deptName" /> | ||||||
|  |     <result column="createUser" jdbcType="VARCHAR" property="createUser" /> | ||||||
|  |     <result column="createTime" jdbcType="TIMESTAMP" property="createTime" /> | ||||||
|  |     <result column="updateUser" jdbcType="VARCHAR" property="updateUser" /> | ||||||
|  |     <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" /> | ||||||
|  |   </resultMap> | ||||||
|  |   <sql id="Base_Column_List"> | ||||||
|  |     <!--@mbg.generated--> | ||||||
|  |     id, chargTime, sfxm, sfmc, je, sfmz, deptCode, deptName, `createUser`, createTime,  | ||||||
|  |     updateUser, updateTime | ||||||
|  |   </sql> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |    <select id="pageVo" resultType="com.glxp.api.entity.dev.DeviceBusinessProject"> | ||||||
|  |         select sfxm,sfmc | ||||||
|  |         from device_business_project | ||||||
|  |         <where> | ||||||
|  |             <if test="sfmc != null and sfmc != ''"> | ||||||
|  |                 AND sfmc like concat('%', #{sfmc}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="deptName != null and deptName != ''"> | ||||||
|  |                 AND deptName like concat('%', #{deptName}, '%') | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |         group by sfxm,sfmc | ||||||
|  |         order by createTime desc | ||||||
|  |     </select> | ||||||
|  | </mapper> | ||||||
					Loading…
					
					
				
		Reference in New Issue