Browse Source

调整

contract
Yen 2 years ago
parent
commit
666045f7d2
  1. 6
      src/main/java/com/qs/serve/modules/bms/controller/BmsRegionUserController.java
  2. 129
      src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierChannelPointController.java
  3. 3
      src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierController.java
  4. 8
      src/main/java/com/qs/serve/modules/bms/entity/BmsSupplierChannel.java
  5. 2
      src/main/java/com/qs/serve/modules/his/service/impl/HisUserSupplierServiceImpl.java
  6. 14
      src/main/java/com/qs/serve/modules/tbs/common/dto/CompensateDTO.java
  7. 14
      src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java
  8. 7
      src/main/java/com/qs/serve/modules/wx/controller/WxFormPushController.java
  9. 5
      src/main/java/com/qs/serve/modules/wx/entity/WxFormPush.java
  10. 6
      src/main/resources/mapper/bms/BmsSupplierChannelMapper.xml
  11. 1
      src/main/resources/mapper/wx/WxFormPushMapper.xml

6
src/main/java/com/qs/serve/modules/bms/controller/BmsRegionUserController.java

@ -19,6 +19,7 @@ import com.qs.serve.modules.bms.service.BmsChannelPointService;
import com.qs.serve.modules.bms.service.BmsRegion2Service;
import com.qs.serve.modules.bms.service.BmsRegionService;
import com.qs.serve.modules.his.service.HisUserChannelPointService;
import com.qs.serve.modules.his.service.HisUserSupplierService;
import com.qs.serve.modules.sys.entity.SysUser;
import com.qs.serve.modules.sys.service.SysUserService;
import lombok.AllArgsConstructor;
@ -53,6 +54,7 @@ public class BmsRegionUserController {
private SysUserService sysUserService;
private HisUserChannelPointService hisUserChannelPointService;
private BmsChannelPointService channelPointService;
private HisUserSupplierService hisUserSupplierService;
/**
@ -186,6 +188,8 @@ public class BmsRegionUserController {
hisUserChannelPointService.flushBatchUserRegion(userIds,pointIds,1,pathIds);
}
}
//清空临时表
hisUserSupplierService.cleanTable();
return R.ok();
}
@ -215,6 +219,7 @@ public class BmsRegionUserController {
regionUser.setId(id);
regionUser.setMasterFlag(0);
bmsRegionUserService.updateById(regionUser);
hisUserSupplierService.cleanTable();
return R.ok();
}
@ -239,6 +244,7 @@ public class BmsRegionUserController {
}
}
bmsRegionUserService.removeByIds(idsLong);
hisUserSupplierService.cleanTable();
return R.ok();
}

129
src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierChannelPointController.java

@ -0,0 +1,129 @@
package com.qs.serve.modules.bms.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.dto.PageVo;
import com.qs.serve.common.model.dto.R;
import com.qs.serve.common.model.enums.BizType;
import com.qs.serve.common.model.enums.SystemModule;
import com.qs.serve.common.util.PageUtil;
import com.qs.serve.modules.bms.entity.BmsChannel;
import com.qs.serve.modules.bms.entity.BmsChannelPoint;
import com.qs.serve.modules.bms.entity.BmsSupplier;
import com.qs.serve.modules.bms.entity.BmsSupplierChannel;
import com.qs.serve.modules.bms.entity.bo.BmsSupplierChannelBo;
import com.qs.serve.modules.bms.service.BmsChannelPointService;
import com.qs.serve.modules.bms.service.BmsChannelService;
import com.qs.serve.modules.bms.service.BmsSupplierChannelService;
import com.qs.serve.modules.bms.service.BmsSupplierService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 基础档案 客户渠道关系2
* @author YenHex
* @since 2022-11-03
*/
@Slf4j
@AllArgsConstructor
@RestController
@RequestMapping("bms/supplierRelate")
public class BmsSupplierChannelPointController {
private BmsSupplierChannelService bmsSupplierChannelService;
private BmsChannelService bmsChannelService;
private BmsChannelPointService bmsChannelPointService;
private BmsSupplierService bmsSupplierService;
/**
* 供应商ID加载渠道列表
* @param supplierId
* @return
*/
@GetMapping("/listChannelBySupplier")
public R<List<BmsChannel>> listChannelBySupplier(String supplierId,BmsChannel query){
LambdaQueryWrapper<BmsSupplierChannel> lqw = new LambdaQueryWrapper<>();
lqw.eq(BmsSupplierChannel::getSupplierId,supplierId);
List<BmsSupplierChannel> supplierChannels = bmsSupplierChannelService.list(lqw);
List<Long> channelIds = supplierChannels.stream().map(BmsSupplierChannel::getChannelId).distinct().collect(Collectors.toList());
if(channelIds.size()<1){
return R.ok();
}
LambdaQueryWrapper<BmsChannel> lqw2 = new LambdaQueryWrapper<>(query);
lqw2.in(BmsChannel::getId,channelIds);
List<BmsChannel> bmsChannels = bmsChannelService.list(lqw2);
return R.ok(bmsChannels);
}
/**
* 供应商ID加载渠道列表
* @param supplierId
* @return
*/
@GetMapping("/pageChannelBySupplier")
public R<PageVo<BmsChannel>> pageChannelBySupplier(String supplierId,BmsChannel query){
LambdaQueryWrapper<BmsSupplierChannel> lqw = new LambdaQueryWrapper<>();
lqw.eq(BmsSupplierChannel::getSupplierId,supplierId);
List<BmsSupplierChannel> supplierChannels = bmsSupplierChannelService.list(lqw);
List<Long> channelIds = supplierChannels.stream().map(BmsSupplierChannel::getChannelId).distinct().collect(Collectors.toList());
if(channelIds.size()<1){
return R.byEmptyList();
}
PageUtil.startPage();
LambdaQueryWrapper<BmsChannel> lqw2 = new LambdaQueryWrapper<>(query);
lqw2.in(BmsChannel::getId,channelIds);
List<BmsChannel> bmsChannels = bmsChannelService.list(lqw2);
return R.byPageHelperList(bmsChannels);
}
/**
* 供应商ID加载网点列表
* @param supplierId
* @return
*/
@GetMapping("/listPointBySupplier")
public R<List<BmsChannelPoint>> listPointBySupplier(String supplierId,BmsChannelPoint query){
LambdaQueryWrapper<BmsSupplierChannel> lqw = new LambdaQueryWrapper<>();
lqw.eq(BmsSupplierChannel::getSupplierId,supplierId);
List<BmsSupplierChannel> supplierChannels = bmsSupplierChannelService.list(lqw);
List<Long> channelIds = supplierChannels.stream().map(BmsSupplierChannel::getChannelId).distinct().collect(Collectors.toList());
if(channelIds.size()<1){
return R.ok();
}
LambdaQueryWrapper<BmsChannelPoint> lqw2 = new LambdaQueryWrapper<>(query);
lqw2.in(BmsChannelPoint::getChannelId,channelIds);
List<BmsChannelPoint> channelPoints = bmsChannelPointService.list(lqw2);
return R.ok(channelPoints);
}
/**
* 供应商ID加载网点列表
* @param supplierId
* @return
*/
@GetMapping("/pagePointBySupplier")
public R<PageVo<BmsChannelPoint>> pagePointBySupplier(String supplierId,BmsChannelPoint query){
LambdaQueryWrapper<BmsSupplierChannel> lqw = new LambdaQueryWrapper<>();
lqw.eq(BmsSupplierChannel::getSupplierId,supplierId);
List<BmsSupplierChannel> supplierChannels = bmsSupplierChannelService.list(lqw);
List<Long> channelIds = supplierChannels.stream().map(BmsSupplierChannel::getChannelId).distinct().collect(Collectors.toList());
if(channelIds.size()<1){
return R.byEmptyList();
}
PageUtil.startPage();
LambdaQueryWrapper<BmsChannelPoint> lqw2 = new LambdaQueryWrapper<>(query);
lqw2.in(BmsChannelPoint::getChannelId,channelIds);
List<BmsChannelPoint> channelPoints = bmsChannelPointService.list(lqw2);
return R.byPageHelperList(channelPoints);
}
}

3
src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierController.java

@ -351,6 +351,8 @@ public class BmsSupplierController {
bmsSupplier.setId(supplier.getId());
bmsSupplier.setOtherUserIds(otherArr);
bmsSupplierService.updateById(bmsSupplier);
//清空临时表
hisUserSupplierService.cleanTable();
initSupplierOtherInfo(Arrays.asList(supplierId.toString()));
return R.ok();
}
@ -431,6 +433,7 @@ public class BmsSupplierController {
}
bmsSupplierService.edit(param);
redisService.remove(RedisCacheKeys.SUPPLIER_RELATE_TREE);
hisUserSupplierService.cleanTable();
return R.ok();
}

8
src/main/java/com/qs/serve/modules/bms/entity/BmsSupplierChannel.java

@ -71,6 +71,14 @@ public class BmsSupplierChannel implements Serializable {
@TableField(exist = false)
private String channelName;
/** 渠道编码 */
@TableField(exist = false)
private String channelCode;
/** 渠道编码 */
@TableField(exist = false)
private String channelType;
/** 客户名称 */
@TableField(exist = false)
private String supplierName;

2
src/main/java/com/qs/serve/modules/his/service/impl/HisUserSupplierServiceImpl.java

@ -127,7 +127,7 @@ public class HisUserSupplierServiceImpl extends ServiceImpl<HisUserSupplierMappe
for (Integer level : saleRegionsMap.keySet()) {
List<BmsRegion2> region2List = saleRegionsMap.get(level);
List<String> region2Ids = region2List.stream().map(BmsRegion2::getId).collect(Collectors.toList());
toHisUserSupplier(userSuppliers,1,region2Ids,1,userId);
toHisUserSupplier(userSuppliers,1,region2Ids,level,userId);
}
}
if(userSuppliers.size()>0){

14
src/main/java/com/qs/serve/modules/tbs/common/dto/CompensateDTO.java

@ -0,0 +1,14 @@
package com.qs.serve.modules.tbs.common.dto;
import lombok.Data;
/**
* @author YenHex
* @since 2023/5/16
*/
@Data
public class CompensateDTO {
String id;
}

14
src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java

@ -27,6 +27,7 @@ import com.qs.serve.modules.sys.service.SysUserSalesService;
import com.qs.serve.modules.sys.service.SysUserService;
import com.qs.serve.modules.tbs.common.TbsCostApplyState;
import com.qs.serve.modules.tbs.common.TbsSeeYonConst;
import com.qs.serve.modules.tbs.common.dto.CompensateDTO;
import com.qs.serve.modules.tbs.common.util.TbsBudgetCostUtil;
import com.qs.serve.modules.tbs.entity.*;
import com.qs.serve.modules.tbs.entity.bo.TbsActivityBo;
@ -489,5 +490,18 @@ public class TbsCostApplyController {
return R.error("远程调用失败");
}
/**
* 补偿接口
* @param param
* @return
*/
@PostMapping("/compensate")
@SysLog(module = SystemModule.Budget, title = "费用申请", biz = BizType.DELETE)
public R<?> compensateOAResult(@RequestBody CompensateDTO param){
seeYonService.testConnection();
return R.ok();
}
}

7
src/main/java/com/qs/serve/modules/wx/controller/WxFormPushController.java

@ -112,6 +112,7 @@ public class WxFormPushController {
return R.error("已发布的消息不能再次发布");
}
entity.setStatus("1");
entity.setPublishTime(LocalDateTime.now());
boolean result = wxFormPushService.updateById(entity);
LambdaQueryWrapper<WxFormPushUser> userlqw = new LambdaQueryWrapper<>();
userlqw.eq(WxFormPushUser::getFormPushId,entity.getId());
@ -154,7 +155,7 @@ public class WxFormPushController {
* @return
*/
@PostMapping("/compensate")
@SysLog(module = SystemModule.Verification, title = "表单推送发布", biz = BizType.UPDATE)
@SysLog(module = SystemModule.Verification, title = "表单推送补偿通知", biz = BizType.UPDATE)
public R<?> compensate(@RequestBody WxFormPushBo param){
String id = param.getId();
List<String> userIds = param.getUserIds();
@ -163,9 +164,8 @@ public class WxFormPushController {
return R.error("未发布");
}
LambdaQueryWrapper<WxFormPushUser> userlqw = new LambdaQueryWrapper<>();
if(StringUtils.hasText(id)){
userlqw.eq(WxFormPushUser::getFormPushId,entity.getId());
}else {
if(CollectionUtil.isNotEmpty(userIds)) {
userlqw.in(WxFormPushUser::getUserId,userIds);
}
userlqw.eq(WxFormPushUser::getPushStatus,0);
@ -250,6 +250,7 @@ public class WxFormPushController {
}
entity.setPreNotifyStatus(entity.getPreNotifyTime()==null?0:1);
if(null==entity.getId()) {
entity.setPublishTime(LocalDateTime.now());
wxFormPushService.save(entity);
}else{
WxFormPush ori_entity = wxFormPushService.getById(entity.getId());

5
src/main/java/com/qs/serve/modules/wx/entity/WxFormPush.java

@ -87,6 +87,11 @@ public class WxFormPush implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime preNotifyTime;
/** 发布时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime publishTime;
/** 附件ids */
@TableField(typeHandler = SplitStringTypeHandler.class,jdbcType= JdbcType.VARCHAR)
private String[] attachIds;

6
src/main/resources/mapper/bms/BmsSupplierChannelMapper.xml

@ -15,6 +15,8 @@
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="channelName" column="channel_name"/>
<result property="channelCode" column="channel_code"/>
<result property="channelType" column="channel_type"/>
<result property="supplierName" column="supplier_name"/>
<result property="supplierCode" column="supplier_code"/>
</resultMap>
@ -33,6 +35,8 @@
<select id="selectSupplierChannelList" parameterType="com.qs.serve.modules.bms.entity.BmsSupplierChannel" resultMap="bmsSupplierChannelMap">
SELECT
`bms_channel`.`channel_name`,
`bms_channel`.`channel_code`,
`bms_channel`.`channel_type`,
`bms_supplier`.`name` as `supplier_name`,
`bms_supplier`.`code` as `supplier_code`,
<include refid="bmsSupplierChannelSql"/>
@ -51,6 +55,8 @@
<if test="query.updateBy != null and query.updateBy != ''"> and `bms_supplier_channel`.`update_by` = #{query.updateBy}</if>
<if test="query.channelName != null and query.channelName != ''"> and `bms_channel`.`channel_name` LIKE CONCAT('%',#{query.channelName},'%') </if>
<if test="query.channelCode != null and query.channelCode != ''"> and `bms_channel`.`channel_code` LIKE CONCAT('%',#{query.channelCode},'%') </if>
<if test="query.channelName != null and query.channelName != ''"> and `bms_channel`.`channel_type` = #{query.channelType} </if>
<if test="query.supplierName != null and query.supplierName != ''"> and `bms_supplier`.`name` LIKE CONCAT('%',#{query.supplierName},'%') </if>
<if test="query.supplierCode != null and query.supplierCode != ''"> and `bms_supplier`.`code` LIKE CONCAT('%',#{query.supplierCode},'%')</if>

1
src/main/resources/mapper/wx/WxFormPushMapper.xml

@ -85,6 +85,7 @@
and `wx_form_push_user`.`user_id` = #{query.queryUserId}
</if>
</where>
order by `wx_form_push`.`publish_time`,`wx_form_push`.`create_time` desc
</select>
</mapper>

Loading…
Cancel
Save