提交修改
This commit is contained in:
commit
b6058f98df
@ -69,7 +69,7 @@ public class ShiroConfig {
|
||||
filterMap.put("/dtlg/jump", "anon");
|
||||
filterMap.put("/luck/getLuckById", "anon");
|
||||
filterMap.put("/luck/updateLuck", "anon");
|
||||
filterMap.put("/report/**","anon");
|
||||
filterMap.put("/result/**","anon");
|
||||
filterMap.put("/**", "oauth2");
|
||||
shiroFilter.setFilterChainDefinitionMap(filterMap);
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
||||
import com.lz.modules.app.enums.ResultRecordTypeEnum;
|
||||
import com.lz.modules.app.req.ReportListReq;
|
||||
import com.lz.modules.app.req.ResultDistributionReq;
|
||||
import com.lz.modules.app.resp.OwnResultResp;
|
||||
import com.lz.modules.app.resp.ReportChartResp;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
@ -49,13 +50,17 @@ public class ReportResultController extends AbstractController{
|
||||
@Autowired
|
||||
private ChartService chartService;
|
||||
|
||||
static final String[] levels = new String[]{"3.25","3.5-","3.5","3.5+","3.75-","3.75","3.75+","4"};
|
||||
|
||||
|
||||
@RequestMapping("chart")
|
||||
public R reportChart(String selectMonthTime,String departmentId){
|
||||
if(StringUtil.isBlank(selectMonthTime)){
|
||||
selectMonthTime = YearMonth.now().toString();
|
||||
}
|
||||
Long userId = getUserId();
|
||||
//是自己部门得领导
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectByStaffId(userId);
|
||||
if("1".equals(departmentsStaffRelateEntity.getIsLeader())){
|
||||
|
||||
}
|
||||
ReportChartResp reportChartResp = chartService.reportChart(selectMonthTime, departmentId);
|
||||
return R.ok().put("data",reportChartResp);
|
||||
@ -74,6 +79,22 @@ public class ReportResultController extends AbstractController{
|
||||
}
|
||||
|
||||
|
||||
// 未解决问题 部门负责人游离在外 无法统计
|
||||
@RequestMapping("/distribution")
|
||||
public R distribution(ResultDistributionReq req){
|
||||
req.setDepartmentId("1");
|
||||
PageUtils pageUtils = chartService.reportDistribution(req);
|
||||
return R.ok().put("page",pageUtils);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/departmentTreeByStaffId")
|
||||
public R departmentTreeByStaffId(ResultDistributionReq req){
|
||||
//Long userId = getUserId();
|
||||
List<DepartmentsDto> data = departmentsService.getDepartmentTreeByStaffId("303",true);
|
||||
return R.ok().put("data",data);
|
||||
}
|
||||
|
||||
@RequestMapping("/own/result")
|
||||
public R ownResult(Long userId){
|
||||
@ -89,21 +110,7 @@ public class ReportResultController extends AbstractController{
|
||||
|
||||
|
||||
|
||||
//是在这个地方查询出所有的部门选择 还是 通过关键字搜索
|
||||
/* @RequestMapping("underDepartment")
|
||||
public R underDepartment(){
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectByStaffId(null);
|
||||
if(departmentsStaffRelateEntity == null){
|
||||
|
||||
}
|
||||
if(departmentsStaffRelateEntity.getIsLeader().equals(1)){
|
||||
//如果是leader 查询负责几个部门
|
||||
List<DepartmentsDto> departmentsDtos = departmentsService.selectByParentDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||
|
||||
}
|
||||
return R.ok();
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
@ -133,26 +140,3 @@ public class ReportResultController extends AbstractController{
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 0人是否需要展示
|
||||
/* List<GraphicsStatisticalDto> sortStaffLevels = new ArrayList<>();
|
||||
Map<String,Integer> map = Maps.newHashMap();
|
||||
for (GraphicsStatisticalDto staffLevel : staffLevels) {
|
||||
map.put(staffLevel.getCategory(),staffLevel.getNumber());
|
||||
}
|
||||
// 默认等级赋予默认值并排序
|
||||
for (String level : levels) {
|
||||
GraphicsStatisticalDto dto = new GraphicsStatisticalDto();
|
||||
dto.setCategory(level);
|
||||
if(!map.containsKey(level)){
|
||||
dto.setNumber(0);
|
||||
}else {
|
||||
dto.setNumber(map.get(level));
|
||||
}
|
||||
sortStaffLevels.add(dto);
|
||||
}*/
|
||||
@ -1,5 +1,6 @@
|
||||
package com.lz.modules.app.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.lz.modules.app.dto.DepartmentInfos;
|
||||
import com.lz.modules.app.dto.DepartmentsDto;
|
||||
import com.lz.modules.app.dto.StaffDepartmentDto;
|
||||
@ -47,5 +48,7 @@ public interface DepartmentsDao extends BaseMapper<DepartmentsEntity> {
|
||||
|
||||
List<String> selectDepartmentIdsByparentIds(@Param("parentIds") List parentIds);
|
||||
|
||||
List<String> selectDepartmentIdsByparentIds(@Param("parentIds") List parentIds, @Param("page") IPage page);
|
||||
|
||||
List<DepartmentsEntity> selectDeparmentLevel1();
|
||||
}
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
* @Desc:
|
||||
* @Date: 2020/9/24 16:31
|
||||
*/
|
||||
@Data
|
||||
public class ReportDistributionDto {
|
||||
//序号
|
||||
private String departmentId;
|
||||
//业务线
|
||||
private String businessLine;
|
||||
//部门
|
||||
private String departmentName;
|
||||
//3.25
|
||||
private int level1;
|
||||
//3.5-
|
||||
private int level2;
|
||||
//3.5
|
||||
private int level3;
|
||||
//3.5+
|
||||
private int level4;
|
||||
//3.75-
|
||||
private int level5;
|
||||
//3.75
|
||||
private int level6;
|
||||
//3.75+
|
||||
private int level7;
|
||||
//4
|
||||
private int level8;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
* @Desc:
|
||||
* @Date: 2020/9/25 14:24
|
||||
*/
|
||||
public class StaffDepartmentsDto {
|
||||
//父级部门名称
|
||||
private String departmentName;
|
||||
|
||||
//父级部门id
|
||||
private String departmentId;
|
||||
|
||||
//管理得所有部门
|
||||
List<DepartmentsDto> departmentsDtos;
|
||||
|
||||
}
|
||||
@ -1,5 +1,9 @@
|
||||
package com.lz.modules.app.enums;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
* @Desc:
|
||||
@ -11,7 +15,13 @@ public enum ResultRecordStatusEnum {
|
||||
REFUSE(2,"拒绝"),
|
||||
WAIT_COMMIT(3,"侍提交"),
|
||||
AGREE(4,"审批通过"),
|
||||
REJECT(5,"驳回");
|
||||
REJECT(5,"驳回"),
|
||||
APPEAL(6,"申述"),
|
||||
SUSPEND(7,"流程中止"),
|
||||
|
||||
//组合状态
|
||||
PROCESS(108,"审核中"),
|
||||
FINISH(109,"已完成");
|
||||
|
||||
private int status;
|
||||
private String desc;
|
||||
@ -21,6 +31,22 @@ public enum ResultRecordStatusEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static List<Integer> getGroupStatus(Integer status){
|
||||
if(status ==null){
|
||||
return null;
|
||||
}
|
||||
if(status == PROCESS.getStatus()){
|
||||
return Lists.newArrayList(AUDIT.getStatus(),WAIT_COMMIT.getStatus(),REJECT.getStatus(),APPEAL.getStatus());
|
||||
}
|
||||
if(status == FINISH.getStatus()){
|
||||
return Lists.newArrayList(REFUSE.getStatus(),AGREE.getStatus(),SUSPEND.getStatus());
|
||||
}
|
||||
return Lists.newArrayList(status);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.lz.modules.equipment.entity.model.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.YearMonth;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
@ -12,15 +13,23 @@ import java.time.YearMonth;
|
||||
*/
|
||||
@Data
|
||||
public class ReportListReq extends BasePage {
|
||||
String departmentId;
|
||||
|
||||
private String departmentId;
|
||||
|
||||
private String selectMonthTime = YearMonth.now().toString();
|
||||
//提交审核状态
|
||||
private Integer status;
|
||||
//真是查询得状态
|
||||
private List<Integer> realStatus;
|
||||
//目标还是结果
|
||||
private int type =1;
|
||||
|
||||
private String staffName;
|
||||
|
||||
private String level;
|
||||
|
||||
|
||||
//String startMonthTime;
|
||||
|
||||
//String endMonthTime;
|
||||
|
||||
String selectMonthTime = YearMonth.now().toString();
|
||||
//提交审核状态
|
||||
int status =0;
|
||||
//目标还是结果
|
||||
int type =1;
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package com.lz.modules.app.req;
|
||||
|
||||
import com.lz.modules.equipment.entity.model.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.YearMonth;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
* @Desc:
|
||||
* @Date: 2020/9/25 9:30
|
||||
*/
|
||||
@Data
|
||||
public class ResultDistributionReq extends BasePage {
|
||||
private String departmentId = "1";
|
||||
|
||||
private String selectMonthTime = YearMonth.now().toString();
|
||||
}
|
||||
@ -45,5 +45,13 @@ public interface DepartmentsService extends IService<DepartmentsEntity> {
|
||||
|
||||
Map<String,String> selectUserAllDepartmentInFo(String departmentId);
|
||||
|
||||
/**
|
||||
* 获取自己管理得部门列表
|
||||
* @param staffId 人员id
|
||||
* @param containSelf 是否包含本身
|
||||
* @return
|
||||
*/
|
||||
List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -80,6 +80,7 @@ public interface StaffService extends IService<StaffEntity> {
|
||||
|
||||
//查询部门下的所有子部门
|
||||
List<String> selectAllDeparmentIdsByDepartmentParentId(String departmentId);
|
||||
|
||||
//统计部门下的人
|
||||
List<String> staffsByAllDeparmentIds(List<String> deparmentIds);
|
||||
|
||||
|
||||
@ -8,10 +8,14 @@ import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.Query;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.dao.DepartmentsDao;
|
||||
import com.lz.modules.app.dao.DepartmentsStaffRelateDao;
|
||||
import com.lz.modules.app.dao.StaffDao;
|
||||
import com.lz.modules.app.dto.DepartmentInfos;
|
||||
import com.lz.modules.app.dto.DepartmentsDto;
|
||||
import com.lz.modules.app.dto.StaffDepartmentDto;
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@ -30,6 +34,8 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
|
||||
@Resource
|
||||
DepartmentsDao departmentsDao;
|
||||
@Resource
|
||||
DepartmentsStaffRelateDao departmentsStaffRelateDao;
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
@ -188,7 +194,7 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
return new ArrayList<>(set);
|
||||
}
|
||||
|
||||
public void addDD(Set<String> set ,String dd){
|
||||
public void addDD(Set<String> set , String dd){
|
||||
if(StringUtil.isNotBlank(dd)){
|
||||
set.add(dd);
|
||||
}
|
||||
@ -221,4 +227,24 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf) {
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateDao.selectByStaffId(Long.valueOf(staffId));
|
||||
List<DepartmentsDto> departmentsParentsList = departmentsDao.getDepartmentsByparentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||
getDepartmentTreeList(departmentsParentsList);
|
||||
if(containSelf){
|
||||
List<DepartmentsDto> result = new ArrayList<>();
|
||||
DepartmentsDto departmentsDto = new DepartmentsDto();
|
||||
departmentsDto.setDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||
departmentsDto.setDepartmentName(departmentsEntity.getDepartmentName());
|
||||
departmentsDto.setMemberCount(departmentsEntity.getMemberCount());
|
||||
departmentsDto.setList(departmentsParentsList);
|
||||
result.add(departmentsDto);
|
||||
return result;
|
||||
}
|
||||
return departmentsParentsList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -392,14 +392,15 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
||||
}
|
||||
List<String> parentsIds = Lists.newArrayList(departmentId);
|
||||
List<String> departmentsList = new ArrayList<>();
|
||||
departmentsList.addAll(parentsIds);
|
||||
List<String> childs = departmentsDao.selectDepartmentIdsByparentIds(parentsIds);
|
||||
if(CollectionUtils.isEmpty(childs)){
|
||||
departmentsList.addAll(parentsIds);
|
||||
return departmentsList;
|
||||
}
|
||||
departmentsList.addAll(childs);
|
||||
List<String> allChilds = getAllChilds(departmentsList, childs);
|
||||
return allChilds;
|
||||
allChilds.remove("1");
|
||||
return allChilds.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@ -408,7 +409,7 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
||||
if(CollectionUtils.isEmpty(deparmentIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
//获取所有子部门
|
||||
//获取所有人员
|
||||
List<DepartmentsStaffRelateEntity> list = departmentsStaffRelateService.list(new QueryWrapper<DepartmentsStaffRelateEntity>()
|
||||
.select("staff_id")
|
||||
.eq("is_delete", 0)
|
||||
|
||||
@ -9,6 +9,7 @@ import com.lz.modules.equipment.entity.EquipmentBrandReq;
|
||||
import com.lz.modules.equipment.entity.EquipmentType;
|
||||
import com.lz.modules.equipment.entity.resp.EquipmentBrandResp;
|
||||
import com.lz.modules.equipment.service.EquipmentBrandService;
|
||||
import com.lz.modules.equipment.service.IEquipmentInfoService;
|
||||
import com.lz.modules.equipment.service.IEquipmentTypeService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -39,6 +40,9 @@ public class EquipmentBrandController {
|
||||
@Autowired
|
||||
private IEquipmentTypeService equipmentTypeService;
|
||||
|
||||
@Resource
|
||||
private IEquipmentInfoService equipmentInfoService;
|
||||
|
||||
/**
|
||||
* 添加品牌表页面
|
||||
*
|
||||
@ -91,6 +95,7 @@ public class EquipmentBrandController {
|
||||
EquipmentBrand equipmentBrand = equipmentBrandService.selectEquipmentBrandById(req.getId());
|
||||
BeanUtils.copyProperty(equipmentBrand, req, true);
|
||||
equipmentBrandService.updateEquipmentBrandById(equipmentBrand);
|
||||
equipmentInfoService.updateCoverEquipmentInfoByBrandId(equipmentBrand.getId(), equipmentBrand.getBrand());
|
||||
return R.ok("编辑成功");
|
||||
}
|
||||
|
||||
|
||||
@ -64,23 +64,27 @@ public class EquipmentController extends AbstractController {
|
||||
return R.ok();
|
||||
}
|
||||
FindEquipmentResModel model = new FindEquipmentResModel();
|
||||
/*//下面的逻辑有bug下周修复20200925 20200927修复,注释掉
|
||||
EquipmentType equipmentType = iEquipmentTypeService.selectByType(equipmentInfo.getType());
|
||||
EquipmentBrand equipmentBrand = equipmentBrandService.selectByBrand(equipmentInfo.getBrandName());
|
||||
EquipmentSpecs equipmentSpecs = equipmentSpecsService.selectSpecs(equipmentInfo.getSpecType());
|
||||
EquipmentSpecs equipmentSpecs = equipmentSpecsService.selectSpecs(equipmentInfo.getSpecType());*/
|
||||
BeanUtils.copyProperties(equipmentInfo,model);
|
||||
model.setState(equipmentInfo.getEquipmentState());
|
||||
if(equipmentInfo.getSaiId()!=null){
|
||||
model.setUserId(equipmentInfo.getSaiId());
|
||||
model.setEmployee(false);
|
||||
}
|
||||
Optional.ofNullable(equipmentType).ifPresent(equipmentType1 -> model.setTypeId(equipmentType1.getId()));
|
||||
model.setTypeId(equipmentInfo.getTypeId());
|
||||
model.setBrandId(equipmentInfo.getBrandId());
|
||||
model.setSpecId(equipmentInfo.getSpecsId());
|
||||
/*Optional.ofNullable(equipmentType).ifPresent(equipmentType1 -> model.setTypeId(equipmentType1.getId()));
|
||||
Optional.ofNullable(equipmentBrand).ifPresent(equipmentBrand1 -> model.setBrandId(equipmentBrand1.getId()));
|
||||
Optional.ofNullable(equipmentSpecs).ifPresent(new Consumer<EquipmentSpecs>() {
|
||||
@Override
|
||||
public void accept(EquipmentSpecs equipmentSpecs1) {
|
||||
model.setSpecId(equipmentSpecs1.getId());
|
||||
}
|
||||
});
|
||||
});*/
|
||||
addRecord(equipmentInfo);
|
||||
return R.ok().put("data", model);
|
||||
|
||||
@ -112,8 +116,8 @@ public class EquipmentController extends AbstractController {
|
||||
try {
|
||||
iEquipmentInfoService.changeEquipmentInfo(dto,getUser());
|
||||
} catch (Exception e) {
|
||||
log.error("绑定设备异常",e);
|
||||
return R.error();
|
||||
log.error("绑定设备异常{}",e);
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import com.lz.modules.equipment.entity.EquipmentType;
|
||||
import com.lz.modules.equipment.entity.resp.EquipmentSpecsResp;
|
||||
import com.lz.modules.equipment.service.EquipmentBrandService;
|
||||
import com.lz.modules.equipment.service.EquipmentSpecsService;
|
||||
import com.lz.modules.equipment.service.IEquipmentInfoService;
|
||||
import com.lz.modules.equipment.service.IEquipmentTypeService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -40,6 +41,9 @@ public class EquipmentSpecsController {
|
||||
@Autowired
|
||||
private EquipmentBrandService equipmentBrandService;
|
||||
|
||||
@Resource
|
||||
private IEquipmentInfoService equipmentInfoService;
|
||||
|
||||
/**
|
||||
* 添加规格表页面
|
||||
*
|
||||
@ -97,6 +101,7 @@ public class EquipmentSpecsController {
|
||||
equipmentSpecs.setGmtCreate(equipmentSpecs.getGmtCreate());
|
||||
equipmentSpecs.setGmtModified(new Date());
|
||||
equipmentSpecsService.updateEquipmentSpecsById(equipmentSpecs);
|
||||
equipmentInfoService.updateCoverEquipmentInfoBySpecsId(equipmentSpecs.getId(), equipmentSpecs.getSpecs());
|
||||
return R.ok("编辑成功");
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import com.lz.common.utils.R;
|
||||
import com.lz.modules.app.utils.BeanUtils;
|
||||
import com.lz.modules.equipment.entity.EquipmentType;
|
||||
import com.lz.modules.equipment.entity.EquipmentTypeReq;
|
||||
import com.lz.modules.equipment.service.IEquipmentInfoService;
|
||||
import com.lz.modules.equipment.service.IEquipmentTypeService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -29,6 +30,9 @@ public class EquipmentTypeController {
|
||||
@Resource
|
||||
private IEquipmentTypeService equipmentTypeService;
|
||||
|
||||
@Resource
|
||||
private IEquipmentInfoService equipmentInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 添加类型表页面
|
||||
@ -79,6 +83,8 @@ public class EquipmentTypeController {
|
||||
EquipmentType equipmentType = equipmentTypeService.selectEquipmentTypeById(req.getId());
|
||||
BeanUtils.copyProperty(equipmentType,req,true);
|
||||
equipmentTypeService.updateEquipmentTypeById(equipmentType);
|
||||
//更新所有再记录中所有的类型名称
|
||||
equipmentInfoService.updateCoverEquipmentInfoByTypeId(equipmentType.getId(), equipmentType.getType());
|
||||
return R.ok("编辑成功");
|
||||
}
|
||||
|
||||
|
||||
@ -54,4 +54,8 @@ public interface EquipmentInfoMapper extends BaseMapper<EquipmentInfo> {
|
||||
int selectCountByNotFind(@Param("num") Integer num);
|
||||
|
||||
int selectCountAllDepartment(@Param("num") Integer num);
|
||||
|
||||
int updateCoverEquipmentInfoByTypeId(@Param("id") Long id, @Param("type") String type);
|
||||
int updateCoverEquipmentInfoByBrandId(@Param("id") Long id, @Param("brand") String brand);
|
||||
int updateCoverEquipmentInfoBySpecsId(@Param("id") Long id, @Param("specs") String specs);
|
||||
}
|
||||
@ -67,6 +67,13 @@ public class EquipmentInfo implements java.io.Serializable {
|
||||
private Long saiId;
|
||||
//第几次盘点
|
||||
private Integer count;
|
||||
|
||||
//类型id
|
||||
private Long typeId;
|
||||
//品牌id
|
||||
private Long brandId;
|
||||
//规格id
|
||||
private Long specsId;
|
||||
/**
|
||||
* 主键id
|
||||
* @return
|
||||
@ -427,6 +434,30 @@ public class EquipmentInfo implements java.io.Serializable {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public Long getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(Long typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public Long getBrandId() {
|
||||
return brandId;
|
||||
}
|
||||
|
||||
public void setBrandId(Long brandId) {
|
||||
this.brandId = brandId;
|
||||
}
|
||||
|
||||
public Long getSpecsId() {
|
||||
return specsId;
|
||||
}
|
||||
|
||||
public void setSpecsId(Long specsId) {
|
||||
this.specsId = specsId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EquipmentInfo{" +
|
||||
@ -454,6 +485,9 @@ public class EquipmentInfo implements java.io.Serializable {
|
||||
",userId=" + userId +
|
||||
",saiId=" + saiId +
|
||||
",count=" + count +
|
||||
",typeId=" + typeId +
|
||||
",brandId=" + brandId +
|
||||
",specsId=" + specsId +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -61,4 +61,10 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> {
|
||||
int selectCountByNotFind(Integer num);
|
||||
|
||||
int selectCountAllDepartment(int num);
|
||||
|
||||
int updateCoverEquipmentInfoByTypeId(Long id, String type);
|
||||
|
||||
int updateCoverEquipmentInfoByBrandId(Long id, String brand);
|
||||
|
||||
int updateCoverEquipmentInfoBySpecsId(Long id, String specs);
|
||||
}
|
||||
@ -108,13 +108,13 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
EquipmentBrand equipmentBrand = equipmentBrandMapper.selectEquipmentBrandById(dto.getBrandId());
|
||||
EquipmentSpecs equipmentSpecs = equipmentSpecsMapper.selectEquipmentSpecsById(dto.getSpecId());
|
||||
if(equipmentType==null){
|
||||
throw new ZSException("设备类型错误");
|
||||
throw new ZSException("设备类型错误,不存在或被删除");
|
||||
}
|
||||
if(equipmentBrand==null){
|
||||
throw new ZSException("设备品牌错误");
|
||||
throw new ZSException("设备品牌错误,不存在或被删除");
|
||||
}
|
||||
if(equipmentSpecs==null){
|
||||
throw new ZSException("设备规格错误");
|
||||
throw new ZSException("设备规格错误,不存在或被删除");
|
||||
}
|
||||
|
||||
EquipmentInfo info = equipmentInfoMapper.selectEquipmentInfoById(dto.getId());
|
||||
@ -302,4 +302,19 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
public int selectCountAllDepartment(int num) {
|
||||
return equipmentInfoMapper.selectCountAllDepartment(num);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCoverEquipmentInfoByTypeId(Long id, String type){
|
||||
return equipmentInfoMapper.updateCoverEquipmentInfoByTypeId(id, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCoverEquipmentInfoByBrandId(Long id, String brand){
|
||||
return equipmentInfoMapper.updateCoverEquipmentInfoByBrandId(id, brand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCoverEquipmentInfoBySpecsId(Long id, String specs){
|
||||
return equipmentInfoMapper.updateCoverEquipmentInfoBySpecsId(id, specs);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||
import com.lz.modules.app.dto.ReportProgressListDto;
|
||||
import com.lz.modules.app.req.ReportListReq;
|
||||
import com.lz.modules.app.req.ResultRecordReq;
|
||||
import com.lz.modules.app.resp.OwnResultResp;
|
||||
import com.lz.modules.flow.model.ResultRecordDto;
|
||||
@ -61,5 +62,5 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
||||
|
||||
ResultRecord selectResultRecordByStaffIdStatus(@Param("staffId") Long staffId, @Param("status") int status);
|
||||
|
||||
List<ReportProgressListDto> targetReportList(@Param("monthTime") String monthTime,@Param("staffIds") List<String> staffIds,@Param("page") IPage page);
|
||||
List<ReportProgressListDto> targetReportList(@Param("req")ReportListReq req, @Param("staffIds") List<String> staffIds, @Param("page") IPage page);
|
||||
}
|
||||
@ -1,9 +1,12 @@
|
||||
package com.lz.modules.sys.service.app;
|
||||
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.modules.app.dto.DepartmentsDto;
|
||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||
import com.lz.modules.app.dto.ReportDistributionDto;
|
||||
import com.lz.modules.app.dto.ReportProgressListDto;
|
||||
import com.lz.modules.app.req.ReportListReq;
|
||||
import com.lz.modules.app.req.ResultDistributionReq;
|
||||
import com.lz.modules.app.resp.ReportChartResp;
|
||||
|
||||
import java.util.List;
|
||||
@ -27,6 +30,11 @@ public interface ChartService {
|
||||
|
||||
ReportChartResp reportChart(String selectMonthTime, String departmentId);
|
||||
|
||||
PageUtils reportDistribution(ResultDistributionReq req);
|
||||
|
||||
String businessLineByStaffId(String staffId);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,25 +1,31 @@
|
||||
package com.lz.modules.sys.service.app.impl;
|
||||
|
||||
import cn.hutool.core.util.PageUtil;
|
||||
import com.alibaba.druid.sql.PagerUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.lz.common.utils.BigDecimalUtil;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.dao.DepartmentsDao;
|
||||
import com.lz.modules.app.dao.DepartmentsStaffRelateDao;
|
||||
import com.lz.modules.app.dao.StaffDao;
|
||||
import com.lz.modules.app.dto.CharBarDto;
|
||||
import com.lz.modules.app.dto.GraphicsDto;
|
||||
import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
||||
import com.lz.modules.app.dto.ReportProgressListDto;
|
||||
import com.lz.modules.app.dto.*;
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
||||
import com.lz.modules.app.enums.ResultRecordTypeEnum;
|
||||
import com.lz.modules.app.req.ReportListReq;
|
||||
import com.lz.modules.app.req.ResultDistributionReq;
|
||||
import com.lz.modules.app.resp.ReportChartResp;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||
import com.lz.modules.sys.service.app.ChartService;
|
||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import com.sun.org.apache.regexp.internal.RE;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -28,8 +34,10 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -50,6 +58,11 @@ public class ChartServiceImpl implements ChartService {
|
||||
private DepartmentsStaffRelateDao departmentsStaffRelateDao;
|
||||
@Autowired
|
||||
private StaffDao staffDao;
|
||||
@Autowired
|
||||
private DepartmentsDao departmentsDao;
|
||||
|
||||
static final String[] levels = new String[]{"3.25","3.5-","3.5","3.5+","3.75-","3.75","3.75+","4"};
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphicsStatisticalDto> resultProgressDistribution(int type, String monthTime,String departmentId) {
|
||||
@ -68,7 +81,7 @@ public class ChartServiceImpl implements ChartService {
|
||||
.eq("is_delete", 0)
|
||||
.eq("type", type)
|
||||
.like("month_time",monthTime)
|
||||
.in("status", ResultRecordStatusEnum.REFUSE.getStatus(),ResultRecordStatusEnum.AGREE.getStatus()));
|
||||
.in("status", ResultRecordStatusEnum.REFUSE.getStatus(),ResultRecordStatusEnum.AGREE.getStatus(),ResultRecordStatusEnum.SUSPEND.getStatus()));
|
||||
|
||||
GraphicsStatisticalDto dto = new GraphicsStatisticalDto();
|
||||
if(total-commit>0){
|
||||
@ -133,13 +146,14 @@ public class ChartServiceImpl implements ChartService {
|
||||
@Override
|
||||
public PageUtils resultReportList(ReportListReq req, List<String> staffIds) {
|
||||
// 状态为0的数据存在两张表,单独处理
|
||||
if(req.getStatus()!=0){
|
||||
if(!"0".equals(req.getStatus())){
|
||||
//获取真实状态
|
||||
List<Integer> groupStatus = ResultRecordStatusEnum.getGroupStatus(req.getStatus());
|
||||
req.setRealStatus(groupStatus);
|
||||
//获取处理过业绩目标的人员
|
||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
|
||||
page -> resultRecordMapper.targetReportList(req.getSelectMonthTime(), staffIds, page)
|
||||
page -> resultRecordMapper.targetReportList(req, staffIds, page)
|
||||
);
|
||||
List<ReportProgressListDto> list = pageUtils.getList();
|
||||
|
||||
return pageUtils;
|
||||
|
||||
}else {
|
||||
@ -152,7 +166,7 @@ public class ChartServiceImpl implements ChartService {
|
||||
.ne("status", ResultRecordStatusEnum.CREATE.getStatus())
|
||||
.select("staff_id"));
|
||||
if(CollectionUtils.isNotEmpty(collect)){
|
||||
commitStaffIds = collect.stream().map((Function<Object, String>) o -> o.toString()).collect(Collectors.toList());
|
||||
commitStaffIds = collect.stream().map(o -> o.toString()).collect(Collectors.toList());
|
||||
}
|
||||
//去除已经提交的
|
||||
staffIds.removeAll(commitStaffIds);
|
||||
@ -173,4 +187,119 @@ public class ChartServiceImpl implements ChartService {
|
||||
return pageUtils;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils reportDistribution(ResultDistributionReq req) {
|
||||
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
|
||||
// 去除存在子部门得id
|
||||
allDeparmentIds.removeIf(s -> {
|
||||
List<DepartmentsEntity> departmentsEntities = departmentsDao.selectEntityByParentDepartmentId(s);
|
||||
if(CollectionUtils.isNotEmpty(departmentsEntities)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// 由于deparmentIds 递归所得无法分页 则list分页
|
||||
List<String> list = startPage(allDeparmentIds, req.getCurrPage(), req.getPageSize());
|
||||
return buildPages(list,req,allDeparmentIds.size());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String businessLineByStaffId(String staffId) {
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateDao.selectByStaffId(Long.valueOf(staffId));
|
||||
String departmentId = departmentsStaffRelateEntity.getDepartmentId();
|
||||
return getBussinessLine(departmentId);
|
||||
}
|
||||
|
||||
private String getBussinessLine(String departmentId){
|
||||
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentId);
|
||||
if("1".equals(departmentsEntity.getDepartmentParentId())){
|
||||
return departmentsEntity.getDepartmentName();
|
||||
}
|
||||
return getBussinessLine(departmentsEntity.getDepartmentParentId());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private PageUtils buildPages( List<String> departments,ResultDistributionReq req, int totalSize){
|
||||
List<ReportDistributionDto> data = new ArrayList<>();
|
||||
if(CollectionUtils.isEmpty(departments)){
|
||||
return new PageUtils();
|
||||
}
|
||||
departments.forEach(s -> {
|
||||
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(s);
|
||||
List<DepartmentsEntity> departmentsEntities = departmentsDao.selectEntityByParentDepartmentId(departmentsEntity.getDepartmentParentId());
|
||||
List<String> staffIds = staffService.staffsByAllDeparmentIds(Lists.newArrayList(s));
|
||||
List<GraphicsStatisticalDto> staffLevels = resultRecordService.staffDistribution(req.getSelectMonthTime(),staffIds);
|
||||
Map<String,Integer> map = Maps.newHashMap();
|
||||
for (GraphicsStatisticalDto staffLevel : staffLevels) {
|
||||
map.put(staffLevel.getCategory(),staffLevel.getNumber());
|
||||
}
|
||||
ReportDistributionDto dto = new ReportDistributionDto();
|
||||
dto.setDepartmentId(s);
|
||||
dto.setDepartmentName(departmentsEntity.getDepartmentName());
|
||||
dto.setBusinessLine(getBussinessLine(s));
|
||||
dto.setLevel1(map.get(levels[0])==null?0:map.get(levels[0]));
|
||||
dto.setLevel2(map.get(levels[1])==null?0:map.get(levels[1]));
|
||||
dto.setLevel3(map.get(levels[2])==null?0:map.get(levels[2]));
|
||||
dto.setLevel4(map.get(levels[3])==null?0:map.get(levels[3]));
|
||||
dto.setLevel5(map.get(levels[4])==null?0:map.get(levels[4]));
|
||||
dto.setLevel6(map.get(levels[5])==null?0:map.get(levels[5]));
|
||||
dto.setLevel7(map.get(levels[6])==null?0:map.get(levels[6]));
|
||||
dto.setLevel8(map.get(levels[7])==null?0:map.get(levels[7]));
|
||||
data.add(dto);
|
||||
|
||||
});
|
||||
|
||||
PageUtils result = new PageUtils();
|
||||
result.setList(data);
|
||||
result.setTotalCount(totalSize);
|
||||
result.setCurrPage(req.getCurrPage());
|
||||
result.setPageSize(req.getPageSize());
|
||||
result.setTotalPage(PageUtil.totalPage(totalSize,req.getPageSize()));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List startPage(List list, Integer pageNum,
|
||||
Integer pageSize) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Integer count = list.size(); // 记录总数
|
||||
Integer pageCount = 0; // 页数
|
||||
if (count % pageSize == 0) {
|
||||
pageCount = count / pageSize;
|
||||
} else {
|
||||
pageCount = count / pageSize + 1;
|
||||
}
|
||||
|
||||
int fromIndex = 0; // 开始索引
|
||||
int toIndex = 0; // 结束索引
|
||||
|
||||
if (!Objects.equals(pageNum, pageCount)) {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = fromIndex + pageSize;
|
||||
} else {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = count;
|
||||
}
|
||||
|
||||
List pageList = list.subList(fromIndex, toIndex);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
private boolean hasPermissions(Long staffId){
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -273,10 +273,12 @@
|
||||
<select id="staffDistribution" resultType="com.lz.modules.app.dto.GraphicsStatisticalDto">
|
||||
SELECT count(score_level) number ,score_level category from lz_result_record where
|
||||
is_delete = 0 and status =4 and type =2 and score_level !=0 and DATE_FORMAT(month_time,'%Y-%m') = #{monthTime}
|
||||
and staff_id in
|
||||
<foreach collection="staffIds" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="staffIds !=null and staffIds.size()>0">
|
||||
and staff_id in
|
||||
<foreach collection="staffIds" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY score_level
|
||||
</select>
|
||||
|
||||
@ -293,10 +295,27 @@
|
||||
LEFT JOIN lz_staff_occupation o
|
||||
on r.staff_id = o.staff_id
|
||||
where r.is_delete=0 and o.is_delete=0 and type = 1
|
||||
and r.staff_id in
|
||||
<foreach collection="staffIds" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="staffIds !=null and staffIds.size() !=0">
|
||||
and r.staff_id in
|
||||
<foreach collection="staffIds" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="req.staffName !=null and req.staffName != ''">
|
||||
and r.staff_name like concat('%',#{req.staffName},'%')
|
||||
</if>
|
||||
<if test="req.level !=null and req.level != ''">
|
||||
and r.score_level = #{req.level}
|
||||
</if>
|
||||
<if test="req.realStatus !=null and req.realStatus.size() !=0">
|
||||
and r.status in
|
||||
<foreach collection="req.realStatus" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="req.selectMonthTime !=null">
|
||||
|
||||
</if>
|
||||
GROUP BY r.staff_id
|
||||
|
||||
|
||||
|
||||
@ -28,12 +28,15 @@
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="sai_id" property="saiId"/>
|
||||
<result column="count" property="count"/>
|
||||
<result column="type_id" property="typeId"/>
|
||||
<result column="brand_id" property="brandId"/>
|
||||
<result column="specs_di" property="specsId"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, brand_name AS brandName, spec_type AS specType, type AS type, num AS num, unit AS unit, user AS user, owner AS owner, qr AS qr, original_code AS originalCode, code AS code, mark AS mark, gmt_outbound AS gmtOutbound, gmt_inbound AS gmtInbound, equipment_state AS equipmentState, buy_amount AS buyAmount, sale_amount AS saleAmount, no AS no, user_id AS userId, sai_id AS saiId, count AS count
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, brand_name AS brandName, spec_type AS specType, type AS type, num AS num, unit AS unit, user AS user, owner AS owner, qr AS qr, original_code AS originalCode, code AS code, mark AS mark, gmt_outbound AS gmtOutbound, gmt_inbound AS gmtInbound, equipment_state AS equipmentState, buy_amount AS buyAmount, sale_amount AS saleAmount, no AS no, user_id AS userId, sai_id AS saiId, count AS count, type_id AS typeId, brand_id AS brandId, specs_id AS specsId
|
||||
</sql>
|
||||
|
||||
|
||||
@ -65,6 +68,9 @@
|
||||
<if test="no != null">no, </if>
|
||||
<if test="userId != null">user_id, </if>
|
||||
<if test="saiId != null">sai_id, </if>
|
||||
<if test="typeId != null">type_id, </if>
|
||||
<if test="brandId != null">brand_id, </if>
|
||||
<if test="specsId != null">specs_id, </if>
|
||||
<if test="count != null">count, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
@ -89,6 +95,9 @@
|
||||
<if test="no != null">#{ no}, </if>
|
||||
<if test="userId != null">#{ userId}, </if>
|
||||
<if test="saiId != null">#{ saiId}, </if>
|
||||
<if test="typeId != null">#{typeId}, </if>
|
||||
<if test="brandId != null">#{brandId}, </if>
|
||||
<if test="specsId != null">#{specsId]}, </if>
|
||||
<if test="count != null">#{ count}, </if>
|
||||
0,
|
||||
now(),
|
||||
@ -122,6 +131,9 @@
|
||||
<if test="no != null">no = #{no},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="saiId != null">sai_id = #{saiId},</if>
|
||||
<if test="typeId != null">type_id=#{typeId}, </if>
|
||||
<if test="brandId != null">brand_id=#{brandId}, </if>
|
||||
<if test="specsId != null">specs_id=#{specsId]}, </if>
|
||||
<if test="count != null">count = #{count}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
@ -154,6 +166,9 @@
|
||||
no = #{no},
|
||||
user_id = #{userId},
|
||||
sai_id = #{saiId},
|
||||
type_id=#{typeId},
|
||||
brand_id=#{brandId},
|
||||
specs_id=#{specsId},
|
||||
count = #{count}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
@ -278,5 +293,17 @@
|
||||
select ifnull(count(*),0) from equipment_info where is_delete = 0 and count =#{num} and depart_id is not null and depart_id > 0
|
||||
</select>
|
||||
|
||||
<update id="updateCoverEquipmentInfoByTypeId" parameterType="java.lang.Long">
|
||||
update equipment_info set type = #{type} where type_id=#{id}
|
||||
</update>
|
||||
|
||||
<update id="updateCoverEquipmentInfoByBrandId" parameterType="java.lang.Long">
|
||||
update equipment_info set brand_name = #{brand} where type_id=#{id}
|
||||
</update>
|
||||
|
||||
<update id="updateCoverEquipmentInfoBySpecsId" parameterType="java.lang.Long">
|
||||
update equipment_info set spec_type = #{specs} where type_id=#{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@
|
||||
|
||||
<select id="selectEquipmentSpecsByTypeBrandLikeSpecss"
|
||||
resultType="com.lz.modules.equipment.entity.EquipmentSpecs">
|
||||
select * from equipment_specs where is_delete = 0 and type_id = #{typeId} and brand_id=#{brandId} and specs like concat('%',#{specs},'%')
|
||||
select * from equipment_specs where is_delete = 0 and type_id = #{typeId} and brand_id=#{brandId} and specs like concat('%',#{specs},'%')
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@ -119,11 +119,15 @@
|
||||
|
||||
|
||||
<select id="selectDepartmentIdsByparentIds" resultType="String">
|
||||
select department_id from lz_departments where is_delete=0 and department_parent_id IN
|
||||
<foreach collection="parentIds" item="id" open="(" close=")"
|
||||
separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
select department_id from lz_departments where is_delete=0
|
||||
<if test="parentIds !=null and parentIds.size>0">
|
||||
and department_parent_id IN
|
||||
<foreach collection="parentIds" item="id" open="(" close=")"
|
||||
separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user