feat: 装修测量阶段+设计阶段流程优化
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.DecorationDesignInfoDO;
|
||||
import com.cool.store.entity.DecorationMeasureDO;
|
||||
import com.cool.store.mapper.DecorationMeasureMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ryan.xu
|
||||
* @date 2025/04/23
|
||||
*/
|
||||
@Repository
|
||||
public class DecorationMeasureDAO {
|
||||
|
||||
@Resource
|
||||
DecorationMeasureMapper decorationMeasureMapper;
|
||||
|
||||
public DecorationMeasureDO getById(Long id) {
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
return decorationMeasureMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<DecorationMeasureDO> getByIds(List<Long> shopIds) {
|
||||
if (CollectionUtils.isEmpty(shopIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Example example = new Example(DecorationDesignInfoDO.class);
|
||||
example.createCriteria().andIn("shopId", shopIds);
|
||||
return decorationMeasureMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public Integer insertSelective(DecorationMeasureDO decorationMeasureDO, String userId) {
|
||||
decorationMeasureDO.setCreateUserId(userId);
|
||||
decorationMeasureDO.setUpdateUserId(userId);
|
||||
decorationMeasureDO.setUpdateTime(new Date());
|
||||
decorationMeasureDO.setCreateTime(new Date());
|
||||
return decorationMeasureMapper.insertSelective(decorationMeasureDO);
|
||||
}
|
||||
|
||||
public Integer updateByPrimaryKeySelective(DecorationMeasureDO decorationMeasureDO, String userId) {
|
||||
decorationMeasureDO.setUpdateUserId(userId);
|
||||
decorationMeasureDO.setUpdateTime(new Date());
|
||||
return decorationMeasureMapper.updateByPrimaryKeySelective(decorationMeasureDO);
|
||||
}
|
||||
|
||||
public DecorationMeasureDO getByShopId(Long shopId) {
|
||||
if (shopId == null) {
|
||||
return null;
|
||||
}
|
||||
return decorationMeasureMapper.selectByShopId(shopId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,110 +28,111 @@ public class EnterpriseUserDAO {
|
||||
private EnterpriseUserMapper enterpriseUserMapper;
|
||||
|
||||
|
||||
public EnterpriseUserDO getUserInfoById(String userId){
|
||||
if(StringUtils.isBlank(userId)){
|
||||
public EnterpriseUserDO getUserInfoById(String userId) {
|
||||
if (StringUtils.isBlank(userId)) {
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoById( userId);
|
||||
return enterpriseUserMapper.getUserInfoById(userId);
|
||||
}
|
||||
|
||||
public EnterpriseUserDO getUserInfoByJobnumber(String jobnumber){
|
||||
if(StringUtils.isBlank(jobnumber)){
|
||||
public EnterpriseUserDO getUserInfoByJobnumber(String jobnumber) {
|
||||
if (StringUtils.isBlank(jobnumber)) {
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoByJobnumber(jobnumber);
|
||||
}
|
||||
|
||||
public EnterpriseUserDO getUserInfoByThirdOaUniqueFlag(String thirdOaUniqueFlag){
|
||||
if(StringUtils.isBlank(thirdOaUniqueFlag)){
|
||||
public EnterpriseUserDO getUserInfoByThirdOaUniqueFlag(String thirdOaUniqueFlag) {
|
||||
if (StringUtils.isBlank(thirdOaUniqueFlag)) {
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoByThirdOaUniqueFlag(thirdOaUniqueFlag);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> getUserInfoByUserIds(List<String> userIdList){
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
public List<EnterpriseUserDO> getUserInfoByUserIds(List<String> userIdList) {
|
||||
if (CollectionUtils.isEmpty(userIdList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoByUserIds( userIdList);
|
||||
return enterpriseUserMapper.getUserInfoByUserIds(userIdList);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(List<String> regionIds, String keyword, List<String> leaderRegionIds){
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
public List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(List<String> regionIds, String keyword, List<String> leaderRegionIds) {
|
||||
if (CollectionUtils.isEmpty(regionIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.searchUserByRegionIdsAndKeyword( regionIds, keyword, leaderRegionIds);
|
||||
return enterpriseUserMapper.searchUserByRegionIdsAndKeyword(regionIds, keyword, leaderRegionIds);
|
||||
}
|
||||
|
||||
public boolean isExistDeptUser(String regionId){
|
||||
if(StringUtils.isBlank(regionId)){
|
||||
public boolean isExistDeptUser(String regionId) {
|
||||
if (StringUtils.isBlank(regionId)) {
|
||||
return false;
|
||||
}
|
||||
return enterpriseUserMapper.getUserCountByRegionId( regionId) > CommonConstants.ZERO;
|
||||
return enterpriseUserMapper.getUserCountByRegionId(regionId) > CommonConstants.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门负责人
|
||||
*
|
||||
* @param regionId
|
||||
* @return
|
||||
*/
|
||||
public List<EnterpriseUserDO> getUserListByDeptLeader(String regionId){
|
||||
if(StringUtils.isBlank(regionId)){
|
||||
public List<EnterpriseUserDO> getUserListByDeptLeader(String regionId) {
|
||||
if (StringUtils.isBlank(regionId)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserListByDeptLeader( regionId);
|
||||
return enterpriseUserMapper.getUserListByDeptLeader(regionId);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> getUserListByDeptLeaders(List<String> regionIds){
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
public List<EnterpriseUserDO> getUserListByDeptLeaders(List<String> regionIds) {
|
||||
if (CollectionUtils.isEmpty(regionIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserListByDeptLeaders( regionIds);
|
||||
return enterpriseUserMapper.getUserListByDeptLeaders(regionIds);
|
||||
}
|
||||
|
||||
|
||||
public List<EnterpriseUserDO> getUserListByRegionIds(List<String> regionIds){
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
public List<EnterpriseUserDO> getUserListByRegionIds(List<String> regionIds) {
|
||||
if (CollectionUtils.isEmpty(regionIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserListByRegionIds( regionIds);
|
||||
return enterpriseUserMapper.getUserListByRegionIds(regionIds);
|
||||
}
|
||||
|
||||
public List<String> getUserIdListByRegionId(Long regionId, List<String> userIdList){
|
||||
if(CollectionUtils.isEmpty(userIdList) || regionId == null){
|
||||
public List<String> getUserIdListByRegionId(Long regionId, List<String> userIdList) {
|
||||
if (CollectionUtils.isEmpty(userIdList) || regionId == null) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserIdListByRegionId(regionId, userIdList);
|
||||
}
|
||||
|
||||
public Map<String, String> getUserNameAndMobile(List<String> userIds){
|
||||
public Map<String, String> getUserNameAndMobile(List<String> userIds) {
|
||||
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
|
||||
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getMobile())).collect(Collectors.toMap(k -> k.getUserId(), v -> v.getName() + " " + v.getMobile()));
|
||||
return userList.stream().filter(o -> !StringUtils.isAnyBlank(o.getMobile())).collect(Collectors.toMap(k -> k.getUserId(), v -> v.getName() + " " + v.getMobile()));
|
||||
}
|
||||
|
||||
public Map<String, String> getUserNameMap(List<String> userIds){
|
||||
public Map<String, String> getUserNameMap(List<String> userIds) {
|
||||
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
|
||||
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getName())).collect(Collectors.toMap(k -> k.getUserId(), v -> v.getName()));
|
||||
return userList.stream().filter(o -> !StringUtils.isAnyBlank(o.getName())).collect(Collectors.toMap(k -> k.getUserId(), v -> v.getName()));
|
||||
}
|
||||
|
||||
public Map<String, EnterpriseUserDO> getUserMap(List<String> userIds){
|
||||
public Map<String, EnterpriseUserDO> getUserMap(List<String> userIds) {
|
||||
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
|
||||
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getMobile(), o.getName())).collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
|
||||
return userList.stream().filter(o -> !StringUtils.isAnyBlank(o.getMobile(), o.getName())).collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
|
||||
}
|
||||
|
||||
public Map<String, EnterpriseUserDO> getUserInfoMap(List<String> userIds){
|
||||
public Map<String, EnterpriseUserDO> getUserInfoMap(List<String> userIds) {
|
||||
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
|
||||
if (CollectionUtils.isEmpty(userList)){
|
||||
if (CollectionUtils.isEmpty(userList)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return userList.stream().collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
|
||||
}
|
||||
|
||||
public EnterpriseUserDO selectByMobile(String mobile) {
|
||||
return enterpriseUserMapper.selectByMobile( mobile);
|
||||
return enterpriseUserMapper.selectByMobile(mobile);
|
||||
}
|
||||
|
||||
public String getUserName(String userId){
|
||||
public String getUserName(String userId) {
|
||||
EnterpriseUserDO userInfo = getUserInfoById(userId);
|
||||
return Optional.ofNullable(userInfo).map(EnterpriseUserDO::getName).orElse(StringUtils.EMPTY);
|
||||
}
|
||||
@@ -140,22 +141,31 @@ public class EnterpriseUserDAO {
|
||||
if (StringUtil.isEmpty(investmentManager)) {
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.selectByInvestmentManager( investmentManager);
|
||||
return enterpriseUserMapper.selectByInvestmentManager(investmentManager);
|
||||
}
|
||||
public List<UserNameDTO> getNameByUserId(List<String> userIdList){
|
||||
|
||||
public List<UserNameDTO> getNameByUserId(List<String> userIdList) {
|
||||
if (CollectionUtils.isEmpty(userIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return enterpriseUserMapper.selectNameByUserId(userIdList);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> getUserListByRegionId(Long regionId){
|
||||
if(regionId == null){
|
||||
public List<EnterpriseUserDO> getUserListByRegionId(Long regionId) {
|
||||
if (regionId == null) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserListByRegionId(regionId);
|
||||
}
|
||||
public List<UserDTO> getAllUser(String eid, String keyword){
|
||||
return enterpriseUserMapper.getAllUser(eid,keyword);
|
||||
|
||||
public List<UserDTO> getAllUser(String eid, String keyword) {
|
||||
return enterpriseUserMapper.getAllUser(eid, keyword);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> findUserInfoByUserIdsAndKeyword(List<String> userIdList, String keyword) {
|
||||
if (CollectionUtils.isEmpty(userIdList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.searchUserByUserIdsAndKeyword(userIdList, keyword);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.DecorationMeasureDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface DecorationMeasureMapper extends Mapper<DecorationMeasureDO> {
|
||||
|
||||
/**
|
||||
* 查询店铺的测量数据
|
||||
*
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
DecorationMeasureDO selectByShopId(Long shopId);
|
||||
|
||||
}
|
||||
@@ -91,4 +91,12 @@ public interface EnterpriseUserMapper {
|
||||
List<EnterpriseUserDO> getUserListByRegionId( @Param("regionId") Long regionId);
|
||||
|
||||
List<UserDTO> getAllUser(@Param("eid")String id, @Param("keyword") String keyword);
|
||||
|
||||
/**
|
||||
* 根据用户id和关键字搜索用户
|
||||
* @param userIdList
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseUserDO> searchUserByUserIdsAndKeyword( @Param("userIdList") List<String> userIdList, @Param("keyword") String keyword);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.DecorationMeasureMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.DecorationMeasureDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="measure_user_id" jdbcType="VARCHAR" property="measureUserId" />
|
||||
<result column="design_user_id" jdbcType="VARCHAR" property="designUserId" />
|
||||
<result column="measure_date" jdbcType="TIMESTAMP" property="measureDate" />
|
||||
<result column="diagram_date" jdbcType="TIMESTAMP" property="diagramDate" />
|
||||
<result column="measure_url" jdbcType="VARCHAR" property="measureUrl" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="submit_time" jdbcType="TIMESTAMP" property="submitTime" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByShopId" resultMap="BaseResultMap">
|
||||
select
|
||||
id,shop_id,measure_user_id,design_user_id,measure_date,diagram_date,measure_url,remark,
|
||||
submit_time,create_time,update_time,deleted,create_user_id,update_user_id
|
||||
from xfsg_decoration_measure where shop_id = #{shopId} and deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -179,4 +179,22 @@
|
||||
and( name like concat('%',#{keyword},'%') or mobile like concat('%',#{keyword},'%'))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="searchUserByUserIdsAndKeyword" resultMap="BaseResultMap">
|
||||
select
|
||||
user_id, name, mobile
|
||||
from
|
||||
enterprise_user_${enterpriseId}
|
||||
<where>
|
||||
active = true
|
||||
<if test="userIdList !=null and userIdList.size>0">
|
||||
<foreach collection="userIdList" item="userId" open="and user_id in (" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="keyword!=null and keyword!=''">
|
||||
and( name like concat('%',#{keyword},'%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user