Browse Source

调整

contract
Yen 2 years ago
parent
commit
388591d88d
  1. 4
      src/main/java/com/qs/serve/modules/bms/controller/BmsCostCenterController.java
  2. 9
      src/main/java/com/qs/serve/modules/bms/controller/BmsSubjectFormController.java
  3. 42
      src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierVisitAddressController.java
  4. 4
      src/main/java/com/qs/serve/modules/bms/entity/BmsCostCenter.java
  5. 8
      src/main/java/com/qs/serve/modules/bms/entity/BmsMasterUser.java
  6. 1
      src/main/java/com/qs/serve/modules/bms/entity/BmsSubjectForm.java
  7. 3
      src/main/java/com/qs/serve/modules/bms/entity/BmsSupplierBand.java
  8. 8
      src/main/java/com/qs/serve/modules/qms/controller/QmsGroupController.java
  9. 2
      src/main/java/com/qs/serve/modules/qms/entity/QmsGroupScope.java
  10. 5
      src/main/java/com/qs/serve/modules/qms/service/impl/QmsGroupScopeServiceImpl.java

4
src/main/java/com/qs/serve/modules/bms/controller/BmsCostCenterController.java

@ -147,6 +147,10 @@ public class BmsCostCenterController {
@PreAuthorize("hasRole('bms:costCenter:query')") @PreAuthorize("hasRole('bms:costCenter:query')")
public R<BmsCostCenter> getById(@PathVariable("id") String id){ public R<BmsCostCenter> getById(@PathVariable("id") String id){
BmsCostCenter bmsCostCenter = bmsCostCenterService.getById(id); BmsCostCenter bmsCostCenter = bmsCostCenterService.getById(id);
if(bmsCostCenter.getPid()!=null&&!bmsCostCenter.getPid().equals(0L)){
BmsCostCenter parentCostCenter = bmsCostCenterService.getById(bmsCostCenter.getPid());
bmsCostCenter.setParentNode(parentCostCenter);
}
return R.ok(bmsCostCenter); return R.ok(bmsCostCenter);
} }

9
src/main/java/com/qs/serve/modules/bms/controller/BmsSubjectFormController.java

@ -9,6 +9,9 @@ import com.qs.serve.common.model.enums.SystemModule;
import com.qs.serve.common.util.PageUtil; import com.qs.serve.common.util.PageUtil;
import com.qs.serve.common.util.CopierUtil; import com.qs.serve.common.util.CopierUtil;
import com.qs.serve.common.util.StringUtils; import com.qs.serve.common.util.StringUtils;
import com.qs.serve.modules.bms.entity.BmsSubject;
import com.qs.serve.modules.bms.service.BmsSubjectService;
import com.qs.serve.modules.bms.service.BmsSupplierService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -32,6 +35,7 @@ import java.util.List;
public class BmsSubjectFormController { public class BmsSubjectFormController {
private BmsSubjectFormService bmsSubjectFormService; private BmsSubjectFormService bmsSubjectFormService;
private BmsSubjectService bmsSubjectService;
/** /**
@ -103,6 +107,11 @@ public class BmsSubjectFormController {
@PreAuthorize("hasRole('bms:subject:delete')") @PreAuthorize("hasRole('bms:subject:delete')")
public R<?> deleteById(@PathVariable("ids") String ids){ public R<?> deleteById(@PathVariable("ids") String ids){
List<Long> idsLong = StringUtils.splitIdLong(ids); List<Long> idsLong = StringUtils.splitIdLong(ids);
LambdaQueryWrapper<BmsSubject> lqw = new LambdaQueryWrapper<>();
lqw.in(BmsSubject::getFormId,idsLong);
if(bmsSubjectService.count(lqw)>0){
return R.error("表单被使用中,删除失败");
}
boolean result = bmsSubjectFormService.removeByIds(idsLong); boolean result = bmsSubjectFormService.removeByIds(idsLong);
return R.isTrue(result); return R.isTrue(result);
} }

42
src/main/java/com/qs/serve/modules/bms/controller/BmsSupplierVisitAddressController.java

@ -68,6 +68,48 @@ public class BmsSupplierVisitAddressController {
return R.ok(list); return R.ok(list);
} }
/**
* 翻页查询过滤当前用户负责数据
* @param param
* @return
*/
@PostMapping("/getListForVisit")
public R<List<HisUserSupplierAddressVo>> getListForVisit(@Valid @RequestBody BmsSupplierVisitSo param){
String userId = AuthContextUtils.getSysUserId();
hisUserSupplierService.initByUserId(userId,false);
HisUserSupplier userSupplier = new HisUserSupplier();
userSupplier.setUserId(userId);
userSupplier.setSupplierName(param.getSupplierName());
userSupplier.setSupplierCode(param.getSupplierCode());
userSupplier.setQueryAddress(param.getAddress());
userSupplier.setQueryValue(param.getSearchValue());
userSupplier.setLocalX(param.getLocalX());
userSupplier.setLocalY(param.getLocalY());
List<HisUserSupplierAddressVo> list = hisUserSupplierMapper.selectHisUserSupplierAddressList(userSupplier);
List<String> supplierIds = list.stream().map(HisUserSupplierAddressVo::getSupplierId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(supplierIds)){
List<BmsSupplier> supplierList = bmsSupplierService.listByIds(supplierIds);
for (HisUserSupplierAddressVo addressVo : list) {
for (BmsSupplier supplier : supplierList) {
if(addressVo.getSupplierId().equals(supplier.getId())){
addressVo.setSupplierCode(supplier.getCode());
addressVo.setSupplierName(supplier.getName());
BmsSupplierVisitAddress visitAddress = bmsSupplierVisitAddressService.getById(addressVo.getAddressId());
//BmsSupplierVisit visitInfo = bmsSupplierVisitService.getOne(new LambdaQueryWrapper<BmsSupplierVisit>().eq(BmsSupplierVisit::getSupplierId,supplier.getId()),false);
addressVo.setAddressInfo(visitAddress);
LambdaQueryWrapper<BazVisitInfo> visitInfoLqw = new LambdaQueryWrapper<>();
visitInfoLqw.eq(BazVisitInfo::getTargetType, BazTargetTypeConsts.CUSTOMER);
visitInfoLqw.eq(BazVisitInfo::getTargetId,supplier.getId());
visitInfoLqw.eq(BazVisitInfo::getUserId,userId);
BazVisitInfo visitInfo = bazVisitInfoService.getOne(visitInfoLqw,false);
addressVo.setVisitInfo(visitInfo);
break;
}
}
}
}
return R.ok(list);
}
/** /**
* 翻页查询过滤当前用户负责数据 * 翻页查询过滤当前用户负责数据

4
src/main/java/com/qs/serve/modules/bms/entity/BmsCostCenter.java

@ -89,5 +89,9 @@ public class BmsCostCenter implements Serializable {
@TableField(exist = false) @TableField(exist = false)
List<BmsCostCenter> childNode; List<BmsCostCenter> childNode;
/** 父级节点 */
@TableField(exist = false)
private Object parentNode;
} }

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

@ -52,32 +52,40 @@ public class BmsMasterUser implements Serializable {
/** 渠道 */ /** 渠道 */
@Length(max = 255,message = "渠道长度不能超过255字") @Length(max = 255,message = "渠道长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String channelName; private String channelName;
/** 渠道 */ /** 渠道 */
@Length(max = 255,message = "渠道长度不能超过255字") @Length(max = 255,message = "渠道长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String channelCode; private String channelCode;
/** 网点 */ /** 网点 */
@Length(max = 255,message = "网点长度不能超过255字") @Length(max = 255,message = "网点长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String pointName; private String pointName;
/** 网点 */ /** 网点 */
@Length(max = 255,message = "网点长度不能超过255字") @Length(max = 255,message = "网点长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String pointCode; private String pointCode;
/** 用户 */ /** 用户 */
@Length(max = 255,message = "用户长度不能超过255字") @Length(max = 255,message = "用户长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String userCode; private String userCode;
/** 用户 */ /** 用户 */
@Length(max = 255,message = "用户长度不能超过255字") @Length(max = 255,message = "用户长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String userName; private String userName;
/** 成本中心 */ /** 成本中心 */
@TableField(condition = SqlCondition.LIKE)
private String centerCode; private String centerCode;
/** 成本中心 */ /** 成本中心 */
@TableField(condition = SqlCondition.LIKE)
private String centerName; private String centerName;
/** 备注 */ /** 备注 */

1
src/main/java/com/qs/serve/modules/bms/entity/BmsSubjectForm.java

@ -34,6 +34,7 @@ public class BmsSubjectForm implements Serializable {
/** 标题 */ /** 标题 */
@NotBlank(message = "标题不能为空") @NotBlank(message = "标题不能为空")
@Length(max = 40,message = "标题长度不能超过40字") @Length(max = 40,message = "标题长度不能超过40字")
@TableField(condition = SqlCondition.LIKE)
private String title; private String title;
/** 子标题 */ /** 子标题 */

3
src/main/java/com/qs/serve/modules/bms/entity/BmsSupplierBand.java

@ -36,16 +36,19 @@ public class BmsSupplierBand implements Serializable {
/** 开户银行 */ /** 开户银行 */
@NotBlank(message = "开户银行不能为空") @NotBlank(message = "开户银行不能为空")
@Length(max = 20,message = "开户银行长度不能超过20字") @Length(max = 20,message = "开户银行长度不能超过20字")
@TableField(condition = SqlCondition.LIKE)
private String cardBank; private String cardBank;
/** 银行卡号 */ /** 银行卡号 */
@NotBlank(message = "银行卡号不能为空") @NotBlank(message = "银行卡号不能为空")
@Length(max = 30,message = "银行卡号长度不能超过30字") @Length(max = 30,message = "银行卡号长度不能超过30字")
@TableField(condition = SqlCondition.LIKE)
private String cardNum; private String cardNum;
/** 持卡人 */ /** 持卡人 */
@NotBlank(message = "持卡人不能为空") @NotBlank(message = "持卡人不能为空")
@Length(max = 20,message = "持卡人长度不能超过20字") @Length(max = 20,message = "持卡人长度不能超过20字")
@TableField(condition = SqlCondition.LIKE)
private String cardUser; private String cardUser;
/** 备注 */ /** 备注 */

8
src/main/java/com/qs/serve/modules/qms/controller/QmsGroupController.java

@ -199,13 +199,19 @@ public class QmsGroupController {
*/ */
@LimitSubmit @LimitSubmit
@GetMapping("/unfinishedList") @GetMapping("/unfinishedList")
public R<?> unfinishedList(String finished,String groupId){ public R<?> unfinishedList(String finished,String groupId,String code,String name){
LambdaQueryWrapper<QmsGroupScope> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<QmsGroupScope> lqw = new LambdaQueryWrapper<>();
if(StringUtils.hasText(finished)){ if(StringUtils.hasText(finished)){
lqw.eq(QmsGroupScope::getFinished,finished); lqw.eq(QmsGroupScope::getFinished,finished);
}else { }else {
lqw.ne(QmsGroupScope::getFinished,-1); lqw.ne(QmsGroupScope::getFinished,-1);
} }
if(code!=null){
lqw.like(QmsGroupScope::getUserCode,code);
}
if(name!=null){
lqw.like(QmsGroupScope::getUserName,name);
}
if(groupId!=null){ if(groupId!=null){
lqw.eq(QmsGroupScope::getGroupId,groupId); lqw.eq(QmsGroupScope::getGroupId,groupId);
} }

2
src/main/java/com/qs/serve/modules/qms/entity/QmsGroupScope.java

@ -40,6 +40,8 @@ public class QmsGroupScope implements Serializable {
/** 使用范围值 */ /** 使用范围值 */
@Length(max = 32,message = "使用范围值长度不能超过32字") @Length(max = 32,message = "使用范围值长度不能超过32字")
private String scopeValue; private String scopeValue;
private String userCode;
private String userName;
/** 删除标识 */ /** 删除标识 */
@JsonIgnore @JsonIgnore

5
src/main/java/com/qs/serve/modules/qms/service/impl/QmsGroupScopeServiceImpl.java

@ -115,6 +115,8 @@ public class QmsGroupScopeServiceImpl extends ServiceImpl<QmsGroupScopeMapper,Qm
groupScope2.setScopeType(isDeptType?3:4); groupScope2.setScopeType(isDeptType?3:4);
groupScope2.setFinished(0); groupScope2.setFinished(0);
groupScope2.setScopeValue(sysUser.getId()); groupScope2.setScopeValue(sysUser.getId());
groupScope2.setUserCode(sysUser.getCode());
groupScope2.setUserName(sysUser.getName());
list.add(groupScope2); list.add(groupScope2);
//查询用的的微信用户 //查询用的的微信用户
List<WxUser> wxUserList = wxUserService.getBySysUserId(sysUser.getId()); List<WxUser> wxUserList = wxUserService.getBySysUserId(sysUser.getId());
@ -132,6 +134,9 @@ public class QmsGroupScopeServiceImpl extends ServiceImpl<QmsGroupScopeMapper,Qm
}else if (isPersonType){ }else if (isPersonType){
//修改状态 //修改状态
groupScope.setFinished(0); groupScope.setFinished(0);
SysUser sysUser = sysUserMapper.selectById(groupScope.getScopeValue());
groupScope.setUserName(sysUser.getName());
groupScope.setUserCode(sysUser.getCode());
this.updateById(groupScope); this.updateById(groupScope);
List<WxUser> wxUserList = wxUserService.getBySysUserId(groupScope.getScopeValue()); List<WxUser> wxUserList = wxUserService.getBySysUserId(groupScope.getScopeValue());
//发送推送 //发送推送

Loading…
Cancel
Save