Browse Source

移动端内部推荐人查询、完善销售订单调式

zhanglei
dimengzhe 3 years ago
parent
commit
d6732570e2
  1. 5
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehmodelconfig/BaseVehmodelConfigService.java
  2. 4
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busmaindeposit/BusMainDepositService.java
  3. 126
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java
  4. 9
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderdeposit/BusSalesOrderDepositService.java
  5. 5
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderdiscount/BusSalesOrderDiscountService.java
  6. 11
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/SysStaffinfoFeign.java
  7. 7
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/SysStaffinfoFeignFallback.java
  8. 19
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/app/AppSysStaffQuery.java
  9. 30
      anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/app/AppSysStaffVo.java
  10. 7
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoMapper.java
  11. 134
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoMapper.xml
  12. 11
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoRest.java
  13. 46
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoService.java

5
anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehmodelconfig/BaseVehmodelConfigService.java

@ -474,6 +474,9 @@ public class BaseVehmodelConfigService extends MybatisBaseService<BaseVehmodelCo
if (!resultBean.getSuccess()) {
return rb.setData(new AppCarConfigSummaryVo());
}
if ("0".equals(resultBean.getData())) {
return rb.setData(new AppCarConfigSummaryVo());
}
AppModelConfigListVo appModelConfigListVo = baseMapper.selectCarConfigSummary(modelSid, configSid, resultBean.getData());
if (appModelConfigListVo != null) {
AppCarConfigSummaryVo configSummaryVo = addConfigName(appModelConfigListVo);
@ -553,6 +556,6 @@ public class BaseVehmodelConfigService extends MybatisBaseService<BaseVehmodelCo
}
public List<BaseVehmodelConfigVo> getListByConfigSidAndUseOrgSid(String configSid, String createOrgSId) {
return baseMapper.getListByConfigSidAndUseOrgSid(configSid,createOrgSId);
return baseMapper.getListByConfigSidAndUseOrgSid(configSid, createOrgSId);
}
}

4
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busmaindeposit/BusMainDepositService.java

@ -1617,11 +1617,11 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp
IPage<BusMainDeposit> page = PagerUtil.queryToPage(pagerQuery);
IPage<AppBusMainDepositOrderVo> pagging = baseMapper.pageAppList(page, qw, query.getName());
List<AppBusMainDepositOrderVo> list = pagging.getRecords();
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
list.removeAll(Collections.singleton(null));
if (!list.isEmpty()) {
for (AppBusMainDepositOrderVo vo : list) {
List<AppDepositModelListVo> voList = vo.getModelList();
voList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
voList.removeAll(Collections.singleton(null));
if (!voList.isEmpty()) {
for (AppDepositModelListVo v : voList) {
String modelSid = v.getModelSid();

126
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java

@ -113,7 +113,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* Project: anrui-buscenter(业务管理) <br/>
@ -1394,7 +1393,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
if ("1".equals(busSalesOrder.getType())) {
//类型为现车,查询该销售订单的现车车辆信息
List<AppNowCarListVo> nowCarList = busSalesOrderVehicleService.selectAppDetailsVoBySaleOrderSid(saleOrderSid);
nowCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
nowCarList.removeAll(Collections.singleton(null));
if (!nowCarList.isEmpty()) {
orderInfo.setNowCarList(nowCarList);
boolean isCheck = isCheck(vinNoList, nowCarList);
@ -1406,7 +1405,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
}
if ("2".equals(busSalesOrder.getType())) {
List<AppReadyCarListVo> appReadyCarList = busSalesVehicleOrderService.selectAppDetailsVoBySaleOrderSid(saleOrderSid);
appReadyCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
appReadyCarList.removeAll(Collections.singleton(null));
if (!appReadyCarList.isEmpty()) {
for (AppReadyCarListVo v : appReadyCarList) {
if (appCarInfo.getReadyCar().size() > 0) {
@ -1506,33 +1505,39 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
List<AppReadyCarListVo> appReadyCarLists = new ArrayList<>();
//根据车型及配置查询车型信息
ResultBean<AppCarConfigSummaryVo> appCarConfigSummaryVoResultBean = baseVehmodelConfigFeign.selectCarConfigSummary(modelSid, configSid, userSid);
AppCarConfigSummaryVo data = appCarConfigSummaryVoResultBean.getData();
//车型sid
orderInfo.setModelSid(modelSid);
//车型名称
orderInfo.setModelName(data.getModel());
//配置sid
orderInfo.setConfigSid(configSid);
//车型配置
orderInfo.setCommonlyConfig(data.getConfig());
//更多配置
orderInfo.setMoreConfig(data.getMoreConfig());
//特殊说明:若为意向车型则为意向车型的特殊说明
orderInfo.setSpecialInstructions(special);
//订单选择的现车列表
orderInfo.setNowCarList(appNowCarLists);
//订单选择的采购订单列表
orderInfo.setReadyCarList(appReadyCarLists);
vo.setPrice(data.getPrice());
if (appCarConfigSummaryVoResultBean.getSuccess()) {
AppCarConfigSummaryVo data = appCarConfigSummaryVoResultBean.getData();
//车型sid
orderInfo.setModelSid(modelSid);
//车型名称
orderInfo.setModelName(data.getModel());
//配置sid
orderInfo.setConfigSid(configSid);
//车型配置
orderInfo.setCommonlyConfig(data.getConfig());
//更多配置
orderInfo.setMoreConfig(data.getMoreConfig());
//特殊说明:若为意向车型则为意向车型的特殊说明
orderInfo.setSpecialInstructions(special);
//订单选择的现车列表
orderInfo.setNowCarList(appNowCarLists);
//订单选择的采购订单列表
orderInfo.setReadyCarList(appReadyCarLists);
vo.setPrice(data.getPrice());
}
vo.setOrderInfo(orderInfo);
//查询该车型下的现车列表
ResultBean<List<AppBaseVehicleOrderVo>> orderVoResultBean = baseVehicleFeign.selectAppList(modelSid, configSid);
if (orderVoResultBean.getSuccess()) {
List<AppBaseVehicleOrderVo> voList = orderVoResultBean.getData();
for (AppBaseVehicleOrderVo vehicleOrderVo : voList) {
AppNowCarVo appNowCarVo = new AppNowCarVo();
BeanUtil.copyProperties(vehicleOrderVo, appNowCarVo);
appNowCars.add(appNowCarVo);
voList.removeAll(Collections.singleton(null));
if (!voList.isEmpty()) {
for (AppBaseVehicleOrderVo vehicleOrderVo : voList) {
AppNowCarVo appNowCarVo = new AppNowCarVo();
BeanUtil.copyProperties(vehicleOrderVo, appNowCarVo);
appNowCars.add(appNowCarVo);
}
}
appCarInfo.setNowCar(appNowCars);
}
@ -1540,26 +1545,29 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
ResultBean<List<AppBusVehicleApplyListVo>> applyListResultBean = busVehicleApplyDetailFeign.getAppApplyList(modelSid, configSid);
if (applyListResultBean.getSuccess()) {
List<AppBusVehicleApplyListVo> applyListVos = applyListResultBean.getData();
for (AppBusVehicleApplyListVo applyListVo : applyListVos) {
//采购订单信息
AppReadyCarVo appReadyCarVo = new AppReadyCarVo();
BeanUtil.copyProperties(applyListVo, appReadyCarVo);
if (StringUtils.isNotBlank(applyListVo.getTotalNum())) {
//总数量
int totalNum = Integer.parseInt(applyListVo.getTotalNum());
if (StringUtils.isNotBlank(applyListVo.getLockingNum())) {
//锁定数量
int lockNum = Integer.parseInt(applyListVo.getLockingNum());
//可使用数量
int canUseNum = totalNum - lockNum;
appReadyCarVo.setCanUseNum(String.valueOf(canUseNum));
applyListVos.removeAll(Collections.singleton(null));
if (!applyListVos.isEmpty()) {
for (AppBusVehicleApplyListVo applyListVo : applyListVos) {
//采购订单信息
AppReadyCarVo appReadyCarVo = new AppReadyCarVo();
BeanUtil.copyProperties(applyListVo, appReadyCarVo);
if (StringUtils.isNotBlank(applyListVo.getTotalNum())) {
//总数量
int totalNum = Integer.parseInt(applyListVo.getTotalNum());
if (StringUtils.isNotBlank(applyListVo.getLockingNum())) {
//锁定数量
int lockNum = Integer.parseInt(applyListVo.getLockingNum());
//可使用数量
int canUseNum = totalNum - lockNum;
appReadyCarVo.setCanUseNum(String.valueOf(canUseNum));
} else {
appReadyCarVo.setCanUseNum(String.valueOf(totalNum));
}
} else {
appReadyCarVo.setCanUseNum(String.valueOf(totalNum));
appReadyCarVo.setCanUseNum("0");
}
} else {
appReadyCarVo.setCanUseNum("0");
appReadyCar.add(appReadyCarVo);
}
appReadyCar.add(appReadyCarVo);
}
appCarInfo.setReadyCar(appReadyCar);
}
@ -1884,7 +1892,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
}
if ("02".equals(busSalesOrderDepositDetailsVo.getDepositTypeKey())) {
List<BusDepositFictitiousDetailsVo> list = busDepositFictitiousService.detailsList(busSalesOrderDepositDetailsVo.getSid());
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
list.removeAll(Collections.singleton(null));
if (list.isEmpty()) {
isDeposit = false;
}
@ -1918,7 +1926,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
}
//该销售订单所选择的现车的列表
List<AppNowCarListVo> nowCarList = busSalesOrderVehicleService.selectAppDetailsVoBySaleOrderSid(sid);
nowCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
nowCarList.removeAll(Collections.singleton(null));
if (!nowCarList.isEmpty()) {
boolean isCheck = isCheck(vinNoList, nowCarList);
if (isCheck) {
@ -1979,7 +1987,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
appCarInfo.setReadyCar(appReadyCar);
//销售订单下的所选择的采购订单列表
List<AppReadyCarListVo> appReadyCarList = busSalesVehicleOrderService.selectAppDetailsVoBySaleOrderSid(sid);
appReadyCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
appReadyCarList.removeAll(Collections.singleton(null));
if (!appReadyCarList.isEmpty()) {
//验证所选采购订单的车辆是否发生了变化
boolean isCheck = isCheck2(map, appReadyCarList);
@ -2047,19 +2055,19 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
}
/***************************车型信息***************************************/
AppOrderModelInfoVo modelInfo = busSalesOrderModelService.selectModel(sid);
//若订单类型为0则为现车,为1采购订单,为2排产
if ("0".equals(modelInfo.getType())) {
//查询车架号
List<String> vinList = busSalesOrderVehicleService.selectList(sid);
modelInfo.setVinList(vinList);
} else {
if ("1".equals(modelInfo.getType())) {
//查询采购订单编号
List<String> stringList = busSalesVehicleOrderService.selectList(sid);
modelInfo.setOrderList(stringList);
}
}
if (modelInfo != null) {
//若订单类型为0则为现车,为1采购订单,为2排产
if ("0".equals(modelInfo.getType())) {
//查询车架号
List<String> vinList = busSalesOrderVehicleService.selectList(sid);
modelInfo.setVinList(vinList);
} else {
if ("1".equals(modelInfo.getType())) {
//查询采购订单编号
List<String> stringList = busSalesVehicleOrderService.selectList(sid);
modelInfo.setOrderList(stringList);
}
}
vo.setModelInfo(modelInfo);
}
@ -2083,7 +2091,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
}
/***************************主车优惠***************************************/
List<AppOrderDiscountListVo> discountList = busSalesOrderDiscountService.selectDiscount(sid);
discountList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
discountList.removeAll(Collections.singleton(null));
if (!discountList.isEmpty()) {
vo.setDiscountList(discountList);
}
@ -2093,7 +2101,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
String a = "由";
if ("02".equals(depositInfo.getDepositTypeKey())) {
List<BusDepositFictitiousDetailsVo> list = busDepositFictitiousService.detailsList(depositInfo.getSid());
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
list.removeAll(Collections.singleton(null));
if (!list.isEmpty()) {
for (BusDepositFictitiousDetailsVo v : list) {
String b = "编号为" + v.getDepositBillNo() + "虚拟订单订金转入" + v.getPrice() + "元,";

9
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderdeposit/BusSalesOrderDepositService.java

@ -56,6 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@ -143,7 +144,7 @@ public class BusSalesOrderDepositService extends MybatisBaseService<BusSalesOrde
} else {
//根据订金sid查询虚拟订单和订金的关联
List<AppBusSalesOrderDepositListVo> listVos = busDepositFictitiousService.getList(vo.getSid());
listVos.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
listVos.removeAll(Collections.singleton(null));
if (!listVos.isEmpty()) {
for (AppBusSalesOrderDepositListVo listVo : listVos) {
String payPath = listVo.getPayPath();
@ -191,14 +192,14 @@ public class BusSalesOrderDepositService extends MybatisBaseService<BusSalesOrde
}
}
List<AppBusSalesOrderDepositListVo> list = busDepositFictitiousService.getList(depositSid);
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
list.removeAll(Collections.singleton(null));
if (list.size() > 0) {
busDepositFictitiousService.deleteByDepositSid(depositSid);
}
//若缴纳方式为订金结转
if ("02".equals(dto.getDepositTypeKey())) {
List<AppBusSalesOrderDepositListDto> listVos = dto.getVirtualOrderList();
listVos.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
listVos.removeAll(Collections.singleton(null));
for (AppBusSalesOrderDepositListDto listDto : listVos) {
//查询付款人是否和客户一样
BusDeposit busDeposit = busDepositService.selectByBillSid(listDto.getDepositBillSid());
@ -224,7 +225,7 @@ public class BusSalesOrderDepositService extends MybatisBaseService<BusSalesOrde
IPage<BusMainDeposit> page = PagerUtil.queryToPage(pagerQuery);
IPage<AppDepositListVo> pagging = baseMapper.getDepositList(page, qw, query.getName());
List<AppDepositListVo> list = pagging.getRecords();
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
list.removeAll(Collections.singleton(null));
if (!list.isEmpty()) {
for (AppDepositListVo vo : list) {
String deposit = vo.getDeposit();

5
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderdiscount/BusSalesOrderDiscountService.java

@ -43,9 +43,8 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* Project: anrui-buscenter(业务管理) <br/>
@ -106,7 +105,7 @@ public class BusSalesOrderDiscountService extends MybatisBaseService<BusSalesOrd
public ResultBean<List<AppBusSalesOrderDiscountListVo>> getDiscountList(String sid) {
ResultBean<List<AppBusSalesOrderDiscountListVo>> rb = ResultBean.fireFail();
List<AppBusSalesOrderDiscountListVo> list = baseMapper.getDiscountList(sid);
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList());
list.removeAll(Collections.singleton(null));
if (!list.isEmpty()) {
for (AppBusSalesOrderDiscountListVo discountListVo : list) {
if (StringUtils.isNotBlank(discountListVo.getDiscountExplain())) {

11
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/SysStaffinfoFeign.java

@ -1,5 +1,7 @@
package com.yxt.anrui.portal.api.sysstaffinfo;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffQuery;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
@ -92,7 +94,7 @@ public interface SysStaffinfoFeign {
*/
@ApiOperation("获取集团内全部员工姓名")
@GetMapping("/getStaffName")
public ResultBean<List<Map<String,String>>> getStaffName(@RequestParam(value = "staffName", required = false) String staffName);
public ResultBean<List<Map<String, String>>> getStaffName(@RequestParam(value = "staffName", required = false) String staffName);
/**
* 获取部门内全部员工姓名
@ -102,7 +104,7 @@ public interface SysStaffinfoFeign {
*/
@ApiOperation("获取部门内全部员工姓名")
@GetMapping("/getStaffNameByDeptSid")
public ResultBean<List<Map<String,String>>> getStaffNameByDeptSid(@RequestParam(value = "staffName", required = false) String staffName,@RequestParam(value = "deptSid") String deptSid);
public ResultBean<List<Map<String, String>>> getStaffNameByDeptSid(@RequestParam(value = "staffName", required = false) String staffName, @RequestParam(value = "deptSid") String deptSid);
@ApiOperation("获取App通讯录")
@ -125,5 +127,10 @@ public interface SysStaffinfoFeign {
@GetMapping("/selectStaffList")
ResultBean<List<PcSysStaffVo>> selectStaffList(@SpringQueryMap PcSysStaffQuery pcSysStaffQuery);
@ApiOperation("移动端-销售订单-内部推荐人下拉框")
@ResponseBody
@GetMapping("/getUserList")
ResultBean<PagerVo<AppSysStaffVo>> getUserList(@RequestBody PagerQuery<AppSysStaffQuery> pagerQuery);
}

7
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/SysStaffinfoFeignFallback.java

@ -1,5 +1,7 @@
package com.yxt.anrui.portal.api.sysstaffinfo;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffQuery;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
@ -81,4 +83,9 @@ public class SysStaffinfoFeignFallback implements SysStaffinfoFeign {
return null;
}
@Override
public ResultBean<PagerVo<AppSysStaffVo>> getUserList(PagerQuery<AppSysStaffQuery> pagerQuery) {
return null;
}
}

19
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/app/AppSysStaffQuery.java

@ -0,0 +1,19 @@
package com.yxt.anrui.portal.api.sysstaffinfo.app;
import com.yxt.common.core.query.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author dimengzhe
* @Date 2022/6/11 9:44
* @Description
*/
@Data
public class AppSysStaffQuery implements Query {
private static final long serialVersionUID = 4724669786231817593L;
@ApiModelProperty(value = "用户名称")
private String name;
@ApiModelProperty(value = "用户sid")
private String userSid;
}

30
anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/sysstaffinfo/app/AppSysStaffVo.java

@ -0,0 +1,30 @@
package com.yxt.anrui.portal.api.sysstaffinfo.app;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author dimengzhe
* @Date 2022/6/11 9:29
* @Description
*/
@Data
public class AppSysStaffVo implements Vo {
private static final long serialVersionUID = -4051562700421770402L;
@ApiModelProperty(value = "用户sid")
private String userSid;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "头像")
private String userImage;
@ApiModelProperty(value = "电话")
private String userMobile;
@ApiModelProperty(value = "部门")
private String department;
@ApiModelProperty(value = "岗位")
private String position;
@ApiModelProperty(value = "头像:后端内部使用")
private String headImage;
}

7
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoMapper.java

@ -1,11 +1,13 @@
package com.yxt.anrui.portal.biz.sysstaffinfo;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yxt.anrui.portal.api.sysorganization.AppContactSysOrganizationVo;
import com.yxt.anrui.portal.api.sysstaffinfo.*;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -103,10 +105,11 @@ public interface SysStaffinfoMapper extends BaseMapper<SysStaffinfo> {
* @return
*/
int updateBySid(@Param("personType") String personType, @Param("personTypeKey") String personTypeKey,
@Param("sid") String sid, @Param("date") Date date, @Param("reason") String reason);
@Param("sid") String sid, @Param("date") Date date, @Param("reason") String reason);
/**
* 查询当前分公司下的员工信息
*
* @param orgSid 分公司sid
* @return
*/
@ -115,4 +118,6 @@ public interface SysStaffinfoMapper extends BaseMapper<SysStaffinfo> {
List<Map<String, String>> getStaffName(@Param(Constants.WRAPPER) Wrapper<Map<String, Object>> qw);
List<Map<String, String>> getStaffNameByDeptSid(@Param(Constants.WRAPPER) Wrapper<Map<String, Object>> qw);
IPage<AppSysStaffVo> getUserList(IPage<SysStaffinfo> page, @Param(Constants.WRAPPER) QueryWrapper<AppSysStaffVo> qw, @Param("orgSid") String orgSid);
}

134
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoMapper.xml

@ -8,22 +8,22 @@
resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoAppContactsVo">
SELECT staff.sid, staff.name, staff.mobile, staff.pinYinName, staff.firstPinYinLabel, user.headImage
FROM sys_staffinfo staff
LEFT JOIN sys_user user
ON staff.sid = user.staffSid
LEFT JOIN sys_user user
ON staff.sid = user.staffSid
ORDER BY staff.firstPinYinLabel = '#', staff.firstPinYinLabel ASC, staff.pinYinName
</select>
<select id="searchAppContactsPageList"
resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoAppContactsSearchVo">
SELECT staff.sid,
staff.name,
staff.mobile,
staff.position,
user.headImage,
GROUP_CONCAT(org.orgName SEPARATOR '/') orgName
staff.name,
staff.mobile,
staff.position,
user.headImage,
GROUP_CONCAT(org.orgName SEPARATOR '/') orgName
FROM sys_staffinfo staff
LEFT JOIN sys_staff_org org ON org.staffSid = staff.sid
LEFT JOIN sys_user user ON staff.sid = user.staffSid
LEFT JOIN sys_staff_org org ON org.staffSid = staff.sid
LEFT JOIN sys_user user ON staff.sid = user.staffSid
WHERE 1 = 1
<if test="mobileStr != null and mobileStr != ''">
AND staff.mobile LIKE concat('%', #{mobileStr}, '%')
@ -48,9 +48,9 @@
staff.position,
GROUP_CONCAT(org.orgNamePath SEPARATOR '/') orgNamePath
FROM sys_staffinfo staff
LEFT JOIN sys_user user
ON staff.sid = user.staffSid
LEFT JOIN sys_staff_org org ON staff.sid = org.staffSid
LEFT JOIN sys_user user
ON staff.sid = user.staffSid
LEFT JOIN sys_staff_org org ON staff.sid = org.staffSid
WHERE staff.sid = #{staffSid}
GROUP BY staff.sid
</select>
@ -66,16 +66,17 @@
IFNULL(NULL, '3') AS type,
IFNULL(NULL, 0) AS staffNum
FROM sys_staff_org org
INNER JOIN sys_staffinfo staff ON org.staffSid = staff.sid
LEFT JOIN sys_user user
ON staff.sid = user.staffSid
INNER JOIN sys_staffinfo staff ON org.staffSid = staff.sid
LEFT JOIN sys_user user
ON staff.sid = user.staffSid
WHERE org.orgSid = #{sid}
</select>
<!--根据员工类型key查询员工工号的最大号-->
<select id="selectJobNumber" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo">
select *
from sys_staffinfo
order by jobNumber desc limit 1
order by jobNumber desc
limit 1
</select>
<!--根据手机号查询员工是否重复-->
<select id="selectByMobile" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo">
@ -104,21 +105,24 @@
DATE_FORMAT(si.joinCompnyDate, '%Y-%m-%d') AS joinCompnyDate,
<!--所在部门-->
(select GROUP_CONCAT(orgName SEPARATOR ',') orgName from sys_staff_org so where so.staffSid = si.sid) as
orgName,
orgName,
<!--所在部门sid-->
(select GROUP_CONCAT(orgSid SEPARATOR ',') orgSid from sys_staff_org so where so.staffSid = si.sid) as
orgSid,
orgSid,
<!--岗位-->
(select GROUP_CONCAT(sp.name SEPARATOR ',') postName from sys_staff_post ssp left
join sys_post sp on
sp.sid =
ssp.postSid where ssp.staffSid = si.sid group by ssp.id) as postName
(select GROUP_CONCAT(sp.name SEPARATOR ',') postName
from sys_staff_post ssp
left join sys_post sp on
sp.sid =
ssp.postSid
where ssp.staffSid = si.sid
group by ssp.id) as postName
from sys_staffinfo si
LEFT JOIN sys_staff_org so
ON so.staffSid = si.sid
LEFT JOIN sys_staff_post ssp
ON ssp.staffSid = si.sid
${ew.customSqlSegment}
LEFT JOIN sys_staff_org so
ON so.staffSid = si.sid
LEFT JOIN sys_staff_post ssp
ON ssp.staffSid = si.sid
${ew.customSqlSegment}
</select>
<!--根据员工手机号和sid查询员工信息是否已存在-->
<select id="selectByMobileAndSid" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo">
@ -206,27 +210,27 @@
<!--开户行-->
openBank,
<!--身份证(人像面)-->
IF(idCardA = "",idCardA,CONCAT(#{path}, idCardA)) AS idCardA,
IF(idCardA = "", idCardA, CONCAT(#{path}, idCardA)) AS idCardA,
<!--NULLIF(idCardA,CONCAT(#{path}, idCardA) as idCardA),-->
<!--when idCardA is null then idCardA else concat(#{path}, idCardA) as idCardA end,-->
<!--身份证(国徽面)-->
IF(idCardB = "",idCardB,CONCAT(#{path}, idCardB)) AS idCardB,
IF(idCardB = "", idCardB, CONCAT(#{path}, idCardB)) AS idCardB,
<!--NULLIF(idCardB,concat(#{path}, idCardB) as idCardB),-->
<!--when idCardB is null then idCardB else concat(#{path}, idCardB) as idCardB end,-->
<!--学历证书-->
IF(diploma = "",diploma,CONCAT(#{path}, diploma)) AS diploma,
IF(diploma = "", diploma, CONCAT(#{path}, diploma)) AS diploma,
<!--NULLIF(CONCAT(#{path}, diploma) as diploma,diploma),-->
<!--when diploma is null then diploma else concat(#{path}, diploma) as diploma end,-->
<!--学位证书-->
IF(degreeCertificate = "",degreeCertificate,CONCAT(#{path}, degreeCertificate)) AS degreeCertificate,
IF(degreeCertificate = "", degreeCertificate, CONCAT(#{path}, degreeCertificate)) AS degreeCertificate,
<!--NULLIF(CONCAT(#{path}, degreeCertificate) as degreeCertificate,degreeCertificate),-->
<!--when degreeCertificate is null then degreeCertificate else concat(#{path}, degreeCertificate) as degreeCertificate end,-->
<!--前公司离职证明-->
IF(leaveCertificate = "",leaveCertificate,CONCAT(#{path}, leaveCertificate)) AS leaveCertificate,
IF(leaveCertificate = "", leaveCertificate, CONCAT(#{path}, leaveCertificate)) AS leaveCertificate,
<!--NULLIF(CONCAT(#{path}, leaveCertificate) as leaveCertificate,leaveCertificate),-->
<!--when leaveCertificate is null then leaveCertificate else concat(#{path}, leaveCertificate) as leaveCertificate end,-->
<!--员工照片-->
IF(photo = "",photo,CONCAT(#{path}, photo)) AS photo,
IF(photo = "", photo, CONCAT(#{path}, photo)) AS photo,
<!--NULLIF(CONCAT(#{path}, photo) as photo,photo),-->
<!--when photo is null then photo else concat(#{path}, photo) as photo end,-->
<!--毕业院校-->
@ -245,8 +249,9 @@
<!--意外险参保:1是,0否-->
isHaveInsurance,
<!--意外险参保:1是,0否-->
case isHaveInsurance when 1 then '是'
when 0 then '否' end as isHaveInsuranceValue,
case isHaveInsurance
when 1 then '是'
when 0 then '否' end as isHaveInsuranceValue,
<!--意外险参保时间-->
DATE_FORMAT(insuranceStartDate, '%Y-%m-%d') as insuranceStartDate,
<!--意外险参保终止日期-->
@ -256,23 +261,27 @@
<!--养老:1是,0否-->
isHaveAged,
<!--养老:1是,0否-->
case isHaveAged when 1 then '是'
when 0 then '否' end as isHaveAgedValue,
case isHaveAged
when 1 then '是'
when 0 then '否' end as isHaveAgedValue,
<!--医疗:1是,0否-->
isHaveMedical,
<!--医疗:1是,0否-->
case isHaveMedical when 1 then '是'
when 0 then '否' end as isHaveMedicalValue,
case isHaveMedical
when 1 then '是'
when 0 then '否' end as isHaveMedicalValue,
<!--工伤:1是,0否-->
isHaveInjury,
<!--工伤:1是,0否-->
case isHaveInjury when 1 then '是'
when 0 then '否' end as isHaveInjuryValue,
case isHaveInjury
when 1 then '是'
when 0 then '否' end as isHaveInjuryValue,
<!--失业:1是,0否-->
isHaveUnemploy,
<!--失业:1是,0否-->
case isHaveUnemploy when 1 then '是'
when 0 then '否' end as isHaveUnemployValue,
case isHaveUnemploy
when 1 then '是'
when 0 then '否' end as isHaveUnemployValue,
<!--社保参保地-->
insuredPlace,
<!--纸质档案保管地-->
@ -301,7 +310,7 @@
<select id="selectStaffList" resultType="com.yxt.anrui.portal.api.sysstaffinfo.PcSysStaffVo">
select sso.staffSid, si.name staffName
from sys_staff_org sso
left join sys_staffinfo si on sso.staffSid = si.sid
left join sys_staffinfo si on sso.staffSid = si.sid
where find_in_set(#{orgSid}, replace(sso.orgSidPath, '/', ','))
</select>
@ -311,13 +320,34 @@
</select>
<select id="getStaffNameByDeptSid" resultType="java.util.Map">
SELECT DISTINCT
ss.sid,
ss.name
FROM
sys_staffinfo ss
LEFT JOIN sys_staff_org sso
ON ss.`sid` = sso.`staffSid`
${ew.customSqlSegment}
SELECT DISTINCT ss.sid,
ss.name
FROM sys_staffinfo ss
LEFT JOIN sys_staff_org sso
ON ss.`sid` = sso.`staffSid`
${ew.customSqlSegment}
</select>
<select id="getUserList" resultType="com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo">
select su.sid userSid,
si.name userName,
su.headImage,
si.mobile userMobile,
sso.orgName as department,
sp.name
from sys_staff_org sso
left join sys_staffinfo si on sso.staffSid = si.sid
left join sys_user su on si.sid = su.staffSid
left join sys_staff_post ssp on si.sid = ssp.staffSid
left join sys_post sp on sp.sid = ssp.postSid
<where>
${ew.sqlSegment}
<if test="orgSid != null and orgSid != ''">
and find_in_set(#{orgSid}
, replace (sso.orgSidPath
, '/'
, ','))
</if>
</where>
</select>
</mapper>

11
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoRest.java

@ -2,6 +2,8 @@ package com.yxt.anrui.portal.biz.sysstaffinfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.portal.api.sysstaffinfo.*;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffQuery;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo;
import com.yxt.anrui.portal.biz.sysuser.SysUserService;
import com.yxt.common.base.config.component.FileUploadComponent;
import com.yxt.common.base.utils.PagerUtil;
@ -142,7 +144,7 @@ public class SysStaffinfoRest implements SysStaffinfoFeign {
@Override
public ResultBean<List<Map<String, String>>> getStaffNameByDeptSid(String staffName, String deptSid) {
ResultBean rb = ResultBean.fireFail();
List<Map<String, String>> staffNameList = sysStaffinfoService.getStaffNameByDeptSid(staffName,deptSid);
List<Map<String, String>> staffNameList = sysStaffinfoService.getStaffNameByDeptSid(staffName, deptSid);
return rb.success().setData(staffNameList);
}
@ -185,5 +187,12 @@ public class SysStaffinfoRest implements SysStaffinfoFeign {
return sysStaffinfoService.selectStaffList(pcSysStaffQuery);
}
@Override
public ResultBean<PagerVo<AppSysStaffVo>> getUserList(PagerQuery<AppSysStaffQuery> pagerQuery) {
ResultBean rb = ResultBean.fireFail();
PagerVo<AppSysStaffVo> pv = sysStaffinfoService.getUserList(pagerQuery);
return rb.success().setData(pv);
}
}

46
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoService.java

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.portal.api.sysorganization.AppContactSysOrganizationVo;
import com.yxt.anrui.portal.api.sysorganization.SysOrganization;
import com.yxt.anrui.portal.api.sysstaffinfo.*;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffQuery;
import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgDetailsVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgDto;
@ -25,12 +27,14 @@ import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.base.utils.PinYinUtils;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* Project: anrui_portal(门户建设) <br/>
@ -223,7 +227,7 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper,
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
String birthday = simpleDateFormat.format(dto.getBirthday());
String substring = idNo.substring(6, 14);
if (!birthday.equals(substring)){
if (!birthday.equals(substring)) {
return rb.setMsg("选择的出生日期和身份证出生日期不符,请重新选择");
}
//查询部门和岗位是否为空
@ -553,7 +557,7 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper,
if (StringUtils.isNotBlank(staffName)) {
qw.like("name", staffName);
}
qw.eq("isDelete",0);
qw.eq("isDelete", 0);
return baseMapper.getStaffName(qw);
}
@ -562,8 +566,42 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper,
if (StringUtils.isNotBlank(staffName)) {
qw.like("ss.name", staffName);
}
qw.eq("sso.orgSid",deptSid);
qw.eq("ss.isDelete",0);
qw.eq("sso.orgSid", deptSid);
qw.eq("ss.isDelete", 0);
return baseMapper.getStaffNameByDeptSid(qw);
}
public PagerVo<AppSysStaffVo> getUserList(PagerQuery<AppSysStaffQuery> pagerQuery) {
IPage<SysStaffinfo> page = PagerUtil.queryToPage(pagerQuery);
AppSysStaffQuery params = pagerQuery.getParams();
QueryWrapper<AppSysStaffVo> qw = new QueryWrapper<>();
String orgSid = "";
if (params != null) {
if (StringUtils.isNotBlank(params.getUserSid())) {
ResultBean<String> stringResultBean = sysStaffOrgService.getPathSidByUserSid(params.getUserSid());
if (stringResultBean.getSuccess()) {
orgSid = stringResultBean.getData();
}
}
if (StringUtils.isNotBlank(params.getName())) {
}
}
IPage<AppSysStaffVo> pagging = baseMapper.getUserList(page, qw, orgSid);
List<AppSysStaffVo> list = pagging.getRecords();
list.removeAll(Collections.singleton(null));
if (!list.isEmpty()) {
for (AppSysStaffVo vo : list) {
String headImage = vo.getHeadImage();
if (StringUtils.isNotBlank(headImage)) {
if (!headImage.contains(fileUploadComponent.getUrlPrefix())) {
headImage = fileUploadComponent.getUrlPrefix() + headImage;
}
vo.setUserImage(headImage);
}
}
}
PagerVo<AppSysStaffVo> p = PagerUtil.pageToVo(pagging, null);
return p;
}
}
Loading…
Cancel
Save