已删除12个文件
已添加12个文件
已修改34个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 14:45 |
| | | */ |
| | | @Data |
| | | public class DeviceIotParam { |
| | | |
| | | private String id; |
| | | |
| | | private String companyId; |
| | | |
| | | private String deptId; |
| | | |
| | | private String serId; |
| | | |
| | | private String depotId; |
| | | |
| | | private String type; |
| | | |
| | | } |
| | |
| | | |
| | | private String id; |
| | | |
| | | private String companyId; |
| | | |
| | | private String deptId; |
| | | |
| | | private String name; |
| | | |
| | | private String depotId; |
| | | |
| | | private String key;//èªå®ä¹å
³é®å |
| | | |
| | | private Date start; |
| | |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @Transient |
| | | private String playAddr;//è§é¢ææ¾å°åï¼æ ¹æ®ä¸åçææ¾æ¹å¼çæä¸åçææ¾å°å |
| | | |
| | | @Transient |
| | | private String playIframe;//æµåªä½Iframeææ¾å°å |
| | | |
| | | @Transient |
| | | private String msg; |
| | | } |
| | |
| | | @TableField("food_level") |
| | | private String foodLevel; |
| | | |
| | | @Column(name = "food_locationId", columnDefinition = "varchar(40) COMMENT 'ç²®é£äº§å°'") |
| | | @TableField("food_locationId") |
| | | @Column(name = "food_location_id", columnDefinition = "varchar(40) COMMENT 'ç²®é£äº§å°'") |
| | | @TableField("food_location_id") |
| | | private String foodLocationId; |
| | | |
| | | @Column(name = "food_location", columnDefinition = "varchar(40) COMMENT 'ç²®é£äº§å°'") |
| | |
| | | @TableField("order_num") |
| | | private Integer orderNum = 1; |
| | | |
| | | // ------------å
¶ä»å±æ§ä¿¡æ¯------------// |
| | | @Transient |
| | | private String foodVarietyName; |
| | | |
| | | @Transient |
| | | private String foodTypeName; |
| | | |
| | | @Transient |
| | | private String depotTypeName; |
| | | |
| | | @Transient |
| | | private String depotStatusName; |
| | | |
| | | @Transient |
| | | private String foodLevelName; |
| | | |
| | | @Transient |
| | | private String storeKeeperLevel = "é«çº§ä¿ç®¡å"; |
| | | |
| | | @Transient |
| | | private String storeKeeperPhone = "####"; |
| | | |
| | | public String getFoodLevelName() { |
| | | if (null != this.foodLevel) { |
| | | return FoodLevel.getMsg(this.foodLevel); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getFoodVarietyName() { |
| | | if (null != this.foodVariety) { |
| | | return FoodVariety.getMsg(this.foodVariety); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getFoodTypeName() { |
| | | if (null != this.foodType) { |
| | | return FoodType.getMsg(this.foodType); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getDepotTypeName() { |
| | | if (null != this.depotType) { |
| | | return DepotType.getMsg(this.depotType); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getDepotStatusName() { |
| | | if (null != this.depotStatus) { |
| | | return DepotStatus.getMsg(this.depotStatus); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | @TableField("is_only_th") |
| | | private String isOnlyTH = Constant.YN_N; |
| | | |
| | | // ä»åºåç§° |
| | | @Transient |
| | | private String depotName; |
| | | |
| | | //ä»åºç±»å |
| | | @Transient |
| | | private String depotType; |
| | | |
| | | } |
| | |
| | | @TableField("file_name") |
| | | private String imgName; |
| | | |
| | | //é¸ç°å¾å
¨è·¯å¾ |
| | | @Transient |
| | | private String imgPath; |
| | | |
| | | } |
| | |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | //å¼å¸¸ä¿¡æ¯ |
| | | @Transient |
| | | private String errorMsg; |
| | | |
| | | |
| | | public InoutConf() { |
| | | super(); |
| | | } |
| | |
| | | this.snapType = conf.getSnapType(); |
| | | this.mediaAddr = conf.getMediaAddr(); |
| | | this.remark = conf.getRemark(); |
| | | this.errorMsg = conf.getErrorMsg(); |
| | | } |
| | | |
| | | public InoutConf(String sort) { |
| | |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @Transient |
| | | private String playAddr;//è§é¢ææ¾å°åï¼æ ¹æ®ä¸åçææ¾æ¹å¼çæä¸åçææ¾å°å |
| | | |
| | | @Transient |
| | | private String msg; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.domain.InoutNoticeIn; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface CameraMapper extends BaseMapper<Camera> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.domain.Company; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface CoreCompanyMapper extends BaseMapper<Company> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface CoreDeptMapper extends BaseMapper<Dept> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface DepotConfMapper extends BaseMapper<DepotConf> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface DepotMapper extends BaseMapper<Depot> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.DepotStore; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface DepotStoreMapper extends BaseMapper<DepotStore> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.DeviceIot; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/28 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface DeviceIotMapper extends BaseMapper<DeviceIot> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.DeviceSer; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/29 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface DeviceSerMapper extends BaseMapper<DeviceSer> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.InoutConf; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/25 16:24 |
| | | */ |
| | | @Mapper |
| | | public interface InoutConfMapper extends BaseMapper<InoutConf> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.InoutSysConf; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/25 16:24 |
| | | */ |
| | | @Mapper |
| | | public interface InoutSysConfMapper extends BaseMapper<InoutSysConf> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.QuantityConf; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/11/29 10:48 |
| | | */ |
| | | @Mapper |
| | | public interface QuantityConfMapper extends BaseMapper<QuantityConf> { |
| | | |
| | | } |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.igds.domain.Company; |
| | | import com.fzzy.igds.repository.CompanyRepository; |
| | | import com.fzzy.igds.mapper.CoreCompanyMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | |
| | | public class CoreCompanyService { |
| | | |
| | | @Resource |
| | | private CompanyRepository companyRepository; |
| | | private CoreCompanyMapper coreCompanyMapper; |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢å
¬å¸ä¿¡æ¯ |
| | | * æ ¹æ®æ¡ä»¶æ¥è¯¢å
¬å¸ä¿¡æ¯ |
| | | * @param id |
| | | * @param companyId |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | public List<Company> getDataById(String id) { |
| | | public List<Company> listCompany(String id, String companyId, String parentId) { |
| | | |
| | | return companyRepository.getDataById(id); |
| | | QueryWrapper<Company> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if(StringUtils.isNotBlank(id)){ |
| | | queryWrapper.eq("id", id); |
| | | } |
| | | if(StringUtils.isNotBlank(companyId)){ |
| | | queryWrapper.eq("company_id", companyId); |
| | | } |
| | | if(StringUtils.isNotBlank(parentId)){ |
| | | queryWrapper.likeRight("id", parentId); |
| | | } |
| | | |
| | | return coreCompanyMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢å
¬å¸ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public List<Company> getAllData(String companyId) { |
| | | |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | return companyRepository.getAllData(companyId); |
| | | } |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢å
¬å¸ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public List<Company> getDataByParentId() { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | return companyRepository.getDataByParentId(user.getDeptId() + "%"); |
| | | } |
| | | |
| | | /** |
| | | * jpaæ°å¢å
¬å¸ä¿¡æ¯ |
| | | * æ´æ°æä¿åå
¬å¸ä¿¡æ¯ |
| | | * @param sysDept |
| | | * @param isAdd |
| | | * @return |
| | | */ |
| | | public void saveOrUpdate(SysDept sysDept) { |
| | | public void saveOrUpdate(SysDept sysDept, Boolean isAdd) { |
| | | if (null == sysDept) { |
| | | return; |
| | | } |
| | |
| | | company.setDwzt(sysDept.getStatus()); |
| | | company.setCompanyId(sysDept.getCompanyId()); |
| | | |
| | | //åå»ºä¿¡æ¯ |
| | | company.setCreateBy(ContextUtil.getLoginUserName()); |
| | | company.setCreateTime(new Date()); |
| | | |
| | | if (isAdd) { |
| | | this.save(company); |
| | | }else { |
| | | this.update(company); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * jpaæ´æ°å
¬å¸ä¿¡æ¯ |
| | | * æ°å¢å
¬å¸ä¿¡æ¯ |
| | | * @param data |
| | | */ |
| | | public void save(Company data) { |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | //æ°å¢ä¿¡æ¯ |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | |
| | | coreCompanyMapper.insert(data); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å
¬å¸ä¿¡æ¯ |
| | | * @param data |
| | | */ |
| | | public void update(Company data) { |
| | |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | |
| | | companyRepository.save(data); |
| | | coreCompanyMapper.updateById( data); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public void delData(String deptId) { |
| | | companyRepository.deleteById(deptId); |
| | | coreCompanyMapper.deleteById(deptId); |
| | | } |
| | | } |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.repository.DeptRepository; |
| | | import com.fzzy.igds.mapper.CoreDeptMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | @Resource |
| | | private ISysDeptService iSysDeptService; |
| | | @Resource |
| | | private DeptRepository deptRepository; |
| | | private CoreDeptMapper coreDeptMapper; |
| | | @Resource |
| | | private InoutConfService inoutConfService; |
| | | |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢ä¿¡æ¯ |
| | | * æ ¹æ®æ¡ä»¶æ¥è¯¢åºåºä¿¡æ¯ |
| | | * @param id |
| | | * @param companyId |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | public List<Dept> getDataByParentId(String parentId) { |
| | | return deptRepository.getDataByParentId(parentId + "%"); |
| | | public List<Dept> listDept(String id, String companyId, String parentId) { |
| | | |
| | | QueryWrapper<Dept> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if(StringUtils.isNotBlank(id)){ |
| | | queryWrapper.eq("id", id); |
| | | } |
| | | if(StringUtils.isNotBlank(companyId)){ |
| | | queryWrapper.eq("company_id", companyId); |
| | | } |
| | | if(StringUtils.isNotBlank(parentId)){ |
| | | queryWrapper.likeRight("id", parentId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public List<Dept> getAllDeptData() { |
| | | return deptRepository.getAllData(ContextUtil.getCompanyId()); |
| | | return coreDeptMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢ä¿¡æ¯ |
| | | * æ¥è¯¢ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public List<Dept> getDeptData() { |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId()); |
| | | if (Constant.DEPT_TYPE_20.equals(userDept.getType())) { |
| | | return deptRepository.getDataById(ContextUtil.subDeptId(user)); |
| | | return this.listDept(ContextUtil.subDeptId(user),null,null); |
| | | }else { |
| | | return deptRepository.getDataByParentId(user.getDeptId() + "%"); |
| | | return this.listDept(null,null,user.getDeptId() + "%"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * jpaæ°å¢åºåºä¿¡æ¯ |
| | | * æ°å¢ææ´æ°åºåºä¿¡æ¯ |
| | | * @param sysDept |
| | | * @param isAdd |
| | | * @return |
| | | */ |
| | | public void saveOrUpdate(SysDept sysDept) { |
| | | public void saveOrUpdate(SysDept sysDept, Boolean isAdd) { |
| | | if (null == sysDept) { |
| | | return; |
| | | } |
| | |
| | | dept.setKqmc(sysDept.getDeptName()); |
| | | dept.setCompanyId(sysDept.getCompanyId()); |
| | | |
| | | //åå»ºä¿¡æ¯ |
| | | dept.setCreateBy(ContextUtil.getLoginUserName()); |
| | | dept.setCreateTime(new Date()); |
| | | |
| | | if (isAdd) { |
| | | this.save(dept); |
| | | }else { |
| | | this.update(dept); |
| | | |
| | | //çæåºå
¥åºæµç¨é
ç½®ä¿¡æ¯ |
| | | inoutConfService.initSysConfData(sysDept.getCompanyId(), dept.getId()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * jpaæ´æ°åºåºä¿¡æ¯ |
| | | * ä¿ååºåºä¿¡æ¯ |
| | | * @param data |
| | | */ |
| | | public void save(Dept data) { |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | //åå»ºä¿¡æ¯ |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | |
| | | coreDeptMapper.insert(data); |
| | | |
| | | //åå§ååºå
¥åºæµç¨é
ç½®ä¿¡æ¯ |
| | | inoutConfService.initSysConfData(data.getCompanyId(), data.getId()); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°åºåºä¿¡æ¯ |
| | | * @param data |
| | | */ |
| | | public void update(Dept data) { |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | //æ´æ°ä¿¡æ¯ |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | |
| | | deptRepository.save(data); |
| | | coreDeptMapper.updateById(data); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public void delData(String deptId) { |
| | | //å é¤åºåºä¿¡æ¯ |
| | | deptRepository.deleteById(deptId); |
| | | coreDeptMapper.deleteById(deptId); |
| | | |
| | | //å 餿µç¨é
ç½®ä¿¡æ¯ |
| | | inoutConfService.delSysConfData(deptId); |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import com.fzzy.igds.repository.DepotConfRepository; |
| | | import com.fzzy.igds.mapper.DepotConfMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | public class DepotConfService { |
| | | |
| | | @Resource |
| | | private DepotConfRepository depotConfRepository; |
| | | private DepotConfMapper depotConfMapper; |
| | | @Resource |
| | | private DepotService depotService; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢é
ç½®ä¿¡æ¯ |
| | | * æ¥è¯¢é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | deptId = ContextUtil.subDeptId(null); |
| | | QueryWrapper<DepotConf> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("company_id", companyId); |
| | | |
| | | if(StringUtils.isNotBlank(deptId)){ |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | return depotConfRepository.getDepotConf(companyId, deptId); |
| | | return depotConfMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * jpaæ´æ°ä¿åé
ç½®ä¿¡æ¯ |
| | | * æ´æ°ä¿åé
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param conf |
| | | */ |
| | |
| | | } |
| | | if (StringUtils.isEmpty(conf.getDeptId())) { |
| | | conf.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | if (null == conf.getUpdateBy()) { |
| | | conf.setCreateBy(ContextUtil.getLoginUserName()); |
| | | conf.setCreateTime(new Date()); |
| | | } |
| | | |
| | | conf.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | conf.setUpdateTime(new Date()); |
| | | depotConfRepository.save(conf); |
| | | depotConfMapper.insert(conf); |
| | | }else { |
| | | conf.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | conf.setUpdateTime(new Date()); |
| | | depotConfMapper.updateById(conf); |
| | | } |
| | | flushConfCache(conf.getCompanyId()); |
| | | } |
| | | |
| | | /** |
| | | * jpaå é¤é
ç½®ä¿¡æ¯ |
| | | * å é¤é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param conf |
| | | * @return |
| | | */ |
| | | public void deleteDepotConf(DepotConf conf) { |
| | | depotConfRepository.delete(conf); |
| | | depotConfMapper.deleteById( conf); |
| | | |
| | | //å é¤é
ç½®ç¼å |
| | | this.delCacheDepotConf(conf, conf.getCompanyId()); |
| | |
| | | */ |
| | | public void setCacheDepotConf(List<DepotConf> list, String companyId) { |
| | | if (null != list) { |
| | | Depot depot; |
| | | String key; |
| | | for (DepotConf depotConf : list) { |
| | | depot = depotService.getCacheDepot(companyId, depotConf.getDepotId()); |
| | | if (null != depot) { |
| | | depotConf.setDepotName(depot.getName()); |
| | | depotConf.setDepotType(depot.getDepotType()); |
| | | } |
| | | key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF, depotConf.getDepotId()); |
| | | redisCache.setCacheObject(key, depotConf); |
| | | } |
| | |
| | | String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF, depotId); |
| | | DepotConf depotConf = redisCache.getCacheObject(key); |
| | | if (null == depotConf) { |
| | | depotConf = depotConfRepository.getDepotConfByDepotId(companyId, depotId); |
| | | depotConf = depotConfMapper.selectById(depotId); |
| | | redisCache.setCacheObject(key, depotConf); |
| | | } |
| | | |
| | | return depotConf; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ä»åºå表ï¼èªå¨çæä»åºé
ç½®ä¿¡æ¯ |
| | | * @param companyId |
| | | */ |
| | | private void addConfByDepot(String companyId) { |
| | | List<Depot> list = depotService.getCacheDepotList(companyId); |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | DepotConf conf; |
| | | for (Depot depot : list) { |
| | | conf = new DepotConf(); |
| | | conf.setDepotId(depot.getId()); |
| | | conf.setCompanyId(depot.getCompanyId()); |
| | | conf.setDeptId(depot.getDeptId()); |
| | | this.saveConf(conf); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | |
| | | List<DepotConf> list = depotConfRepository.getDepotConfByCompanyId(companyId); |
| | | List<DepotConf> list = this.getConfList(companyId, null); |
| | | |
| | | this.setCacheDepotConf(list, companyId); |
| | | } |
| | |
| | | * @param freq |
| | | */ |
| | | public void updateFreq(String freq) { |
| | | depotConfRepository.updateGrainFreq(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null), freq); |
| | | UpdateWrapper<DepotConf> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("dept_id", ContextUtil.subDeptId(null)).set("pos_x", freq); |
| | | depotConfMapper.update(null, updateWrapper); |
| | | } |
| | | } |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotStore; |
| | | import com.fzzy.igds.repository.DepotRepository; |
| | | import com.fzzy.igds.mapper.DepotMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.SysDeptMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | |
| | | public class DepotService { |
| | | |
| | | @Resource |
| | | private DepotRepository depotRepository; |
| | | private DepotMapper depotMapper; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢ä»åºå表 |
| | | * æ¥è¯¢åºåºä¸ä»åºå表 |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | * @param idDesc æ¯å¦IDååºæå |
| | | * @return |
| | | */ |
| | | public List<Depot> getData(String companyId, String deptId) { |
| | | |
| | | public List<Depot> getData(String companyId, String deptId, boolean idDesc) { |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | deptId = ContextUtil.subDeptId(null); |
| | | |
| | | QueryWrapper<Depot> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("company_id", companyId); |
| | | if(StringUtils.isNotBlank(deptId)){ |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | return depotRepository.getDepot(companyId, deptId); |
| | | |
| | | if(idDesc){ |
| | | //IDååº |
| | | queryWrapper.orderByDesc("id"); |
| | | }else { |
| | | //åºå·æ£åº |
| | | queryWrapper.orderByAsc("order_num"); |
| | | } |
| | | |
| | | return depotMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * jpaæ¥è¯¢ä»åºå表 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public List<Depot> getDepotByIds(List<String> ids) { |
| | | if (null == ids ||ids.isEmpty()) { |
| | | return null; |
| | | } |
| | | return depotRepository.getDepotByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * jpaä¿åæ´æ°ä»åºä¿¡æ¯ |
| | | * ä¿åæ´æ°ä»åºä¿¡æ¯ |
| | | * |
| | | * @param depot |
| | | */ |
| | | public void saveDepot(Depot depot) { |
| | |
| | | if (StringUtils.isEmpty(depot.getDeptId())) { |
| | | depot.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | //é»è®¤é¡ºåºå· |
| | | if (null == depot.getOrderNum()) { |
| | | depot.setOrderNum(1); |
| | | } |
| | | //主é®ID |
| | | if (StringUtils.isEmpty(depot.getId())) { |
| | | depot.setId(getStrId(depot.getDeptId())); |
| | | depot.setCreateBy(ContextUtil.getLoginUserName()); |
| | | depot.setCreateTime(new Date()); |
| | | } |
| | | //é»è®¤é¡ºåºå· |
| | | if(null == depot.getOrderNum()){ |
| | | depot.setOrderNum(1); |
| | | } |
| | | depotMapper.insert(depot); |
| | | }else { |
| | | depot.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | depot.setUpdateTime(new Date()); |
| | | depotRepository.save(depot); |
| | | depotMapper.updateById(depot); |
| | | } |
| | | flushCache(depot.getCompanyId()); |
| | | } |
| | | |
| | | /** |
| | | * è·å主é®ID |
| | | * |
| | | * @param deptId |
| | | * @param deptId |
| | | */ |
| | | public String getStrId(String deptId) { |
| | | List<Depot> depots = depotRepository.getDepotMaxId(deptId); |
| | | List<Depot> depots = this.getData(null, deptId, true); |
| | | String oldOrderId = null; |
| | | if(null != depots && depots.size() > 0){ |
| | | oldOrderId = depots.get(0).getId().substring(deptId.length()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * jpaæ´æ°ä»åºç¶æ |
| | | * æ´æ°ä»åºç¶æ |
| | | * |
| | | * @param depotId |
| | | * @param status |
| | | */ |
| | |
| | | if (StringUtils.isEmpty(depotId)) { |
| | | return; |
| | | } |
| | | depotRepository.updateDepotStatus(status, depotId); |
| | | |
| | | UpdateWrapper<Depot> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id", depotId).set("depot_status", status); |
| | | depotMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | /** |
| | | * jpaå é¤ä»åºè´§ä½ä¿¡æ¯ |
| | | * å é¤ä»åºè´§ä½ä¿¡æ¯ |
| | | * |
| | | * @param depot |
| | | */ |
| | | public void deleteDepot(Depot depot) { |
| | | depotRepository.delete(depot); |
| | | depotMapper.deleteById(depot); |
| | | |
| | | //å é¤é
ç½®ç¼å |
| | | this.delCacheDepot(depot, depot.getCompanyId()); |
| | |
| | | |
| | | /** |
| | | * å·æ°ä»åºè´§ä½ç¼å |
| | | * |
| | | * @param companyId |
| | | */ |
| | | public void flushCache(String companyId) { |
| | |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | |
| | | List<Depot> list = depotRepository.getDepotByCompanyId(companyId); |
| | | List<Depot> list = this.getData(companyId,null, false); |
| | | |
| | | this.setCacheDepotList(list, companyId); |
| | | } |
| | | |
| | | /** |
| | | * 设置ç¼å |
| | | * |
| | | * @param list |
| | | * @param companyId |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å é¤ç¼åä¿¡æ¯ |
| | | * |
| | | * @param depot |
| | | * @param companyId |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åç¼å-æ ¹æ®ç»ç»ç¼ç è·åä»åºéå |
| | | * |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //ç¼åè·å为空ï¼åæ¥è¯¢æ°æ®åº |
| | | if(list.size() < 1){ |
| | | list = depotRepository.getDepotByCompanyId(companyId); |
| | | list = this.getData(companyId,null, false); |
| | | setCacheDepotList(list, companyId); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * è·åç¼å-æ ¹æ®ç»ç»ç¼ç ååºåºç¼ç è·åä»åºéå |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * è·åä»åºä¿¡æ¯-æ ¹æ®ä»åºç¼ç è·åç¼åä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param depotId |
| | | * @return |
| | |
| | | String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT, depotId); |
| | | Depot depot = redisCache.getCacheObject(key); |
| | | if(null == depot){ |
| | | depot = depotRepository.getDepotById(companyId, depotId); |
| | | depot = depotMapper.selectById(depotId); |
| | | redisCache.setCacheObject(key, depot); |
| | | } |
| | | return depot; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åºåä¿¡æ¯æ´æ°ä»åºä¿¡æ¯ |
| | | * @param data |
| | | */ |
| | | public void updateByStore(DepotStore data) { |
| | | |
| | | Depot depot = this.getCacheDepot(data.getCompanyId(), data.getDepotId()); |
| | | if (null == depot) { |
| | | return; |
| | | } |
| | | |
| | | depot.setStorageReal(data.getStorageReal()); |
| | | depot.setDepotStatus(data.getDepotStatus()); |
| | | depot.setFoodLevel(data.getFoodLevel()); |
| | | depot.setFoodLocation(data.getFoodLocation()); |
| | | depot.setFoodVariety(data.getFoodVariety()); |
| | | depot.setFoodType(data.getFoodType()); |
| | | depot.setFoodYear(data.getFoodYear()); |
| | | if (null != data.getStoreDate()) { |
| | | depot.setStoreDate(data.getStoreDate()); |
| | | } |
| | | |
| | | this.saveDepot(depot); |
| | | } |
| | | } |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotStore; |
| | | import com.fzzy.igds.repository.DepotRepository; |
| | | import com.fzzy.igds.repository.DepotStoreRepository; |
| | | import com.fzzy.igds.mapper.DepotMapper; |
| | | import com.fzzy.igds.mapper.DepotStoreMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | |
| | | public class DepotStoreService { |
| | | |
| | | @Resource |
| | | private DepotStoreRepository depotStoreRepository; |
| | | private DepotStoreMapper depotStoreMapper; |
| | | @Resource |
| | | private DepotRepository depotRepository; |
| | | private DepotMapper depotMapper; |
| | | |
| | | /** |
| | | * JPAå页æ¥è¯¢æ°æ® |
| | | * |
| | | * @param specification |
| | | * @param pageable |
| | | * @return |
| | | */ |
| | | public Page<DepotStore> findAll(Specification<DepotStore> specification, Pageable pageable) { |
| | | return depotStoreRepository.findAll(specification, pageable); |
| | | public void listPageData(Page<DepotStore> page, IgdsBaseParam param) { |
| | | QueryWrapper<DepotStore> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | queryWrapper.eq("dept_id", param.getDeptId()); |
| | | |
| | | if (StringUtils.isNotBlank(param.getName())) { |
| | | queryWrapper.eq("depot_id", param.getName()); |
| | | } |
| | | if (null != param.getStart()) { |
| | | queryWrapper.ge("update_time", param.getStart()); |
| | | } |
| | | if (null != param.getEnd()) { |
| | | queryWrapper.le("update_time", param.getEnd()); |
| | | } |
| | | |
| | | depotStoreMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPAæ´æ°ä¿åæ°æ® |
| | | * æ´æ°ä¿åæ°æ® |
| | | * |
| | | * @param data |
| | | */ |
| | |
| | | if (StringUtils.isEmpty(data.getDeptId())) { |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | |
| | | if (StringUtils.isEmpty(data.getId())) { |
| | | data.setId(data.getDepotId() + "_" + DateFormatUtils.format(data.getStoreDate(), "yyyyMMddHHmmss") + "_" + DateFormatUtils.format(data.getUpdateTime(), "yyyyMMddHHmmss")); |
| | | data.setCreateTime(new Date()); |
| | | data.setRemark("ç³»ç»çæ"); |
| | | |
| | | depotStoreRepository.save(data); |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | depotStoreMapper.insert(data); |
| | | }else{ |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | depotStoreMapper.updateById(data); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * JPAå 餿°æ® |
| | | * å 餿°æ® |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public String delDepotStore(DepotStore data) { |
| | | depotStoreRepository.delete(data); |
| | | depotStoreMapper.deleteById(data); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * JPAè·åä»åºæå䏿¡åºåæ°æ® |
| | | * è·åä»åºæå䏿¡åºåæ°æ® |
| | | * |
| | | * @param depotId |
| | | * @param time |
| | | * @return |
| | | */ |
| | | public DepotStore getLastData(String depotId, Date time) { |
| | | List<DepotStore> list = depotStoreRepository.getDataByDepotId(depotId, time); |
| | | |
| | | QueryWrapper<DepotStore> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("depot_id", depotId); |
| | | queryWrapper.ge("create_time", time); |
| | | queryWrapper.le("create_time", time); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | |
| | | List<DepotStore> list = depotStoreMapper.selectList(queryWrapper); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return null; |
| | | } |
| | |
| | | if (null == store.getUpdateTime()) store.setUpdateTime(new Date()); |
| | | if (null == store.getId()) store.setId(ContextUtil.generateId()); |
| | | |
| | | depotStoreRepository.save(store); |
| | | depotStoreMapper.insert(store); |
| | | |
| | | if (updateDepot) { |
| | | depotRepository.updateDepotStorage(store.getStorageReal(), store.getDepotId()); |
| | | UpdateWrapper<Depot> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id", store.getDepotId()).set("storage_real", store.getStorageReal()); |
| | | depotMapper.update(null, updateWrapper); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.data.DeviceIotParam; |
| | | import com.fzzy.igds.domain.DeviceIot; |
| | | import com.fzzy.igds.repository.DeviceIotRepository; |
| | | import com.fzzy.igds.mapper.DeviceIotMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | @Resource |
| | | private DeviceIotRepository deviceIotRepository; |
| | | private DeviceIotMapper deviceIotMapper; |
| | | |
| | | /** |
| | | * JPAå页æ¥è¯¢æ°æ® |
| | | * |
| | | * @param specification |
| | | * @param pageable |
| | | * @return |
| | | * å页æ¥è¯¢æ°æ® |
| | | * @param page |
| | | * @param param |
| | | */ |
| | | public Page<DeviceIot> findAll(Specification<DeviceIot> specification, Pageable pageable) { |
| | | return deviceIotRepository.findAll(specification, pageable); |
| | | public void listPageData(Page<DeviceIot> page, DeviceIotParam param) { |
| | | QueryWrapper<DeviceIot> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | queryWrapper.eq("dept_id", param.getDeptId()); |
| | | |
| | | if (StringUtils.isNotBlank(param.getDepotId())) { |
| | | queryWrapper.eq("depot_id", param.getDepotId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getType())) { |
| | | queryWrapper.eq("type", param.getType()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getSerId())) { |
| | | queryWrapper.eq("ser_id", param.getSerId()); |
| | | } |
| | | |
| | | deviceIotMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | * @param companyId |
| | | */ |
| | | public List<DeviceIot> listData(String companyId) { |
| | | QueryWrapper<DeviceIot> queryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | queryWrapper.eq("company_id", companyId); |
| | | |
| | | return deviceIotMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | |
| | | deviceIot.setId(ContextUtil.generateId()); |
| | | deviceIot.setCreateBy(ContextUtil.getLoginUserName()); |
| | | deviceIot.setCreateTime(new Date()); |
| | | } |
| | | deviceIot.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | deviceIot.setUpdateTime(new Date()); |
| | | deviceIotRepository.save(deviceIot); |
| | | deviceIotMapper.insert(deviceIot); |
| | | }else { |
| | | deviceIot.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | deviceIot.setUpdateTime(new Date()); |
| | | deviceIotMapper.updateById(deviceIot); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param deviceIot |
| | | */ |
| | | public void delDepotDeviceIot(DeviceIot deviceIot) { |
| | | deviceIotRepository.delete(deviceIot); |
| | | deviceIotMapper.deleteById(deviceIot); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param posY |
| | | */ |
| | | public void updatePos(String deviceId, Double posX, Double posY) { |
| | | deviceIotRepository.updatePos(deviceId, posX, posY); |
| | | UpdateWrapper<DeviceIot> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id", deviceId).set("pos_x", posX).set("pos_y", posY); |
| | | deviceIotMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | /** |
| | |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | // è·åææç设å¤ä¿¡æ¯ |
| | | List<DeviceIot> listAll =deviceIotRepository.getDeviceIotByCompanyId(companyId); |
| | | List<DeviceIot> listAll =this.listData(companyId); |
| | | |
| | | if (null != listAll) { |
| | | this.setCacheAllDeviceIot(listAll, companyId); |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.DeviceSer; |
| | | import com.fzzy.igds.repository.DeviceSerRepository; |
| | | import com.fzzy.igds.mapper.DeviceSerMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | @Resource |
| | | private ISysDeptService iSysDeptService; |
| | | @Resource |
| | | private DeviceSerRepository deviceSerRepository; |
| | | private DeviceSerMapper deviceSerMapper; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * JPA æ¥è¯¢åæºå表 |
| | | * æ ¹æ®æ¡ä»¶æ¥è¯¢åæºä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | public List<DeviceSer> getAllSerByCompanyId(String companyId) { |
| | | return deviceSerRepository.getAllSerByCompanyId(companyId); |
| | | public List<DeviceSer> listDeviceSer(String companyId, String deptId, String parentId) { |
| | | |
| | | QueryWrapper<DeviceSer> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if (StringUtils.isNotBlank(companyId)) { |
| | | queryWrapper.eq("company_id", companyId); |
| | | } |
| | | if (StringUtils.isNotBlank(deptId)) { |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | if (StringUtils.isNotBlank(parentId)) { |
| | | queryWrapper.likeRight("dept_id", parentId); |
| | | } |
| | | |
| | | return deviceSerMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPA æ¥è¯¢åæºå表 |
| | | * æ¥è¯¢åæºå表 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId()); |
| | | if (Constant.DEPT_TYPE_20.equals(userDept.getType())) { |
| | | return deviceSerRepository.getDataByDeptId(user.getDeptId() + ""); |
| | | return this.listDeviceSer(null, user.getDeptId() + "", null); |
| | | }else { |
| | | return deviceSerRepository.getDataByParentId(user.getDeptId() + "%"); |
| | | return this.listDeviceSer(null, null, user.getDeptId() + ""); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * JPA æ¥è¯¢åæº |
| | | * æ¥è¯¢åæº |
| | | * |
| | | * @param companyId |
| | | * @param id |
| | |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | return deviceSerRepository.getDataById(companyId, id); |
| | | |
| | | QueryWrapper<DeviceSer> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("company_id", companyId); |
| | | queryWrapper.eq("id", id); |
| | | |
| | | return deviceSerMapper.selectOne(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPA æ´æ°ä¿ååæº |
| | | * æ´æ°ä¿ååæº |
| | | * |
| | | * @param ser |
| | | */ |
| | |
| | | } |
| | | if (StringUtils.isEmpty(ser.getCompanyId())) { |
| | | ser.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(ser.getDeptId())) { |
| | | ser.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | if (StringUtils.isBlank(ser.getUpdateBy())) { |
| | | ser.setCreateBy(ContextUtil.getLoginUserName()); |
| | | ser.setCreateTime(new Date()); |
| | | } |
| | | |
| | | ser.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | ser.setUpdateTime(new Date()); |
| | | deviceSerRepository.save(ser); |
| | | deviceSerMapper.insert(ser); |
| | | } else { |
| | | ser.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | ser.setUpdateTime(new Date()); |
| | | deviceSerMapper.updateById(ser); |
| | | } |
| | | |
| | | refreshCache(ser.getCompanyId()); |
| | | } |
| | | |
| | | /** |
| | | * JPA æ´æ°ä¿ååæº |
| | | * æ´æ°ä¿ååæº |
| | | * |
| | | * @param ser |
| | | */ |
| | | public void delSer(DeviceSer ser) { |
| | | deviceSerRepository.delete(ser); |
| | | deviceSerMapper.deleteById(ser); |
| | | |
| | | //å é¤ç¼å |
| | | delCache(ser.getCompanyId(), ser.getId()); |
| | |
| | | |
| | | /** |
| | | * æ´æ°åæºä¿¡æ¯ |
| | | * |
| | | * @param status |
| | | * @param ip |
| | | * @param port |
| | |
| | | ser.setPort(port); |
| | | ser.setUpdateTime(new Date()); |
| | | |
| | | deviceSerRepository.save(ser); |
| | | deviceSerMapper.updateById(ser); |
| | | setCacheSer(ser); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°åæºä¿¡æ¯ |
| | | * |
| | | * @param data |
| | | */ |
| | | public void updateByData(DeviceSer data) { |
| | |
| | | ser.setPort(data.getPort()); |
| | | ser.setUpdateTime(new Date()); |
| | | ser.setSn(data.getSn()); |
| | | deviceSerRepository.save(ser); |
| | | deviceSerMapper.updateById(ser); |
| | | |
| | | setCacheSer(ser); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°åæºä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param serId |
| | | * @param controlModel |
| | |
| | | ser.setStatus(Constant.YN_Y); |
| | | ser.setControlModel(controlModel); |
| | | ser.setUpdateTime(new Date()); |
| | | deviceSerRepository.save(ser); |
| | | deviceSerMapper.updateById(ser); |
| | | |
| | | setCacheSer(ser); |
| | | } |
| | |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | List<DeviceSer> list = this.getAllSerByCompanyId(companyId); |
| | | List<DeviceSer> list = this.listDeviceSer(companyId, null, null); |
| | | this.setCacheSer(list, companyId); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®ç±»åè·ååæºä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param type |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * JPA-æ´æ°è®¾å¤å
¨é¨ç¦»çº¿ |
| | | * -æ´æ°è®¾å¤å
¨é¨ç¦»çº¿ |
| | | * |
| | | * @param companyId |
| | | */ |
| | | public void allOffLine(String companyId) { |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | deviceSerRepository.updateSerStatus(companyId, Constant.YN_N); |
| | | |
| | | UpdateWrapper<DeviceSer> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("company_id", companyId).set("status", Constant.YN_N); |
| | | deviceSerMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPA-æ ¹æ®SNæ´æ°ç¶æ |
| | | * -æ ¹æ®SNæ´æ°ç¶æ |
| | | * |
| | | * @param ip |
| | | * @param port |
| | | * @param sn |
| | | * @param status |
| | | */ |
| | | public void onlineBySn(String ip, Integer port, String sn, String status) { |
| | | deviceSerRepository.updateBySn(ip, port, status, sn, new Date()); |
| | | |
| | | UpdateWrapper<DeviceSer> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("sn", sn).set("ip", ip).set("port", port).set("update_time", new Date()); |
| | | deviceSerMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.igds.domain.DicArea; |
| | | import com.fzzy.igds.mapper.DicAreaMapper; |
| | | import com.fzzy.igds.repository.DicAreaRepository; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | * @Author CZT |
| | | * @Date 2025/11/25 16:23 |
| | | */ |
| | | @Service("sys.dicAreaService") |
| | | @Service |
| | | public class DicAreaService { |
| | | |
| | | @Resource |
| | | private DicAreaRepository dicAreaRepository; |
| | | @Resource |
| | | private DicAreaMapper dicAreaMapper; |
| | | |
| | | /** |
| | | * JPAå页æ¥è¯¢æ°æ® |
| | | * |
| | | * @param pageable |
| | | */ |
| | | public Page<DicArea> findAll(Pageable pageable) { |
| | | return dicAreaRepository.findAll(pageable); |
| | | public void listPageData(Page<DicArea> page, String key) { |
| | | |
| | | QueryWrapper<DicArea> queryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isNotBlank(key)) { |
| | | queryWrapper.like("name", key); |
| | | } |
| | | |
| | | dicAreaMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPAå页æ¥è¯¢æ°æ® |
| | | * |
| | | * @param specification |
| | | * @param pageable |
| | | * @return |
| | | */ |
| | | public Page<DicArea> findAll(Specification<DicArea> specification, Pageable pageable) { |
| | | return dicAreaRepository.findAll(specification, pageable); |
| | | } |
| | | |
| | | /** |
| | | * JPAæ ¹æ®ç¶ç¼ç æ¥è¯¢åºåä¿¡æ¯ |
| | | * æ ¹æ®ç¶ç¼ç æ¥è¯¢åºåä¿¡æ¯ |
| | | * |
| | | * @param parentCode |
| | | * @return |
| | | */ |
| | | public List<DicArea> getDicAreaByParentCode(String parentCode) { |
| | | if(StringUtils.isEmpty(parentCode)){ |
| | | return dicAreaRepository.findAll(); |
| | | public List<DicArea> listData(String parentCode, String name, String code) { |
| | | |
| | | QueryWrapper<DicArea> queryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isNotBlank(parentCode)) { |
| | | queryWrapper.like("parent_code", parentCode); |
| | | } |
| | | return dicAreaRepository.getDicAreaByParentCode(parentCode); |
| | | if (StringUtils.isNotBlank(name)) { |
| | | queryWrapper.like("name", name); |
| | | } |
| | | if (StringUtils.isNotBlank(code)) { |
| | | queryWrapper.like("code", code); |
| | | } |
| | | return dicAreaMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPAä¿åæ°æ® |
| | | * ä¿åæ°æ® |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public String saveDicArea(DicArea data) { |
| | | dicAreaRepository.save(data); |
| | | dicAreaMapper.insert( data); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * JPAå 餿°æ® |
| | | * å 餿°æ® |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public String delDicArea(DicArea data) { |
| | | dicAreaRepository.delete(data); |
| | | dicAreaMapper.deleteById(data); |
| | | return null; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public DicArea listDicAreaByName(String name) { |
| | | return dicAreaRepository.listDicAreaByName(name); |
| | | List<DicArea> list = this.listData(null, name, null); |
| | | if(null == list || list.isEmpty()){ |
| | | return null; |
| | | } |
| | | return list.get(0); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public DicArea listDicAreaByCode(String code) { |
| | | return dicAreaRepository.listDicAreaByCode(code); |
| | | List<DicArea> list = this.listData(null, null, code); |
| | | if(null == list || list.isEmpty()){ |
| | | return null; |
| | | } |
| | | |
| | | return list.get(0); |
| | | } |
| | | |
| | | /** |
| | | * æ¨¡ç³æ¥è¯¢ |
| | |
| | | * @return |
| | | */ |
| | | public List<DicArea> listDicArea(String key) { |
| | | if(null == key){ |
| | | return dicAreaMapper.selectList(null); |
| | | } |
| | | |
| | | |
| | | QueryWrapper<DicArea> queryWrapper = new QueryWrapper<>(); |
| | | if(StringUtils.isNotEmpty(key)){ |
| | | if (StringUtils.isNotBlank(key)) { |
| | | queryWrapper.like("name", key); |
| | | queryWrapper.like("code", key); |
| | | } |
| | | return dicAreaMapper.selectList(queryWrapper); |
| | | List<DicArea> dicAreas = dicAreaMapper.selectList(queryWrapper); |
| | | |
| | | if (null == dicAreas || dicAreas.isEmpty()) { |
| | | queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.like("code", key); |
| | | dicAreas = dicAreaMapper.selectList(queryWrapper); |
| | | } |
| | | return dicAreas; |
| | | } |
| | | } |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.repository.InoutConfRepository; |
| | | import com.fzzy.igds.repository.InoutSysConfRepository; |
| | | import com.fzzy.igds.mapper.InoutConfMapper; |
| | | import com.fzzy.igds.mapper.InoutSysConfMapper; |
| | | import com.fzzy.igds.domain.InoutConf; |
| | | import com.fzzy.igds.domain.InoutSysConf; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | |
| | | @Resource |
| | | private ISysDeptService iSysDeptService; |
| | | @Resource |
| | | private InoutSysConfRepository inoutSysConfRepository; |
| | | private InoutConfMapper inoutConfMapper; |
| | | @Resource |
| | | private InoutConfRepository inoutConfRepository; |
| | | private InoutSysConfMapper inoutSysConfMapper; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /*--------------- åºå
¥åºæµç¨ ---------------*/ |
| | | |
| | | /** |
| | | * JPA-æ¥è¯¢æµç¨é
ç½® |
| | | * æ ¹æ®æ¡ä»¶æ¥è¯¢æµç¨ä¿¡æ¯ |
| | | * |
| | | * @param deptId |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | public List<InoutSysConf> listInoutSysConf(String deptId, String parentId) { |
| | | |
| | | QueryWrapper<InoutSysConf> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if (StringUtils.isNotBlank(deptId)) { |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(parentId)) { |
| | | queryWrapper.likeRight("dept_id", parentId); |
| | | } |
| | | |
| | | return inoutSysConfMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æµç¨é
ç½® |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId()); |
| | | if (Constant.DEPT_TYPE_20.equals(userDept.getType())) { |
| | | return inoutSysConfRepository.getDataById(ContextUtil.subDeptId(user)); |
| | | return this.listInoutSysConf(ContextUtil.subDeptId(user), null); |
| | | }else { |
| | | return inoutSysConfRepository.getDataByParentId(user.getDeptId() + "%"); |
| | | return this.listInoutSysConf(null, user.getDeptId() + "%"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param deptId |
| | | */ |
| | | public void delSysConfData(String deptId) { |
| | | inoutSysConfRepository.deleteById(deptId); |
| | | inoutSysConfMapper.deleteById(deptId); |
| | | } |
| | | |
| | | /** |
| | | * JPA-ä¿åæµç¨é
ç½® |
| | | * ä¿åæµç¨é
ç½® |
| | | * |
| | | * @param data |
| | | * @return |
| | |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(data.getUpdateBy())) { |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | inoutSysConfRepository.save(data); |
| | | inoutSysConfMapper.insert(data); |
| | | } else { |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | inoutSysConfMapper.updateById(data); |
| | | } |
| | | |
| | | this.flushInoutSysConfCache(data); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /*--------------- åºå
¥åºè®¾å¤ ---------------*/ |
| | | |
| | | /** |
| | | * JPA-æ¥è¯¢è®¾å¤é
ç½® |
| | | * æ¥è¯¢è®¾å¤é
ç½® |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | deptId = ContextUtil.subDeptId(null); |
| | | } |
| | | return inoutConfRepository.getInoutConfList(companyId, deptId); |
| | | QueryWrapper<InoutConf> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | queryWrapper.eq("dept_id", deptId); |
| | | queryWrapper.eq("company_id", companyId); |
| | | |
| | | return inoutConfMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPA-ä¿å设å¤é
ç½® |
| | | * ä¿å设å¤é
ç½® |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public String saveData(InoutConf data) { |
| | | if (0 == data.getInOrder()) { |
| | | data.setInOrder(1); |
| | | } |
| | | if (StringUtils.isEmpty(data.getSort())) { |
| | | data.setSort("1"); |
| | | } |
| | | if (StringUtils.isEmpty(data.getId())) { |
| | | data.setId(ContextUtil.generateId()); |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | } |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(data.getDeptId())) { |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | if (0 == data.getInOrder()) { |
| | | data.setInOrder(1); |
| | | } |
| | | if (StringUtils.isEmpty(data.getSort())) { |
| | | data.setSort("1"); |
| | | } |
| | | if (StringUtils.isBlank(data.getId())) { |
| | | data.setId(ContextUtil.generateId()); |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | inoutConfRepository.save(data); |
| | | inoutConfMapper.insert(data); |
| | | }else { |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | inoutConfMapper.updateById(data); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * JPA-å é¤è®¾å¤é
ç½® |
| | | * å é¤è®¾å¤é
ç½® |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public String delData(InoutConf data) { |
| | | inoutConfRepository.delete(data); |
| | | inoutConfMapper.deleteById(data); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 设置ç¼å |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | */ |
| | |
| | | |
| | | /** |
| | | * è·åç¼å |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * è·åç¼å |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | * @param confId |
| | |
| | | |
| | | /** |
| | | * æ´æ°åºå
¥åºè®¾å¤ç¶æ |
| | | * |
| | | * @param ip |
| | | * @param port |
| | | * @param status |
| | | */ |
| | | public void updateInoutConfStatus(String ip, Integer port, String status) { |
| | | inoutConfRepository.updateInoutConfStatus(status, ip, port); |
| | | |
| | | UpdateWrapper<InoutConf> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("ip", ip).eq("port", port).set("status", status); |
| | | inoutConfMapper.update(null, updateWrapper); |
| | | } |
| | | } |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.QuantityConf; |
| | | import com.fzzy.igds.repository.QuantityConfRepository; |
| | | import com.fzzy.igds.mapper.QuantityConfMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | public class QuantityService { |
| | | |
| | | @Resource |
| | | private QuantityConfRepository quantityConfRepository; |
| | | private QuantityConfMapper quantityConfMapper; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * JPA - æ¥è¯¢é
置信æ¯ï¼æ ¹æ®åºåºç¼ç è·å |
| | | * æ¥è¯¢é
置信æ¯ï¼æ ¹æ®åºåºç¼ç è·å |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | deptId = ContextUtil.subDeptId(null); |
| | | } |
| | | return quantityConfRepository.listQuantityConf(companyId, deptId); |
| | | |
| | | QueryWrapper<QuantityConf> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("company_id", companyId); |
| | | if(StringUtils.isNotBlank(deptId)){ |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | queryWrapper.orderByAsc("order_num"); |
| | | |
| | | return quantityConfMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPA - æ¥è¯¢é
置信æ¯ï¼æ ¹æ®ç»ç»ç¼ç è·å |
| | | * - æ¥è¯¢é
置信æ¯ï¼æ ¹æ®ç»ç»ç¼ç è·å |
| | | * |
| | | * @param companyId |
| | | * @return |
| | |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | |
| | | return quantityConfRepository.listQuantityConf(companyId); |
| | | return this.getConfList(companyId, null); |
| | | } |
| | | |
| | | /** |
| | | * JPA - æ´æ°ä¿åæ°æ® |
| | | * - æ´æ°ä¿åæ°æ® |
| | | * |
| | | * @param conf |
| | | */ |
| | |
| | | if (StringUtils.isEmpty(conf.getDepotId())) { |
| | | return; |
| | | } |
| | | if (StringUtils.isEmpty(conf.getCompanyId())) { |
| | | if (StringUtils.isBlank(conf.getCompanyId())) { |
| | | conf.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(conf.getDeptId())) { |
| | | if (StringUtils.isBlank(conf.getDeptId())) { |
| | | conf.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | if (null == conf.getUpdateBy()) { |
| | | conf.setCreateBy(ContextUtil.getLoginUserName()); |
| | | conf.setCreateTime(new Date()); |
| | | } |
| | | conf.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | conf.setUpdateTime(new Date()); |
| | | quantityConfRepository.save(conf); |
| | | quantityConfMapper.insert(conf); |
| | | }else { |
| | | conf.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | conf.setUpdateTime(new Date()); |
| | | quantityConfMapper.updateById(conf); |
| | | } |
| | | |
| | | //å·æ°ç¼å |
| | | setCacheQuantityConf(conf); |
| | | this.setCacheQuantityConf(conf); |
| | | } |
| | | |
| | | /** |
| | | * JPA- æ´æ°é
ç½®åæ··ä¸ªå¤ª |
| | | * æ´æ°ä¿¡æ¯ |
| | | * |
| | | * @param conf |
| | | */ |
| | | public void updateQuantityConfBySn(QuantityConf conf) { |
| | | //æ´æ°ç¶æ |
| | | quantityConfRepository.updateConfStatus(conf.getIp(), conf.getPort(), conf.getStatus(), conf.getSn()); |
| | | |
| | | setCacheQuantityConf(conf); |
| | | UpdateWrapper<QuantityConf> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("sn", conf.getSn()).set("ip", conf.getIp()).set("port", conf.getPort()).set("status", conf.getStatus()); |
| | | quantityConfMapper.update(null, updateWrapper); |
| | | |
| | | this.setCacheQuantityConf(conf); |
| | | } |
| | | |
| | | /** |
| | | * JPA - å 餿°æ® |
| | | * - å 餿°æ® |
| | | * |
| | | * @param conf |
| | | * @return |
| | | */ |
| | | public String delQuantityConf(QuantityConf conf) { |
| | | quantityConfRepository.delete(conf); |
| | | quantityConfMapper.deleteById(conf); |
| | | //å é¤é
ç½®ä¿¡æ¯ |
| | | |
| | | flushConfCache(conf.getCompanyId(), conf.getDeptId()); |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.repository.SecCameraRepository; |
| | | import com.fzzy.igds.mapper.CameraMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | public class SecCameraService { |
| | | |
| | | @Resource |
| | | private SecCameraRepository secCameraRepository; |
| | | private CameraMapper cameraMapper; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * JPAå页æ¥è¯¢æ°æ® |
| | | * |
| | | * @param specification |
| | | * @param pageable |
| | | * @return |
| | | */ |
| | | public Page<Camera> findAll(Specification<Camera> specification, Pageable pageable) { |
| | | return secCameraRepository.findAll(specification, pageable); |
| | | public void listPageCamera(Page<Camera> page, Camera param) { |
| | | QueryWrapper<Camera> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | queryWrapper.eq("dept_id", param.getDeptId()); |
| | | |
| | | if(StringUtils.isNotBlank(param.getName())){ |
| | | queryWrapper.like("name", param.getName()); |
| | | } |
| | | if(StringUtils.isNotBlank(param.getBrand())){ |
| | | queryWrapper.eq("brand", param.getBrand()); |
| | | } |
| | | if(StringUtils.isNotBlank(param.getSpjklx())){ |
| | | queryWrapper.eq("spjklx", param.getSpjklx()); |
| | | } |
| | | if(StringUtils.isNotBlank(param.getSpdwlx())){ |
| | | queryWrapper.eq("spdwlx", param.getSpdwlx()); |
| | | } |
| | | |
| | | cameraMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPA - æ¥è¯¢åºåºä¸ææçæ§ |
| | | * æ¥è¯¢åºåºä¸ææçæ§ |
| | | * @return |
| | | */ |
| | | public List<Camera> listCamera() { |
| | | return secCameraRepository.listCamera(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null)); |
| | | public List<Camera> listCamera(String companyId, String deptId) { |
| | | |
| | | QueryWrapper<Camera> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if(StringUtils.isNotBlank(companyId)){ |
| | | queryWrapper.eq("company_id", companyId); |
| | | } |
| | | if(StringUtils.isNotBlank(deptId)){ |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | |
| | | return cameraMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * JPA - ä¿åæ°æ® |
| | | * ä¿åæ°æ® |
| | | * @param data |
| | | */ |
| | | public void saveCamera(Camera data) { |
| | |
| | | } |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | secCameraRepository.save(data); |
| | | cameraMapper.insert(data); |
| | | } |
| | | |
| | | /** |
| | | * JPA - å 餿°æ® |
| | | * å 餿°æ® |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public String delCamera(Camera data) { |
| | | secCameraRepository.delete(data); |
| | | cameraMapper.deleteById(data); |
| | | return null; |
| | | } |
| | | |
| | |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | List<Camera> list = secCameraRepository.listCameraByCompanyId(companyId); |
| | | List<Camera> list = this.listCamera(companyId,null); |
| | | redisCache.setCacheObject(RedisConst.buildKey(companyId, RedisConst.KEY_CAMERA_LIST), list); |
| | | } |
| | | |
| | |
| | | List<Camera> list = redisCache.getCacheObject(key); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | list = secCameraRepository.listCameraByCompanyId(companyId); |
| | | list = this.listCamera(companyId,null); |
| | | redisCache.setCacheObject(key, list); |
| | | } |
| | | return list; |
| | |
| | | * @param param |
| | | */ |
| | | public void updatePos(Camera param) { |
| | | secCameraRepository.updatePosById(param.getId(), param.getPosX(), param.getPosY()); |
| | | UpdateWrapper<Camera> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id", param.getId()).set("pos_x", param.getPosX()).set("pos_y", param.getPosY()); |
| | | cameraMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.fzzy.igds.domain.Company; |
| | | import com.fzzy.igds.service.CoreCompanyService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import javax.annotation.Resource; |
| | |
| | | private CoreCompanyService coreCompanyService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤,å°æä½ä¿¡æ¯è°æ´ä¸ºç©ºï¼é»è®¤å
æ¬ååºåæ° |
| | | * è·åå½åè´¦å·ä¸å±ææå
¬å¸ä¿¡æ¯ |
| | | * |
| | | * companyPR#getData |
| | | * |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<Company> getData() { |
| | | |
| | | return coreCompanyService.getDataByParentId(); |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | return coreCompanyService.listCompany(null, null, user.getDeptId() + ""); |
| | | } |
| | | |
| | | |
| | |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import com.fzzy.igds.service.DepotConfService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<DepotConf> getConfList() { |
| | | return depotConfService.getConfList(null,null); |
| | | return depotConfService.getConfList(null, ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<Depot> getData(){ |
| | | return depotService.getData(null, null); |
| | | return depotService.getData(null, ContextUtil.subDeptId(null) ,false); |
| | | } |
| | | |
| | | /** |
| | |
| | | @DataProvider |
| | | public List<Dept> getAllData() { |
| | | |
| | | return coreDeptService.getAllDeptData(); |
| | | return coreDeptService.listDept(null,ContextUtil.getCompanyId(),null); |
| | | } |
| | | |
| | | /** |
| | |
| | | <Property name="width">160</Property> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | </Container> |
| | | <Container layoutConstraint="bottom"> |
| | | <Property name="className">c-bottom</Property> |
| | | <ToolBar layoutConstraint="bottom"> |
| | | <Fill/> |
| | | <DataPilot layoutConstraint="right"> |
| | | <Property name="dataSet">dsDeviceIot</Property> |
| | | <Property name="itemCodes">pageSize,pages</Property> |
| | | <Property name="dataSet">dsDeviceIot</Property> |
| | | </DataPilot> |
| | | </ToolBar> |
| | | </Container> |
| | | <Dialog id="dialogDeviceIot" layout="regionPadding:8"> |
| | | <ClientEvent name="onHide">view.id("dsDeviceIot").getData().cancel();</ClientEvent> |
| | |
| | | import com.bstek.dorado.data.entity.EntityState; |
| | | import com.bstek.dorado.data.entity.EntityUtils; |
| | | import com.bstek.dorado.data.provider.Page; |
| | | import com.fzzy.igds.data.DeviceIotParam; |
| | | import com.fzzy.igds.domain.DeviceIot; |
| | | import com.fzzy.igds.service.DeviceIotService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import javax.annotation.Resource; |
| | | import javax.persistence.criteria.CriteriaBuilder; |
| | | import javax.persistence.criteria.CriteriaQuery; |
| | | import javax.persistence.criteria.Predicate; |
| | | import javax.persistence.criteria.Root; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description |
| | |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public void loadDeviceIotPage(Page<DeviceIot> page, Map<String, Object> param) { |
| | | public void loadDeviceIotPage(Page<DeviceIot> page, DeviceIotParam param) { |
| | | com.baomidou.mybatisplus.extension.plugins.pagination.Page<DeviceIot> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPageNo(), page.getPageSize()); |
| | | |
| | | if (null == param) { |
| | | param = new HashMap<>(); |
| | | param = new DeviceIotParam(); |
| | | } |
| | | Map<String, Object> finalParam = param; |
| | | deviceIotService.listPageData(corePage, param); |
| | | |
| | | //å¤åæ°å页æ¥è¯¢ |
| | | Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.ASC, DeviceIot.SORT_PROP); |
| | | Specification<DeviceIot> specification = new Specification<DeviceIot>() { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public Predicate toPredicate(Root<DeviceIot> root, CriteriaQuery<?> query, CriteriaBuilder cb) { |
| | | List<Predicate> predicates = new ArrayList<Predicate>(); //ææçæè¨ |
| | | |
| | | Predicate predicate1 = cb.equal(root.get("companyId"), ContextUtil.getCompanyId()); |
| | | predicates.add(predicate1); |
| | | predicate1 = cb.equal(root.get("deptId"), ContextUtil.subDeptId(null)); |
| | | predicates.add(predicate1); |
| | | |
| | | String key = (String) finalParam.get("depotId"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | predicate1 = cb.equal(root.get("depotId"), key); |
| | | predicates.add(predicate1); |
| | | } |
| | | key = (String) finalParam.get("type"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | predicate1 = cb.equal(root.get("type"), key); |
| | | predicates.add(predicate1); |
| | | } |
| | | key = (String) finalParam.get("serId"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | predicate1 = cb.equal(root.get("serId"), key); |
| | | predicates.add(predicate1); |
| | | } |
| | | |
| | | return cb.and(predicates.toArray(new Predicate[0])); |
| | | } |
| | | }; |
| | | org.springframework.data.domain.Page<DeviceIot> japPage = deviceIotService.findAll(specification, pageable); |
| | | page.setEntityCount((int) japPage.getTotalElements()); |
| | | page.setEntities(japPage.getContent()); |
| | | // éæ°å°è£
|
| | | page.setEntities(corePage.getRecords()); |
| | | page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal()))); |
| | | } |
| | | |
| | | /** |
| | |
| | | <Property name="name">remark</Property> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | </Container> |
| | | <Container layoutConstraint="bottom"> |
| | | <Property name="className">c-bottom</Property> |
| | | <ToolBar layoutConstraint="bottom"> |
| | | <Fill/> |
| | | <DataPilot layoutConstraint="right"> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="itemCodes">pageSize,pages</Property> |
| | | <Property name="dataSet">dsMain</Property> |
| | | </DataPilot> |
| | | </ToolBar> |
| | | </Container> |
| | | <Dialog id="dialogMain"> |
| | | <Property name="closeable">false</Property> |
| | |
| | | import com.bstek.dorado.data.provider.Page; |
| | | import com.fzzy.igds.domain.DicArea; |
| | | import com.fzzy.igds.service.DicAreaService; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.persistence.criteria.CriteriaBuilder; |
| | | import javax.persistence.criteria.CriteriaQuery; |
| | | import javax.persistence.criteria.Predicate; |
| | | import javax.persistence.criteria.Root; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataProvider |
| | | public void pageList(Page<DicArea> page, String key) { |
| | | //å¤åæ°å页æ¥è¯¢ |
| | | Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.ASC, DicArea.SORT_PROP); |
| | | |
| | | if (StringUtils.isEmpty(key)) { |
| | | org.springframework.data.domain.Page<DicArea> japPage = dicAreaService.findAll(pageable); |
| | | page.setEntityCount((int) japPage.getTotalElements()); |
| | | page.setEntities(japPage.getContent()); |
| | | com.baomidou.mybatisplus.extension.plugins.pagination.Page<DicArea> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPageNo(), page.getPageSize()); |
| | | |
| | | return; |
| | | } |
| | | Specification<DicArea> specification = new Specification<DicArea>() { |
| | | private static final long serialVersionUID = 1L; |
| | | dicAreaService.listPageData(corePage, key); |
| | | |
| | | public Predicate toPredicate(Root<DicArea> root, CriteriaQuery<?> query, CriteriaBuilder cb) { |
| | | List<Predicate> predicates = new ArrayList<Predicate>(); //ææçæè¨ |
| | | |
| | | Predicate predicate1 = cb.like(root.get("name"), "%" + key + "%"); |
| | | predicates.add(predicate1); |
| | | |
| | | return cb.and(predicates.toArray(new Predicate[0])); |
| | | } |
| | | }; |
| | | org.springframework.data.domain.Page<DicArea> japPage = dicAreaService.findAll(specification, pageable); |
| | | page.setEntityCount((int) japPage.getTotalElements()); |
| | | page.setEntities(japPage.getContent()); |
| | | // éæ°å°è£
|
| | | page.setEntities(corePage.getRecords()); |
| | | page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal()))); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<DicArea> getDicAreaByParentCode(String parentCode) { |
| | | return dicAreaService.getDicAreaByParentCode(parentCode); |
| | | return dicAreaService.listData(parentCode, null, null); |
| | | } |
| | | |
| | | /** |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">createBy</Property> |
| | | <Property name="property">createBy</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">createTime</Property> |
| | | <Property name="property">createTime</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">port</Property> |
| | | <Property name="property">port</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">updateBy</Property> |
| | | <Property name="property">updateBy</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | </AutoForm> |
| | | </Children> |
| | | </FieldSet> |
| | | <FieldSet layoutConstraint="padding:5"> |
| | | <FieldSet layout="padding:5"> |
| | | <Property name="caption">çæ§ä¿¡æ¯</Property> |
| | | <Buttons/> |
| | | <Children> |
| | |
| | | </AutoForm> |
| | | </Children> |
| | | </FieldSet> |
| | | <FieldSet layoutConstraint="padding:5"> |
| | | <FieldSet layout="padding:5"> |
| | | <Property name="caption">ææ¾é
ç½®</Property> |
| | | <Buttons/> |
| | | <Children> |
| | |
| | | <Property></Property> |
| | | <Property name="label">夿³¨ä¿¡æ¯</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="tag"> |
| | | <Property></Property> |
| | | <Property name="label">æ è®°</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="createTime"> |
| | | <Property name="dataType">DateTime</Property> |
| | | <Property name="label">å¶åæ¶é´</Property> |
| | |
| | | <Button> |
| | | <ClientEvent name="onClick">var data = view.get("#dsQuery.data");
 |
| | | if(data){
 |
| | | view.get("#dsMain").set("parameter",data.toJSON()).flushAsync();
 |
| | | view.get("#dsMain").set("parameter",data).flushAsync();
 |
| | | }else{
 |
| | | view.get("#dsMain").flushAsync();
 |
| | | }</ClientEvent> |
| | |
| | | <Property name="align">center</Property> |
| | | <Property name="width">120</Property> |
| | | </DataColumn> |
| | | <DataColumn> |
| | | <DataColumn name="customerName"> |
| | | <Property name="property">customerName</Property> |
| | | <Property name="name">customerName</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="depotId"> |
| | |
| | | <Property name="iconClass">fa fa-tasks</Property> |
| | | <Buttons> |
| | | <Button id="btnOk"> |
| | | <ClientEvent name="onClick">view.get("#udpateSave").execute(function(result){
 |
| | | <ClientEvent name="onClick">view.get("#updateSave").execute(function(result){
 |
| | | if(result){
 |
| | | $alert(result);
 |
| | | return;
 |
| | |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |
| | | <AjaxAction id="ajaxSave"> |
| | | <Property name="service">inoutNoticePR#saveIn</Property> |
| | | </AjaxAction> |
| | | <UpdateAction id="udpateSave"> |
| | | <UpdateAction id="updateSave"> |
| | | <Property name="dataResolver">inoutNoticePR#saveIn</Property> |
| | | <UpdateItem> |
| | | <Property name="dataPath">[#current]</Property> |
| | |
| | | import com.fzzy.igds.domain.QuantityConf; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.QuantityService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<QuantityConf> getConfList() { |
| | | return quantityService.getConfList(null, null); |
| | | return quantityService.getConfList(null, ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | /** |
| | |
| | | </AutoFormElement> |
| | | <Button> |
| | | <ClientEvent name="onClick">var param = view.get("#dsParam.data");
 |
| | | view.get("#dsMain").set("parameter",param.toJSON()).flushAsync();</ClientEvent> |
| | | view.get("#dsMain").set("parameter",param).flushAsync();</ClientEvent> |
| | | <Property name="caption">æç´¢</Property> |
| | | <Property name="iconClass">fa fa-search</Property> |
| | | <Property name="exClassName">btn-q1</Property> |
| | |
| | | <Editor/> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | </Container> |
| | | <Container layoutConstraint="bottom"> |
| | | <Property name="className">c-bottom</Property> |
| | | <ToolBar layoutConstraint="bottom"> |
| | | <Fill/> |
| | | <DataPilot layoutConstraint="right"> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="itemCodes">pageSize,pages</Property> |
| | | <Property name="dataSet">dsMain</Property> |
| | | </DataPilot> |
| | | </ToolBar> |
| | | </Container> |
| | | <Dialog id="dialogMain" layout="regionPadding:8"> |
| | | <Property name="iconClass">fa fa-tasks</Property> |
| | |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |
| | | <AjaxAction id="ajaxRemoteMedia"> |
| | | <Property name="confirmMessage">ç¡®å®è¦åæ¥ä¹ï¼</Property> |
| | | <Property name="service">secCameraPR#flushByMedia</Property> |
| | | </AjaxAction> |
| | | </View> |
| | | </ViewConfig> |
| | |
| | | import com.fzzy.igds.domain.Camera; |
| | | import com.fzzy.igds.service.SecCameraService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import org.springframework.stereotype.Component; |
| | | import javax.persistence.criteria.CriteriaBuilder; |
| | | import javax.persistence.criteria.CriteriaQuery; |
| | | import javax.persistence.criteria.Predicate; |
| | | import javax.persistence.criteria.Root; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description |
| | |
| | | * @param param |
| | | */ |
| | | @DataProvider |
| | | public void listPageCamera(Page<Camera> page, Map<String, Object> param) { |
| | | org.springframework.data.domain.Page<Camera> japPage = pageCamera(page, param); |
| | | page.setEntityCount((int) japPage.getTotalElements()); |
| | | page.setEntities(japPage.getContent()); |
| | | } |
| | | public void listPageCamera(Page<Camera> page, Camera param) { |
| | | com.baomidou.mybatisplus.extension.plugins.pagination.Page<Camera> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPageNo(), page.getPageSize()); |
| | | |
| | | public org.springframework.data.domain.Page<Camera> pageCamera(Page<Camera> page, Map<String, Object> param) { |
| | | if (null == param) { |
| | | param = new HashMap<>(); |
| | | param = new Camera(); |
| | | } |
| | | Map<String, Object> finalParam = param; |
| | | Camera camera = new Camera(); |
| | | BeanUtils.copyProperties(param, camera); |
| | | secCameraService.listPageCamera(corePage, camera); |
| | | |
| | | //å¤åæ°å页æ¥è¯¢ |
| | | Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.ASC, Camera.SORT_PROP); |
| | | Specification<Camera> specification = new Specification<Camera>() { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public Predicate toPredicate(Root<Camera> root, CriteriaQuery<?> query, CriteriaBuilder cb) { |
| | | List<Predicate> predicates = new ArrayList<Predicate>(); //ææçæè¨ |
| | | |
| | | Predicate predicate1 = cb.equal(root.get("companyId"), ContextUtil.getCompanyId()); |
| | | predicates.add(predicate1); |
| | | Predicate predicate2 = cb.equal(root.get("deptId"), ContextUtil.subDeptId(null)); |
| | | predicates.add(predicate2); |
| | | |
| | | String key = (String) finalParam.get("bizType"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | Predicate predicate3 = cb.equal(root.get("bizType"), key); |
| | | predicates.add(predicate3); |
| | | } |
| | | key = (String) finalParam.get("name"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | Predicate predicate4 = cb.like(root.get("name"), "%" + key + "%"); |
| | | predicates.add(predicate4); |
| | | } |
| | | key = (String) finalParam.get("brand"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | Predicate predicate5 = cb.equal(root.get("brand"), key); |
| | | predicates.add(predicate5); |
| | | } |
| | | key = (String) finalParam.get("spjklx"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | Predicate predicate5 = cb.equal(root.get("spjklx"), key); |
| | | predicates.add(predicate5); |
| | | } |
| | | key = (String) finalParam.get("spdwlx"); |
| | | if (StringUtils.isNotEmpty(key)) { |
| | | Predicate predicate5 = cb.equal(root.get("spdwlx"), key); |
| | | predicates.add(predicate5); |
| | | } |
| | | return cb.and(predicates.toArray(new Predicate[0])); |
| | | } |
| | | }; |
| | | org.springframework.data.domain.Page<Camera> japPage = secCameraService.findAll(specification, pageable); |
| | | return japPage; |
| | | // éæ°å°è£
|
| | | page.setEntities(corePage.getRecords()); |
| | | page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal()))); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataProvider |
| | | public List<Camera> listCamera() { |
| | | return secCameraService.listCamera(); |
| | | return secCameraService.listCamera(ContextUtil.getCompanyId(),ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public String refreshCache() { |
| | | secCameraService.refreshCache(ContextUtil.getCompanyId()); |
| | | return null; |
| | | } |
| | | |
| | | /*** |
| | | * securityPR#flushByMedia |
| | | * |
| | | * è·åæå头åè¡¨ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String flushByMedia(String playType) { |
| | | |
| | | if (null == playType){ |
| | | return "没æéæ©ææ¾æ¹å¼ï¼æ§è¡å¤±è´¥"; |
| | | } |
| | | |
| | | // try { |
| | | // if (CameraUtil.PLAY_TYPE_MEDIA_HIK.equals(playType)) { |
| | | // ApiCameraData apiCameraData = new ApiCameraData(); |
| | | // apiCameraData.setCompanyId(ContextUtil.getCompanyId()); |
| | | // apiCameraData.setDeptId(ContextUtil.subDeptId(null)); |
| | | // apiCameraData.setPlayType(playType); |
| | | // List<SecCameraDto> list = apiCameraManager.getApiCameraService(playType).searchCamera(apiCameraData); |
| | | // if(list == null){ |
| | | // return "åæ¥å¤±è´¥ï¼"; |
| | | // }else { |
| | | // return "忥æåï¼"; |
| | | // } |
| | | // } |
| | | return "å½åææ¾æ¹å¼æ²¡ææ¤åè½ï¼"; |
| | | // |
| | | // }catch (Exception e){ |
| | | // log.error("-----忥æå头å表失败-----åå ={}", e.toString()); |
| | | // return "è¿ç¨æ¥å£æå¡å¼å¸¸ï¼è¯·æ ¸æ¥åéè¯ï¼"; |
| | | // } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | private CoreCompanyService companyService; |
| | | @Resource |
| | | private CoreDeptService deptService; |
| | | |
| | | /** |
| | | * selectDeptPR#listCompany |
| | | * æ ¹æ®è¡æ¿åºå代ç è·å ä¼ä¸ä¿¡æ¯å表 |
| | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | |
| | | if(FrameworkConfig.getCompanyId().equals(user.getCompanyId())){ |
| | | //ç³»ç»çç®¡è´¦å· |
| | | return companyService.getAllData(user.getCompanyId()); |
| | | //ç³»ç»ç管账å·ï¼è·åç»ç»ä¸ææå
¬å¸ä¿¡æ¯ |
| | | return companyService.listCompany(null, user.getCompanyId(), null); |
| | | }else { |
| | | //æ¶å¨å
¬å¸è´¦å· |
| | | return companyService.getDataById(user.getCompanyId()); |
| | | //æ¶å¨å
¬å¸è´¦å·ï¼åªè·åå½åå
¬å¸ä¿¡æ¯ |
| | | return companyService.listCompany(user.getCompanyId(), null, null); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * è·åå
¬å¸ä¸å±åºåºå表 |
| | | * selectDeptPR#listArea |
| | | * @param id |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<Dept> listArea(String id){ |
| | | return deptService.getDataByParentId(id); |
| | | public List<Dept> listArea(String parentId){ |
| | | return deptService.listDept(null,null, parentId); |
| | | } |
| | | } |
| | |
| | | <PropertyDef name="companyId"> |
| | | <Property/> |
| | | </PropertyDef> |
| | | <PropertyDef name="depotId"> |
| | | <Property/> |
| | | </PropertyDef> |
| | | <PropertyDef name="deptId"> |
| | | <Property/> |
| | | </PropertyDef> |
| | | <PropertyDef name="depotId"> |
| | | <Property/> |
| | | <Property name="label">è£
å¸ä»åº</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="customerName"> |
| | | <Property/> |
| | |
| | | <PropertyDef name="foodVariety"> |
| | | <Property/> |
| | | <Property name="label">ç²®é£åç§</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("dicPR#sysDictData").getResult("FOOD_VARIETY_")}</Property> |
| | | <Property name="keyProperty">dictValue</Property> |
| | | <Property name="valueProperty">dictLabel</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="contractId"> |
| | | <Property/> |
| | |
| | | <PropertyDef name="completeStatus"> |
| | | <Property/> |
| | | <Property name="label">å®æç¶æ</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues"> |
| | | <Collection> |
| | | <Entity> |
| | | <Property name="name">æªå®æ</Property> |
| | | <Property name="code">NONE</Property> |
| | | </Entity> |
| | | <Entity> |
| | | <Property name="name">已宿</Property> |
| | | <Property name="code">COMPLETE</Property> |
| | | </Entity> |
| | | </Collection> |
| | | </Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="storageReal"> |
| | | <Property name="dataType">Double</Property> |
| | |
| | | if(i > 0){ |
| | | if (Constant.DEPT_TYPE_10.equals(dept.getType())) { |
| | | //æ°å¢å
¬å¸ä¿¡æ¯ |
| | | coreCompanyService.saveOrUpdate(dept); |
| | | coreCompanyService.saveOrUpdate(dept, true); |
| | | } |
| | | if (Constant.DEPT_TYPE_20.equals(dept.getType())) { |
| | | //æ°å¢åºåºä¿¡æ¯ |
| | | coreDeptService.saveOrUpdate(dept); |
| | | coreDeptService.saveOrUpdate(dept, true); |
| | | } |
| | | } |
| | | return toAjax(i); |
| | |
| | | if(i > 0){ |
| | | if (Constant.DEPT_TYPE_10.equals(dept.getType())) { |
| | | //æ°å¢å
¬å¸ä¿¡æ¯ |
| | | coreCompanyService.saveOrUpdate(dept); |
| | | coreCompanyService.saveOrUpdate(dept, false); |
| | | } |
| | | if (Constant.DEPT_TYPE_20.equals(dept.getType())) { |
| | | //æ°å¢åºåºä¿¡æ¯ |
| | | coreDeptService.saveOrUpdate(dept); |
| | | coreDeptService.saveOrUpdate(dept, false); |
| | | } |
| | | } |
| | | return toAjax(i); |