feat:医共体

dev_unify
chenhc 3 months ago
parent 2fd90c032d
commit 3a9cd5629a

@ -15,6 +15,7 @@ import com.glxp.api.controller.BaseController;
import com.glxp.api.dto.DictDto; import com.glxp.api.dto.DictDto;
import com.glxp.api.entity.auth.*; import com.glxp.api.entity.auth.*;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.req.auth.*; import com.glxp.api.req.auth.*;
import com.glxp.api.req.basic.FilterBussinessTypeRequest; import com.glxp.api.req.basic.FilterBussinessTypeRequest;
import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.req.system.DeleteRequest;
@ -25,8 +26,10 @@ import com.glxp.api.res.auth.InvWarehouseThirdSysResponse;
import com.glxp.api.res.basic.BasicBussinessTypeResponse; import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import com.glxp.api.service.auth.*; import com.glxp.api.service.auth.*;
import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.system.CompanyService;
import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.IntUtil; import com.glxp.api.util.IntUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -48,6 +51,8 @@ public class InvWarehouseController extends BaseController {
@Resource @Resource
CustomerService customerService; CustomerService customerService;
@Resource @Resource
CompanyService companyService;
@Resource
private WarehouseUserService warehouseUserService; private WarehouseUserService warehouseUserService;
@Resource @Resource
private SystemParamConfigService systemParamConfigService; private SystemParamConfigService systemParamConfigService;
@ -59,6 +64,8 @@ public class InvWarehouseController extends BaseController {
private InvSpaceService invSpaceService; private InvSpaceService invSpaceService;
@Resource @Resource
InvBusUserService invBusUserService; InvBusUserService invBusUserService;
@Resource
AuthWarehouseUnifyService authWarehouseUnifyService;
/** /**
* *
@ -664,4 +671,76 @@ public class InvWarehouseController extends BaseController {
return ResultVOUtils.success(list); return ResultVOUtils.success(list);
} }
@GetMapping("spms/sub/inv/unifyWarehouseList")
public BaseResponse unifyWarehouseList() {
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
filterInvSubWarehouseRequest.setUnifyUse(true);
filterInvSubWarehouseRequest.setSpUse(true);
List<InvWarehouseEntity> responses = invWarehouseService.unifyWarehouseList(filterInvSubWarehouseRequest);
return ResultVOUtils.success(responses);
}
/**
*
*/
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/warehouseListByCode")
public BaseResponse warehouseListByCode(@RequestBody @Valid FilterInvLinkDataRequest filterInvLinkDataRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<CompanyEntity> warehouseUserList = warehouseUserService.warehouseListByCode(filterInvLinkDataRequest);
PageInfo<CompanyEntity> pageInfo = new PageInfo<>(warehouseUserList);
PageSimpleResponse<CompanyEntity> response = new PageSimpleResponse<>();
response.setList(pageInfo.getList());
response.setTotal(pageInfo.getTotal());
return ResultVOUtils.success(response);
}
/**
*
*
* @return
*/
@AuthRuleAnnotation("")
@GetMapping("/warehouse/inout/selectNotSelectCustomer")
public BaseResponse selectNotSelectCustomer(FilterInvLinkDataRequest filterInvLinkDataRequest) {
//获取当前仓库已关联用户
FilterInvLinkDataRequest temRequest = new FilterInvLinkDataRequest();
temRequest.setCode(filterInvLinkDataRequest.getCode());
List<CompanyEntity> companyEntities = warehouseUserService.warehouseListByCode(temRequest);
List<String> customerIds = new ArrayList<>();
for (CompanyEntity item : companyEntities) {
customerIds.add(item.getCustomerId());
}
FilterCompanyRequest companyRequest = new FilterCompanyRequest();
companyRequest.setNotSelectCustomers(customerIds);
List<CompanyEntity> companyEntities1 = companyService.filterCompany(companyRequest);
PageInfo<CompanyEntity> pageInfo = new PageInfo<>(companyEntities1);
PageSimpleResponse<CompanyEntity> response = new PageSimpleResponse<>();
response.setTotal(pageInfo.getTotal());
response.setList(companyEntities1);
return ResultVOUtils.success(response);
}
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/addWarehouseCustomer")
public BaseResponse addWarehouseCustomer(@RequestBody FilterInvLinkDataRequest filterInvLinkDataRequest) {
warehouseUserService.addWarehouseCustomer(filterInvLinkDataRequest);
return ResultVOUtils.success();
}
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/deleteWarehouseCustomer")
public BaseResponse deleteWarehouseCustomer(@RequestBody AuthWarehouseUnify authWarehouseUnify) {
authWarehouseUnifyService.deleteWarehouseCustomer(authWarehouseUnify);
return ResultVOUtils.success();
}
} }

@ -257,6 +257,10 @@ public class RegisterController {
if (userRegisterEntity2 != null) { if (userRegisterEntity2 != null) {
return ResultVOUtils.error(500, "该企业已被注册!"); return ResultVOUtils.error(500, "该企业已被注册!");
} }
List<String> unifyWarehouse = userRegisterEntity.getUnifyWarehouse();
if (unifyWarehouse == null || unifyWarehouse.size() == 0){
return ResultVOUtils.error(500, "配送医院不可以为空!");
}
userRegisterEntity.setRegisterTime(DateUtil.getDateTime()); userRegisterEntity.setRegisterTime(DateUtil.getDateTime());
userRegisterEntity.setCheckType(0);//未审核 userRegisterEntity.setCheckType(0);//未审核

@ -0,0 +1,10 @@
package com.glxp.api.dao.auth;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.auth.AuthWarehouseUnify;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AuthWarehouseUnifyMapper extends BaseMapperPlus<AuthWarehouseUnifyMapper, AuthWarehouseUnify, AuthWarehouseUnify> {
}

@ -2,6 +2,7 @@ package com.glxp.api.dao.auth;
import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.auth.WarehouseUserEntity; import com.glxp.api.entity.auth.WarehouseUserEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.req.auth.FilterInvLinkDataRequest; import com.glxp.api.req.auth.FilterInvLinkDataRequest;
import com.glxp.api.req.auth.FilterInvUserRequest; import com.glxp.api.req.auth.FilterInvUserRequest;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -69,4 +70,6 @@ public interface WarehouseUserDao extends BaseMapperPlus<WarehouseUserDao, Wareh
* @return * @return
*/ */
Integer countByCode(@Param("code") String code); Integer countByCode(@Param("code") String code);
List<CompanyEntity> warehouseListByCode(FilterInvLinkDataRequest filterInvLinkDataRequest);
} }

@ -0,0 +1,37 @@
package com.glxp.api.entity.auth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
*
*/
@Data
@TableName(value = "auth_warehouse_unify")
public class AuthWarehouseUnify {
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
*
*/
@TableField("code")
private String code;
/**
* ID
*/
@TableField("customerId")
private String customerId;
@TableField("updateTime")
private Date updateTime;
}

@ -91,6 +91,13 @@ public class InvWarehouseEntity {
@TableField(value = "spUse") @TableField(value = "spUse")
private Boolean spUse; private Boolean spUse;
/**
* 0 1
*/
@TableField(value = "unifyUse")
private Boolean unifyUse;
@TableField(value = "updateTime") @TableField(value = "updateTime")
private Date updateTime; private Date updateTime;

@ -2,6 +2,8 @@ package com.glxp.api.entity.auth;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class UserRegisterEntity { public class UserRegisterEntity {
@ -29,4 +31,5 @@ public class UserRegisterEntity {
private String licenseUrl; private String licenseUrl;
private String udplatCompanyName; private String udplatCompanyName;
private String udplatCompanyId; private String udplatCompanyId;
private List<String> unifyWarehouse;
} }

@ -80,4 +80,5 @@ public class CompanyEntity {
private String alihealthAppKey; private String alihealthAppKey;
private String alihealthAppSecret; private String alihealthAppSecret;
private String alihealthRefEntId; private String alihealthRefEntId;
private Long unifyId;
} }

@ -15,4 +15,5 @@ public class FilterCompanyRequest extends ListPageRequest {
private String unitIdFk; private String unitIdFk;
private List<String> auditStatusList; private List<String> auditStatusList;
private List<String> notSelectCustomers;
} }

@ -1,8 +1,11 @@
package com.glxp.api.req.auth; package com.glxp.api.req.auth;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.util.page.ListPageRequest; import com.glxp.api.util.page.ListPageRequest;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* *
*/ */
@ -15,6 +18,7 @@ public class FilterInvLinkDataRequest extends ListPageRequest {
private String employeeName; private String employeeName;
private Long listUser[]; private Long listUser[];
private String parentId; private String parentId;
private List<CompanyEntity> customerList;
} }

@ -11,6 +11,8 @@ public class FilterInvSubWarehouseRequest extends ListPageRequest {
private String name; private String name;
private String parentId; private String parentId;
private Boolean defaultInv; private Boolean defaultInv;
private Boolean spUse;
private Boolean unifyUse;
private Integer advanceType; private Integer advanceType;
public String thirdId; public String thirdId;

@ -1,5 +1,6 @@
package com.glxp.api.res.auth; package com.glxp.api.res.auth;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data; import lombok.Data;
/** /**
@ -23,4 +24,11 @@ public class InvSubWarehouseResponse {
private String parentInvName; private String parentInvName;
private Integer advanceType; private Integer advanceType;
private Boolean spUse; private Boolean spUse;
/**
* 0 1
*/
@TableField(value = "unifyUse")
private Boolean unifyUse;
} }

@ -0,0 +1,7 @@
package com.glxp.api.service.auth;
import com.glxp.api.entity.auth.AuthWarehouseUnify;
public interface AuthWarehouseUnifyService {
void deleteWarehouseCustomer(AuthWarehouseUnify authWarehouseUnify);
}

@ -100,4 +100,6 @@ public interface InvWarehouseService {
InvWarehouseEntity findOneLevel(String code); InvWarehouseEntity findOneLevel(String code);
List<InvWarehouseEntity> unifyWarehouseList(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);
} }

@ -3,6 +3,7 @@ package com.glxp.api.service.auth;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.WarehouseUserEntity; import com.glxp.api.entity.auth.WarehouseUserEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.req.auth.FilterInvLinkDataRequest; import com.glxp.api.req.auth.FilterInvLinkDataRequest;
import com.glxp.api.req.auth.FilterInvUserRequest; import com.glxp.api.req.auth.FilterInvUserRequest;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -73,4 +74,8 @@ public interface WarehouseUserService {
Integer countUserBySubInvCode(String subInvCode); Integer countUserBySubInvCode(String subInvCode);
boolean insert(WarehouseUserEntity warehouseUserEntity); boolean insert(WarehouseUserEntity warehouseUserEntity);
List<CompanyEntity> warehouseListByCode(FilterInvLinkDataRequest filterInvLinkDataRequest);
void addWarehouseCustomer(FilterInvLinkDataRequest filterInvLinkDataRequest);
} }

@ -0,0 +1,22 @@
package com.glxp.api.service.auth.impl;
import com.glxp.api.dao.auth.AuthWarehouseUnifyMapper;
import com.glxp.api.entity.auth.AuthWarehouseUnify;
import com.glxp.api.service.auth.AuthWarehouseUnifyService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Service
@Transactional(rollbackFor = Exception.class)
public class AuthWarehouseUnifyServiceImpl implements AuthWarehouseUnifyService {
@Resource
AuthWarehouseUnifyMapper authWarehouseUnifyMapper;
@Override
public void deleteWarehouseCustomer(AuthWarehouseUnify authWarehouseUnify) {
authWarehouseUnifyMapper.deleteById(authWarehouseUnify.getId());
}
}

@ -277,4 +277,10 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
} }
return null; return null;
} }
@Override
public List<InvWarehouseEntity> unifyWarehouseList(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) {
List<InvWarehouseEntity> data = invWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
return data;
}
} }

@ -1,7 +1,12 @@
package com.glxp.api.service.auth.impl; package com.glxp.api.service.auth.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.auth.AuthWarehouseUnifyMapper;
import com.glxp.api.dao.auth.UserRegisterDao; import com.glxp.api.dao.auth.UserRegisterDao;
import com.glxp.api.entity.auth.AuthWarehouseUnify;
import com.glxp.api.entity.auth.UserRegisterEntity; import com.glxp.api.entity.auth.UserRegisterEntity;
import com.glxp.api.req.auth.UserResisterFilterRequest; import com.glxp.api.req.auth.UserResisterFilterRequest;
import com.glxp.api.service.auth.UserRegisterService; import com.glxp.api.service.auth.UserRegisterService;
@ -9,7 +14,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@ -18,6 +25,8 @@ public class UserRegisterServiceImpl implements UserRegisterService {
@Resource @Resource
private UserRegisterDao userRegisterDao; private UserRegisterDao userRegisterDao;
@Resource
private AuthWarehouseUnifyMapper authWarehouseUnifyMapper;
@Override @Override
@ -32,7 +41,30 @@ public class UserRegisterServiceImpl implements UserRegisterService {
@Override @Override
public boolean insertUserRegister(UserRegisterEntity userRegisterEntity) { public boolean insertUserRegister(UserRegisterEntity userRegisterEntity) {
return userRegisterDao.insertUserRegister(userRegisterEntity);
boolean b = userRegisterDao.insertUserRegister(userRegisterEntity);
if (b){
//添加供应商的配送医院的关联关系
String companyId = userRegisterEntity.getCompanyId();
List<String> unifyWarehouse = userRegisterEntity.getUnifyWarehouse();
if (StrUtil.isNotEmpty(companyId) && CollUtil.isNotEmpty(unifyWarehouse)){
authWarehouseUnifyMapper.delete(new LambdaQueryWrapper<AuthWarehouseUnify>().eq(AuthWarehouseUnify::getCustomerId,companyId));
List<AuthWarehouseUnify> addList = new ArrayList<>();
for (int i = 0; i < unifyWarehouse.size(); i++) {
String unifyWarehouseCode = unifyWarehouse.get(i);
AuthWarehouseUnify authWarehouseUnify = new AuthWarehouseUnify();
authWarehouseUnify.setCode(unifyWarehouseCode);
authWarehouseUnify.setCustomerId(companyId);
authWarehouseUnify.setUpdateTime(new Date());
addList.add(authWarehouseUnify);
}
if (CollUtil.isNotEmpty(addList)){
authWarehouseUnifyMapper.insertBatch(addList);
}
}
}
return b;
} }
@Override @Override
@ -42,7 +74,29 @@ public class UserRegisterServiceImpl implements UserRegisterService {
@Override @Override
public boolean updateUserRegister(UserRegisterEntity userRegisterEntity) { public boolean updateUserRegister(UserRegisterEntity userRegisterEntity) {
return userRegisterDao.updateUserRegister(userRegisterEntity); boolean b = userRegisterDao.updateUserRegister(userRegisterEntity);
if (b){
//添加供应商的配送医院的关联关系
String companyId = userRegisterEntity.getCompanyId();
List<String> unifyWarehouse = userRegisterEntity.getUnifyWarehouse();
if (StrUtil.isNotEmpty(companyId) && CollUtil.isNotEmpty(unifyWarehouse)){
authWarehouseUnifyMapper.delete(new LambdaQueryWrapper<AuthWarehouseUnify>().eq(AuthWarehouseUnify::getCustomerId,companyId));
List<AuthWarehouseUnify> addList = new ArrayList<>();
for (int i = 0; i < unifyWarehouse.size(); i++) {
String unifyWarehouseCode = unifyWarehouse.get(i);
AuthWarehouseUnify authWarehouseUnify = new AuthWarehouseUnify();
authWarehouseUnify.setCode(unifyWarehouseCode);
authWarehouseUnify.setCustomerId(companyId);
authWarehouseUnify.setUpdateTime(new Date());
addList.add(authWarehouseUnify);
}
if (CollUtil.isNotEmpty(addList)){
authWarehouseUnifyMapper.insertBatch(addList);
}
}
}
return b;
} }
@Override @Override

@ -2,10 +2,15 @@ package com.glxp.api.service.auth.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.auth.AuthWarehouseUnifyMapper;
import com.glxp.api.dao.auth.WarehouseUserDao; import com.glxp.api.dao.auth.WarehouseUserDao;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.AuthWarehouseUnify;
import com.glxp.api.entity.auth.WarehouseUserEntity; import com.glxp.api.entity.auth.WarehouseUserEntity;
import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.req.auth.FilterInvLinkDataRequest; import com.glxp.api.req.auth.FilterInvLinkDataRequest;
import com.glxp.api.req.auth.FilterInvUserRequest; import com.glxp.api.req.auth.FilterInvUserRequest;
import com.glxp.api.service.auth.WarehouseUserService; import com.glxp.api.service.auth.WarehouseUserService;
@ -16,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
@ -26,6 +32,8 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
@Resource @Resource
private WarehouseUserDao warehouseUserDao; private WarehouseUserDao warehouseUserDao;
@Resource
private AuthWarehouseUnifyMapper authWarehouseUnifyMapper;
@Override @Override
public WarehouseUserEntity selectById(Long id) { public WarehouseUserEntity selectById(Long id) {
@ -145,4 +153,37 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
public boolean insert(WarehouseUserEntity warehouseUserEntity) { public boolean insert(WarehouseUserEntity warehouseUserEntity) {
return warehouseUserDao.insertEntity(warehouseUserEntity) > 0; return warehouseUserDao.insertEntity(warehouseUserEntity) > 0;
} }
@Override
public List<CompanyEntity> warehouseListByCode(FilterInvLinkDataRequest filterInvLinkDataRequest) {
if (filterInvLinkDataRequest == null) {
return Collections.emptyList();
}
if (filterInvLinkDataRequest.getPage() != null) {
int offset = (filterInvLinkDataRequest.getPage() - 1) * filterInvLinkDataRequest.getLimit();
PageHelper.offsetPage(offset, filterInvLinkDataRequest.getLimit());
}
return warehouseUserDao.warehouseListByCode(filterInvLinkDataRequest);
}
@Override
public void addWarehouseCustomer(FilterInvLinkDataRequest filterInvLinkDataRequest) {
List<CompanyEntity> customerList = filterInvLinkDataRequest.getCustomerList();
String code = filterInvLinkDataRequest.getCode();
if (CollUtil.isNotEmpty(customerList)) {
List<AuthWarehouseUnify> addList = new ArrayList<>();
for (int i = 0; i < customerList.size(); i++) {
CompanyEntity companyEntity = customerList.get(i);
AuthWarehouseUnify authWarehouseUnify = new AuthWarehouseUnify();
authWarehouseUnify.setCode(code);
authWarehouseUnify.setCustomerId(companyEntity.getCustomerId());
authWarehouseUnify.setUpdateTime(new Date());
addList.add(authWarehouseUnify);
}
if (CollUtil.isNotEmpty(addList)) {
authWarehouseUnifyMapper.insertBatch(addList);
}
}
}
} }

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.auth.AuthWarehouseUnifyMapper">
</mapper>

@ -25,6 +25,12 @@
<if test="defaultInv != '' and defaultInv != null"> <if test="defaultInv != '' and defaultInv != null">
AND a.defaultInv = #{defaultInv} AND a.defaultInv = #{defaultInv}
</if> </if>
<if test="spUse != null">
AND a.spUse = #{spUse}
</if>
<if test="unifyUse != null">
AND a.unifyUse = #{unifyUse}
</if>
</where> </where>
</select> </select>
@ -230,6 +236,9 @@
<if test="spUse != null"> <if test="spUse != null">
spUse=#{spUse}, spUse=#{spUse},
</if> </if>
<if test="unifyUse != null">
unifyUse=#{unifyUse},
</if>
</trim> </trim>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
@ -297,7 +306,8 @@
b.name as parentName, b.name as parentName,
a.parentCode, a.parentCode,
c.name parentInvName, c.name parentInvName,
a.spUse a.spUse,
a.unifyUse
FROM auth_warehouse a FROM auth_warehouse a
left join auth_dept b on a.parentId = b.code left join auth_dept b on a.parentId = b.code
left join auth_warehouse c on a.parentCode = c.code left join auth_warehouse c on a.parentCode = c.code

@ -331,4 +331,21 @@
set isDirector = #{isDirector} set isDirector = #{isDirector}
where id = #{id} where id = #{id}
</update> </update>
<select id="warehouseListByCode" parameterType="com.glxp.api.req.auth.FilterInvUserRequest"
resultType="com.glxp.api.entity.system.CompanyEntity">
SELECT ci.*,awu.id as unifyId
FROM auth_warehouse_unify awu
LEFT JOIN customer_info ci ON awu.customerId = ci.customerId
<where>
<if test="code != '' and code != null">
AND awu.code = #{code}
</if>
<if test="key != null and key != ''">
AND `companyName` like CONCAT('%', #{key}, '%')
</if>
</where>
</select>
</mapper> </mapper>

@ -33,6 +33,12 @@
<if test="unitIdFk != null and unitIdFk != ''"> <if test="unitIdFk != null and unitIdFk != ''">
and unitIdFk = #{unitIdFk} and unitIdFk = #{unitIdFk}
</if> </if>
<if test="notSelectCustomers != null and notSelectCustomers.size() != 0">
and customerId not in
<foreach collection="notSelectCustomers" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
</select> </select>

@ -1269,3 +1269,16 @@ CALL Pro_Temp_ColumnWork('basic_corp', 'adSickNum',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL', 1); ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL', 1);
CALL Pro_Temp_ColumnWork('auth_warehouse', 'unifyUse',
' tinyint NULL DEFAULT b''0''COMMENT ''是否医院标识 0否 1是''',
1);
CREATE TABLE IF NOT EXISTS `auth_warehouse_unify` (
`id` bigint NOT NULL AUTO_INCREMENT,
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '仓库编码',
`customerId` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '客户ID',
`updateTime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='医院共同体关系表';
Loading…
Cancel
Save