This commit is contained in:
gaowdong 2025-04-01 15:52:55 +08:00
commit bf0bc2eb35
28 changed files with 2385 additions and 1155 deletions

View File

@ -1,9 +1,6 @@
package com.bonus.canteen.core.customer.device.service;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bonus.canteen.core.common.utils.AesEncryptUtil;
import com.bonus.canteen.core.common.utils.SpringContextHolder;
@ -20,7 +17,6 @@ import com.bonus.canteen.core.customer.model.CustInfo;
import com.bonus.canteen.core.customer.service.CustAccTempService;
import com.bonus.canteen.core.customer.service.CustAddrService;
import com.bonus.canteen.core.customer.service.CustInfoService;
import com.bonus.canteen.core.customer.service.CustOrgService;
import com.bonus.canteen.core.customer.v4.mobile.service.CustPhotoService;
import com.bonus.canteen.core.nutrition.api.NutritionApi;
import com.bonus.common.core.exception.ServiceException;
@ -37,7 +33,6 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.lang.invoke.SerializedLambda;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@ -134,11 +129,6 @@ public class CustDeviceService {
throw new ServiceException(I18n.getMessage("customer.customer.inExists"));
} else {
CustInfo custInfo = (CustInfo)infoOptional.get();
CustOrgService orgService = (CustOrgService)SpringContextHolder.getBean(CustOrgService.class);
// Optional<CustOrg> orgOptional = Optional.ofNullable((CustOrg)orgService.getOne((Wrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getOrgId, custInfo.getOrgId())));
// orgOptional.ifPresent((custOrg) -> {
// custInfo.setOrgFullName(custOrg.getOrgFullName());
// });
return CustInfoDeviceVO.of(custInfo);
}
}

View File

@ -1,43 +0,0 @@
package com.bonus.canteen.core.customer.mapper;
import com.bonus.canteen.core.customer.po.QueryOrgsBasicInfoPO;
import com.bonus.canteen.core.customer.vo.OrgBasicInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface CustOrgMapper {
// void updateChildOrg(@Param("params") UpdateChildOrgPO updateChildOrgPO);
// List<CustOrgTreeDTO> getOrgLazyTree(@Param("superId") Long superId, @Param("effId") Long effId);
// List<CustOrgTreeDTO> listAllOrg();
// @LeNiuDataPermission(
// alias = "org",
// permissionType = DataPermissionTypeEnum.PERMISSION_ORG
// )
// Page<CustOrgVO> pageCustOrgByParams(Page<CustOrg> page, @Param("custOrg") CustOrgPageDTO content);
// Page<CustOrgVO> queryPageCustOrg(Page<CustOrg> page, @Param("custOrg") CustOrgPageDTO content, @Param("userId") Long userId);
// @Select({"SELECT a.org_id, a.org_num, a.org_name, a.org_full_name, a.org_level, b.org_num superNum, a.super_id, a.org_head, a.org_tel, a.remarks, a.if_del, a.uptime from cust_org a LEFT JOIN cust_org b ON a.super_id = b.org_id ${ew.customSqlSegment} "})
// List<OrgQueryVO> queryOrgsForOpen(@Param("ew") QueryWrapper<CustOrg> queryWrapper);
// boolean superInDescendantNode(@Param("orgFullId") String orgFullId, @Param("superId") Long superId);
// List<CustOrgVO> queryCustOrgVOList(@Param("orgIdList") List<Long> orgIdList);
// List<Long> listDescendantOrgIdByOrgFullId(String orgFullId);
// List<Long> listChildOrgIdByOrgId(Long orgId);
List<OrgBasicInfoVO> listOrgBasicInfoByParams(@Param("params") QueryOrgsBasicInfoPO params);
// @Select({"SELECT t.* FROM cust_org t WHERE t.if_del = 2 and t.super_id = #{superId} order by t.sort"})
// List<CustOrgVO> getCustOrgLazyTree(Long parentId);
// CustOrg getOrgByCustId(@Param("custId") Long custId);
}

View File

@ -1,130 +0,0 @@
package com.bonus.canteen.core.customer.service;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.canteen.core.customer.constants.PersonalStatusEnum;
import com.bonus.common.houqin.i18n.I18n;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import java.lang.invoke.SerializedLambda;
import java.util.Collection;
import java.util.Collections;
@Component
public class CustOrgCheckService {
@Autowired
@Lazy
private CustOrgService custOrgService;
// @Autowired
// @Lazy
// private CustOrgMapper custOrgMapper;
@Autowired
@Lazy
private CustInfoService custInfoService;
// public void addCheck(CustOrg custOrg) {
// this.checkOrgChildNameExist((Long)null, custOrg.getSuperId(), custOrg.getOrgName());
// this.checkOrgNumExist((Long)null, custOrg.getOrgNum());
// }
// public void updateCheck(CustOrg custOrg) {
// this.checkOrgChildNameExist(custOrg.getOrgId(), custOrg.getSuperId(), custOrg.getOrgName());
// this.checkOrgNumExist(custOrg.getOrgId(), custOrg.getOrgNum());
// this.checkSuperOrgNotUnderDescendantNode(custOrg.getSuperId(), custOrg.getOrgFullId());
// }
// public void deleteCheck(Collection<Long> orgIds) {
// this.checkTopOrgCannotDelete(orgIds);
// this.checkExistCustomer(orgIds);
// }
// protected void checkTopOrgCannotDelete(Collection<Long> orgIds) {
// CustOrg topOrg = this.custOrgService.getTopOrg();
// if (orgIds.contains(topOrg.getOrgId())) {
// throw new ServiceException(I18n.getMessage("customer.org.top.cannotDelete", new Object[0]));
// }
// }
protected void checkExistCustomer(Collection<Long> orgIds) {
Long count = this.custInfoService.customerCountByParams(Collections.singleton(PersonalStatusEnum.NORMAL.getKey()), orgIds);
if (count > 0L) {
throw new ServiceException(I18n.getMessage("customer.org.haveCustomer", new Object[0]));
}
}
// protected void checkOrgNumExist(Long orgId, String orgNum) {
// if (!CharSequenceUtil.isBlank(orgNum)) {
// // boolean exists = this.custOrgMapper.exists((Wrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery().ne(ObjectUtil.isNotNull(orgId), CustOrg::getOrgId, orgId)).eq(CustOrg::getOrgNum, orgNum)).eq(CustOrg::getIfDel, LeConstants.COMMON_NO));
// boolean exists = this.custOrgMapper.exists(Wrappers.lambdaQuery(CustOrg.class)
// .ne(ObjectUtil.isNotNull(orgId), CustOrg::getOrgId, orgId)
// .eq(CustOrg::getOrgNum, orgNum)
// .eq(CustOrg::getIfDel, LeConstants.COMMON_NO));
// if (exists) {
// String var10002 = I18n.getMessage("customer.org.num.exists", new Object[0]);
// throw new ServiceException(var10002 + "[" + orgNum + "]");
// }
// }
// }
// protected void checkOrgChildNameExist(Long orgId, Long superId, String orgName) {
// // boolean exists = this.custOrgMapper.exists((Wrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery().ne(ObjectUtil.isNotNull(orgId), CustOrg::getOrgId, orgId)).eq(CustOrg::getSuperId, superId)).eq(CustOrg::getOrgName, orgName)).eq(CustOrg::getIfDel, LeConstants.COMMON_NO));
// boolean exists = this.custOrgMapper.exists(Wrappers.lambdaQuery(CustOrg.class)
// .ne(ObjectUtil.isNotNull(orgId), CustOrg::getOrgId, orgId)
// .eq(CustOrg::getSuperId, superId)
// .eq(CustOrg::getOrgName, orgName)
// .eq(CustOrg::getIfDel, LeConstants.COMMON_NO));
// if (exists) {
// String var10002 = I18n.getMessage("customer.org.sameLevel.name.exists", new Object[0]);
// throw new ServiceException(var10002 + "[" + orgName + "]");
// }
// }
// protected void checkSuperOrgNotUnderDescendantNode(Long superId, String orgFullId) {
// if (!ObjectUtil.isNull(superId) && !CharSequenceUtil.isBlank(orgFullId)) {
// if (this.custOrgMapper.superInDescendantNode(orgFullId, superId)) {
// throw new ServiceException(I18n.getMessage("customer.org.superInChild", new Object[0]));
// }
// }
// }
// $FF: synthetic method
// private static Object $deserializeLambda$(SerializedLambda lambda) {
// switch (lambda.getImplMethodName()) {
// case "getOrgName":
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/customer/model/CustOrg") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
// return CustOrg::getOrgName;
// }
// break;
// case "getOrgId":
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/customer/model/CustOrg") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
// return CustOrg::getOrgId;
// }
//
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/customer/model/CustOrg") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
// return CustOrg::getOrgId;
// }
// break;
// case "getSuperId":
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/customer/model/CustOrg") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
// return CustOrg::getSuperId;
// }
// break;
// case "getIfDel":
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/customer/model/CustOrg") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
// return CustOrg::getIfDel;
// }
//
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/customer/model/CustOrg") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
// return CustOrg::getIfDel;
// }
// break;
// case "getOrgNum":
// if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/customer/model/CustOrg") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
// return CustOrg::getOrgNum;
// }
// }
//
// throw new IllegalArgumentException("Invalid lambda deserialization");
// }
}

View File

@ -1,51 +0,0 @@
package com.bonus.canteen.core.customer.service;
import com.bonus.canteen.core.customer.po.QueryOrgsBasicInfoPO;
import com.bonus.canteen.core.customer.vo.OrgBasicInfoVO;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.List;
public interface CustOrgService {
// Page<CustOrgVO> pageCustOrgByParams(Page<CustOrg> page, CustOrgPageDTO content);
// CustOrg getCustOrg(Long id);
// CustOrg getCustOrgByOrgId(Long orgId);
// CustOrg getTopOrg();
// List<Long> queryChildCustOrgId(CustOrg superOrg);
// void addCustOrg(CustOrg custOrg);
// void updateOrg(CustOrg custOrg);
// void deleteByOrdId(Long orgId);
// List<Tree<Long>> getSystemOrgTree();
// List<Tree<Long>> getTenantOrgTree();
// List<CustOrgVO> queryCustOrgList(List<Long> orgIdList);
// JsonNode queryDiningPlaceByOrgId(Long orgId);
// CustOrg initTopCustOrg(String merchantName);
// CustOrg initTempCustOrg(CustOrg superOrg);
// CustOrg getTempCustOrg();
List<OrgBasicInfoVO> listOrgBasicInfoByParams(QueryOrgsBasicInfoPO queryOrgsBasicInfoPO);
// List<CustOrg> listOrgByLevel(Integer orgLeave);
// void batchAddCustOrgAndSerOrgIdNotCheck(List<CustAccExcelModel> custAccExcelModelList);
// boolean isTopOrg(Long orgId);
// List<CustOrgVO> getOrgLazyTree(CustOrgTreeDTO content);
// void dragOrgSort(CustOrgTreeDTO content);
}

View File

@ -19,7 +19,6 @@ import java.util.stream.Stream;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.houqin.constant.DelFlagEnum;
import com.bonus.canteen.core.account.v4.api.CardInfoServiceV4Api;
import com.bonus.canteen.core.account.vo.AccCardBaseInfoVO;
import com.bonus.canteen.core.customer.constants.CustConstant;
@ -32,7 +31,6 @@ import com.bonus.canteen.core.customer.model.CustInfo;
import com.bonus.canteen.core.customer.po.QueryOrgsBasicInfoPO;
import com.bonus.canteen.core.customer.service.CustInfoCheckService;
import com.bonus.canteen.core.customer.service.CustInfoService;
import com.bonus.canteen.core.customer.service.CustOrgService;
import com.bonus.canteen.core.customer.service.CustPsnTypeService;
import com.bonus.canteen.core.customer.vo.OrgBasicInfoVO;
import com.bonus.canteen.core.customer.vo.PsnTypeBacisInfoVO;
@ -53,10 +51,6 @@ public class CustInfoCheckServiceImpl implements CustInfoCheckService {
@Lazy
private CustInfoService custInfoService;
@Autowired
@Lazy
private CustOrgService custOrgService;
@Autowired
@Lazy
private CustPsnTypeService custPsnTypeService;
@ -68,7 +62,6 @@ public class CustInfoCheckServiceImpl implements CustInfoCheckService {
public void checkCustInfoOnlyAndSetRedundantData(CustInfoModel infoModel) {
this.checkCustNumUnique(infoModel.getCustNum(), infoModel.getCustId());
this.checkCusMobile(infoModel.getMobile(), infoModel.getCustId());
this.checkOrgAndSetNumAndFullName(infoModel.getOrgId(), infoModel);
this.checkPsnTypeAndSetPsnTypeName(infoModel.getPsnType(), infoModel);
this.checkIdCardAndSetBirthday(infoModel.getIdCard(), infoModel);
this.checkBirthday(infoModel.getBirthday());
@ -211,22 +204,6 @@ public class CustInfoCheckServiceImpl implements CustInfoCheckService {
}
}
protected void checkOrgAndSetNumAndFullName(Long orgId, CustInfoModel infoModel) {
QueryOrgsBasicInfoPO queryOrgsBasicInfoPO = (new QueryOrgsBasicInfoPO()).setOrgIds(Collections.singleton(orgId)).setDelFlags(Collections.singleton(OrgDelFlagEnum.DEL_FALSE.key()));
if (ObjectUtil.isNull(orgId)) {
queryOrgsBasicInfoPO.setSuperIds(Collections.singleton(CustConstant.DATA_DEFAULT_LONG));
}
List<OrgBasicInfoVO> orgBasicInfoVOList = this.custOrgService.listOrgBasicInfoByParams(queryOrgsBasicInfoPO);
if (CollUtil.isEmpty(orgBasicInfoVOList)) {
throw new ServiceException(RetCodeEnum.MKT_ERROR_PARAM+":"+ I18n.getMessage("customer.org.org.inexists", new Object[0]));
} else {
OrgBasicInfoVO orgBasicInfoVO = (OrgBasicInfoVO)orgBasicInfoVOList.get(0);
// infoModel.setOrgNum(orgBasicInfoVO.getOrgNum());
// infoModel.setOrgFullName(orgBasicInfoVO.getOrgFullName());
}
}
protected void checkPsnTypeAndSetPsnTypeName(Integer psnType, CustInfoModel infoModel) {
if (!ObjectUtil.isNull(psnType)) {
PsnTypeBacisInfoVO psnTypeBasicInfoVO = this.custPsnTypeService.getPsnTypeBasicInfoVO(psnType);

View File

@ -1,531 +0,0 @@
package com.bonus.canteen.core.customer.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.houqin.constant.DelFlagEnum;
import com.bonus.common.houqin.constant.LeConstants;
import com.bonus.canteen.core.auth.api.MgrAuthApi;
import com.bonus.canteen.core.common.constant.LeMqConstant;
import com.bonus.canteen.core.common.redis.RedisUtil;
import com.bonus.canteen.core.customer.api.CustInfoApi;
import com.bonus.canteen.core.customer.business.CustOrgPointBusiness;
import com.bonus.canteen.core.customer.constants.CustCacheKey;
import com.bonus.canteen.core.customer.constants.CustConstant;
import com.bonus.canteen.core.customer.dto.CustAccExcelModel;
import com.bonus.canteen.core.customer.dto.CustOrgPageDTO;
import com.bonus.canteen.core.customer.dto.CustOrgTreeDTO;
import com.bonus.canteen.core.customer.mapper.CustOrgMapper;
import com.bonus.canteen.core.customer.po.QueryOrgsBasicInfoPO;
import com.bonus.canteen.core.customer.po.UpdateChildOrgPO;
import com.bonus.canteen.core.customer.service.CustInfoService;
import com.bonus.canteen.core.customer.service.CustOrgCheckService;
import com.bonus.canteen.core.customer.service.CustOrgService;
import com.bonus.canteen.core.customer.utils.CommonConstants;
import com.bonus.canteen.core.customer.utils.CustomerCacheUtil;
import com.bonus.canteen.core.customer.vo.OrgBasicInfoVO;
import com.bonus.canteen.core.order.mq.MqUtil;
import com.bonus.common.houqin.utils.id.Id;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class CustOrgServiceImpl implements CustOrgService {
private static final Logger log = LoggerFactory.getLogger(CustOrgServiceImpl.class);
@Autowired
@Lazy
private CustInfoService custInfoService;
@Autowired
@Lazy
private CustInfoApi custInfoApi;
@Autowired
@Lazy
private MgrAuthApi mgrAuthApi;
@Autowired
@Lazy
CustOrgCheckService custOrgCheckService;
@Autowired
@Lazy
CustOrgMapper custOrgMapper;
@Autowired
@Lazy
CustOrgPointBusiness custOrgPointBusiness;
// public Page<CustOrgVO> pageCustOrgByParams(Page<CustOrg> page, CustOrgPageDTO content) {
// this.setOrgFullId(content);
// Page<CustOrgVO> recordPage = this.custOrgMapper.pageCustOrgByParams(page, content);
// this.setOrgInfo(recordPage.getRecords());
// this.custOrgPointBusiness.didPageCustOrg(content, recordPage);
// return recordPage;
// }
// public List<Long> queryChildCustOrgId(CustOrg superOrg) {
// List<Long> orgIdList = Lists.newArrayList();
// orgIdList.add(superOrg.getOrgId());
// List<CustOrg> allOrgList = this.list((Wrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getIfDel, LeConstants.COMMON_NO));
// if (CollectionUtils.isEmpty(allOrgList)) {
// return orgIdList;
// } else {
// List<CustOrg> childrenOrgList = this.queryChildren(superOrg.getOrgId(), Lists.newArrayList(), allOrgList);
// Iterator var5 = childrenOrgList.iterator();
//
// while(var5.hasNext()) {
// CustOrg temp = (CustOrg)var5.next();
// orgIdList.add(temp.getOrgId());
// }
//
// return orgIdList;
// }
// }
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void addCustOrg(CustOrg custOrg) {
// this.custOrgCheckService.addCheck(custOrg);
// CustOrg superOrg = this.getCustOrgByOrgId(custOrg.getSuperId());
// custOrg.setOrgId(Id.next());
// setCustOrgInfo(custOrg, superOrg);
// this.insert(custOrg);
// this.custOrgPointBusiness.didAddCustOrg(custOrg);
// }
// public void batchAddCustOrgAndSerOrgIdNotCheck(List<CustAccExcelModel> custAccExcelModelList) {
// if (!CollUtil.isEmpty(custAccExcelModelList)) {
// Map<String, CustOrg> superIdAndName_org = (Map)this.listAllCustOrg().stream().collect(Collectors.toMap((e) -> {
// Long var10000 = e.getSuperId();
// return "" + var10000 + e.getOrgName();
// }, Function.identity(), (e1, e2) -> {
// return e1;
// }));
// List<CustOrg> addCustOrgList = new ArrayList();
// CustOrg topOrg = this.getTopOrg();
// Iterator var5 = custAccExcelModelList.iterator();
//
// while(var5.hasNext()) {
// CustAccExcelModel excelModel = (CustAccExcelModel)var5.next();
// CustOrg superOrg = topOrg;
//
// for(int i = 2; i <= 6; ++i) {
// String orgNameByLevel = excelModel.getOrgNameByLevel(i);
// if (CharSequenceUtil.isBlank(orgNameByLevel)) {
// break;
// }
//
// Long var10001 = superOrg.getOrgId();
// CustOrg existOrg = (CustOrg)superIdAndName_org.get("" + var10001 + orgNameByLevel);
// if (ObjectUtil.isNotNull(existOrg)) {
// superOrg = existOrg;
// excelModel.setOrgId(existOrg.getOrgId());
// } else {
// CustOrg custOrg = (new CustOrg()).setOrgId(Id.next()).setOrgName(orgNameByLevel).setSuperId(superOrg.getOrgId());
// setCustOrgInfo(custOrg, superOrg);
// addCustOrgList.add(custOrg);
// superIdAndName_org.put(custOrg.getSuperId() + custOrg.getOrgName(), custOrg);
// superOrg = custOrg;
// excelModel.setOrgId(custOrg.getOrgId());
// }
// }
// }
//
// log.info("新增组织数量={}", CollUtil.size(addCustOrgList));
// this.insertBatch(addCustOrgList);
// }
// }
// public boolean isTopOrg(Long orgId) {
// CustOrg topOrg = this.getTopOrg();
// return ObjectUtil.equal(topOrg.getOrgId(), orgId);
// }
// public List<CustOrgVO> getOrgLazyTree(CustOrgTreeDTO content) {
// if (ObjectUtil.isNull(content)) {
// throw new ServiceException("入参不能为空");
// } else {
// Long parentId = (Long)Optional.ofNullable(content.getSuperId()).orElse(CommonConstants.MENU_TREE_ROOT_ID);
// return this.custOrgMapper.getCustOrgLazyTree(parentId);
// }
// }
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void dragOrgSort(CustOrgTreeDTO content) {
// String dragSortKey = CustCacheKey.getTenantKey("org:drag:sort");
// if (!RedisUtil.setNx(dragSortKey, 0, 300)) {
// throw new ServiceException("正在执行排序,请稍后再试!");
// } else {
// try {
// Long orgId = content.getOrgId();
// Integer newSort = content.getSort();
// CustOrg oldOrg = (CustOrg)this.getOne((Wrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getOrgId, orgId));
// if (ObjectUtil.isNull(oldOrg)) {
// throw new ServiceException("组织不存在");
// }
//
// Integer oldSort = oldOrg.getSort();
// List<CustOrg> siblings = this.list((Wrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getSuperId, content.getSuperId()));
// Iterator var8 = siblings.iterator();
//
// while(var8.hasNext()) {
// CustOrg sibling = (CustOrg)var8.next();
// if (sibling.getOrgId().equals(orgId)) {
// this.updateSortByOrgId(orgId, newSort);
// } else if (oldSort < newSort && sibling.getSort() > oldSort && sibling.getSort() <= newSort) {
// this.updateSortByOrgId(sibling.getOrgId(), sibling.getSort() - 1);
// } else if (oldSort > newSort && sibling.getSort() >= newSort && sibling.getSort() < oldSort) {
// this.updateSortByOrgId(sibling.getOrgId(), sibling.getSort() + 1);
// }
// }
// } finally {
// RedisUtil.delete(dragSortKey);
// }
//
// }
// }
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void updateOrg(CustOrg custOrg) {
// CustOrg oldOrg = this.getCustOrgByOrgId(custOrg.getOrgId());
// if (ObjectUtil.isNull(custOrg.getOrgFullId())) {
// custOrg.setOrgFullId(oldOrg.getOrgFullId());
// }
//
// this.custOrgCheckService.updateCheck(custOrg);
// CustOrg superOrg = this.getCustOrgByOrgId(custOrg.getSuperId());
// setCustOrgInfo(custOrg, superOrg);
// this.updateByOrgId(custOrg);
// List<Long> childOrgIdList = this.custOrgMapper.listDescendantOrgIdByOrgFullId(oldOrg.getOrgFullId());
// if (CollUtil.isNotEmpty(childOrgIdList)) {
// UpdateChildOrgPO updateChildOrgPO = (new UpdateChildOrgPO()).setOldOrgFullName(oldOrg.getOrgFullName()).setOrgFullName(custOrg.getOrgFullName()).setOldOrgFullId(oldOrg.getOrgFullId()).setOrgFullId(custOrg.getOrgFullId()).setDiffLevel(calculateLeaveDiff(custOrg.getOrgLevel(), oldOrg.getOrgLevel())).setEndDate(custOrg.getEndDate()).setChildOrgIdList(childOrgIdList);
// this.custOrgMapper.updateChildOrg(updateChildOrgPO);
// }
//
// ArrayList<Long> orgIdList = CollUtil.newArrayList(childOrgIdList);
// orgIdList.add(custOrg.getOrgId());
// this.changeCustInfoRedundantFields(orgIdList);
// this.custOrgPointBusiness.didUpdateCustOrg(custOrg);
// }
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void deleteByOrdId(Long orgId) {
// List<Long> orgIdList = new ArrayList();
// orgIdList.add(orgId);
// List<Long> childOrgIdList = this.custOrgMapper.listChildOrgIdByOrgId(orgId);
// orgIdList.addAll(childOrgIdList);
// this.custOrgCheckService.deleteCheck(orgIdList);
// this.deleteByOrgId(orgIdList);
// this.custOrgPointBusiness.didDeleteCustOrg(orgId, orgIdList);
// }
// public List<CustOrgVO> queryCustOrgList(List<Long> orgIdList) {
// return this.custOrgMapper.queryCustOrgVOList(orgIdList);
// }
// public JsonNode queryDiningPlaceByOrgId(Long orgId) {
// //CustOrg custOrg = (CustOrg)this.custOrgMapper.selectOne((Wrapper)Wrappers.lambdaQuery(CustOrg.class).select(new SFunction[]{CustOrg::getDiningPlace}).eq(CustOrg::getOrgId, orgId));
// CustOrg custOrg = this.custOrgMapper.selectOne(Wrappers.lambdaQuery(CustOrg.class)
// .select(CustOrg::getDiningPlace)
// .eq(CustOrg::getOrgId, orgId));
// return ObjectUtil.isNull(custOrg) ? null : custOrg.getDiningPlace();
// }
// public CustOrg initTopCustOrg(String merchantName) {
// CustOrg custOrg = new CustOrg();
// custOrg.setOrgId(Id.next());
// String merchantDefault = merchantName + "(默认)";
// custOrg.setOrgName(merchantDefault);
// custOrg.setOrgNum("0");
// custOrg.setOrgFullName(merchantDefault);
// custOrg.setOrgFullId("/" + custOrg.getOrgId() + "/");
// custOrg.setOrgLevel(1);
// custOrg.setSuperId(CustConstant.DATA_DEFAULT_LONG);
// this.insert(custOrg);
// return custOrg;
// }
// public CustOrg initTempCustOrg(CustOrg superOrg) {
// CustOrg custOrg = new CustOrg();
// custOrg.setOrgId(CustConstant.TEMPORARY_ORG_ID);
// custOrg.setOrgFullId(assembleOrgFullId(custOrg.getOrgId(), superOrg.getOrgFullId()));
// custOrg.setOrgName("临时部门");
// custOrg.setOrgLevel(superOrg.getOrgLevel() + 1);
// custOrg.setOrgFullName(assembleOrgFullName("临时部门", superOrg.getOrgFullName()));
// custOrg.setOrgNum("letemporaryorg");
// custOrg.setSuperId(superOrg.getOrgId());
// custOrg.setEndDate(calculateEndDate((LocalDate)null, superOrg.getEndDate()));
// this.insert(custOrg);
// return custOrg;
// }
// public List<Tree<Long>> getSystemOrgTree() {
// return this.getOrgTree(this.custOrgMapper.listAllOrg());
// }
// protected List<Tree<Long>> getOrgTree(List<CustOrgTreeDTO> systemOrgTree) {
// TreeNodeConfig treeNodeConfig = getTreeNodeConfig();
// return TreeUtil.build(systemOrgTree, CustConstant.DATA_DEFAULT_LONG, treeNodeConfig, (org, treeNode) -> {
// treeNode.setId(org.getOrgId());
// treeNode.setParentId(org.getSuperId());
// treeNode.setName(org.getOrgName());
// treeNode.setWeight(org.getSort());
// treeNode.putExtra("orgFullName", org.getOrgFullName());
// treeNode.putExtra("orgNum", org.getOrgNum());
// treeNode.putExtra("orgLevel", org.getOrgLevel());
// treeNode.putExtra("halfSelect", ObjectUtil.isNull(org.getHalfSelect()) ? 1 : org.getHalfSelect());
// });
// }
// protected static TreeNodeConfig getTreeNodeConfig() {
// TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
// treeNodeConfig.setParentIdKey("superId");
// treeNodeConfig.setNameKey("text");
// treeNodeConfig.setWeightKey("sort");
// return treeNodeConfig;
// }
// public List<Tree<Long>> getTenantOrgTree() {
// List<CustOrgTreeDTO> tenantOrg = this.mgrAuthApi.getTenantOrg(LeConstants.COMMON_NO);
// return this.getOrgTree(tenantOrg);
// }
// protected void setOrgFullId(CustOrgPageDTO content) {
// if (!ObjectUtil.isEmpty(content.getOrgId())) {
// String orgFullId = this.getOrgFullIdByOrgId(content.getOrgId());
// content.setOrgFullId(orgFullId);
// }
// }
// protected String getOrgFullIdByOrgId(Long orgId) {
// //CustOrg custOrg = (CustOrg)this.custOrgMapper.selectOne((Wrapper)Wrappers.lambdaQuery(CustOrg.class).select(new SFunction[]{CustOrg::getOrgFullId}).eq(CustOrg::getOrgId, orgId));
// CustOrg custOrg = this.custOrgMapper.selectOne(Wrappers.lambdaQuery(CustOrg.class)
// .select(CustOrg::getOrgFullId)
// .eq(CustOrg::getOrgId, orgId));
// return null == custOrg ? null : custOrg.getOrgFullId();
// }
// protected void setOrgInfo(List<CustOrgVO> custOrgVOList) {
// Set<Long> custIdSet = (Set)custOrgVOList.stream().map(CustOrgVO::getOrgHeadId).filter(Objects::nonNull).collect(Collectors.toSet());
// Map<Long, CustInfo> custId_entity = new HashMap();
// if (CollUtil.isNotEmpty(custIdSet)) {
//// custId_entity = (Map)this.custInfoApi.selectCustBasicsInfoListByCustIds(custIdSet).stream().collect(Collectors.toMap(CustInfo::getCustId, Function.identity()));
// }
//
// Iterator var4 = custOrgVOList.iterator();
//
// while(var4.hasNext()) {
// CustOrgVO custOrgVO = (CustOrgVO)var4.next();
// custOrgVO.setExpires(!ObjectUtil.isNull(custOrgVO.getEndDate()) && LocalDate.now().isAfter(custOrgVO.getEndDate()));
// Map<Long, Integer> orgId_customerNum = this.getCustomerNumInOrg();
// if (custOrgVO.getOrgId() == CustConstant.TEMPORARY_ORG_ID) {
// custOrgVO.setCustomerNum((Integer)orgId_customerNum.getOrDefault(CustConstant.TEMPORARY_ORG_ID.intValue(), 0));
// } else {
// custOrgVO.setCustomerNum((Integer)orgId_customerNum.getOrDefault(custOrgVO.getOrgId(), 0));
// }
//
// CustInfo custInfo = (CustInfo)((Map)custId_entity).get(custOrgVO.getOrgHeadId());
// if (ObjectUtil.isNotEmpty(custInfo)) {
// custOrgVO.setCustNum(custInfo.getCustNum());
// custOrgVO.setCustName(custInfo.getCustName());
// }
// }
//
// }
// protected List<CustOrg> queryChildren(Long orgId, List<CustOrg> resultList, List<CustOrg> allOrgList) {
// Iterator var4 = allOrgList.iterator();
//
// while(var4.hasNext()) {
// CustOrg node = (CustOrg)var4.next();
// if (orgId.equals(node.getSuperId())) {
// resultList.add(node);
// this.queryChildren(node.getOrgId(), resultList, allOrgList);
// }
// }
//
// return resultList;
// }
// public Map<Long, Integer> getCustomerNumInOrg() {
// Map<Long, Integer> cacheOrgId_customerNum = (Map)Optional.ofNullable(CustomerCacheUtil.getCustomerNumBelongOrgMapCache()).orElse(new HashMap());
// if (CollUtil.isNotEmpty(cacheOrgId_customerNum)) {
// return cacheOrgId_customerNum;
// } else {
// LocalDateTime now1 = LocalDateTime.now();
// Map<Long, Integer> orgId_partCustomerNum = this.custInfoService.getCustomerNumBelongOrg();
// List<Tree<Long>> tenantOrgTree = this.getSystemOrgTree();
// if (CollUtil.isEmpty(tenantOrgTree)) {
// return MapUtil.empty();
// } else {
// getOrgCountRecursion(cacheOrgId_customerNum, tenantOrgTree, orgId_partCustomerNum);
// log.info("cacheOrgId_customerNum【{}】", cacheOrgId_customerNum);
// CustomerCacheUtil.insertCustomerNumBelongOrgMapCache(cacheOrgId_customerNum);
// LocalDateTime now2 = LocalDateTime.now();
// log.info("用时[{}]毫秒", now1.until(now2, ChronoUnit.MILLIS));
// return cacheOrgId_customerNum;
// }
// }
// }
// public static int getOrgCountRecursion(Map<Long, Integer> orgId_customerNum, List<Tree<Long>> orgTree, Map<Long, Integer> orgId_partCustomerNum) {
// int totalCustomerNum = 0;
// if (CollUtil.isEmpty(orgTree)) {
// return totalCustomerNum;
// } else {
// int customerNum;
// for(Iterator var4 = orgTree.iterator(); var4.hasNext(); totalCustomerNum += customerNum) {
// Tree<Long> tree = (Tree)var4.next();
// if (tree.hasChild()) {
// customerNum = (Integer)orgId_partCustomerNum.getOrDefault(tree.getId(), 0) + getOrgCountRecursion(orgId_customerNum, tree.getChildren(), orgId_partCustomerNum);
// } else {
// customerNum = (Integer)orgId_partCustomerNum.getOrDefault(tree.getId(), 0);
// }
//
// orgId_customerNum.put((Long)tree.getId(), customerNum);
// }
//
// return totalCustomerNum;
// }
// }
// protected static void setCustOrgInfo(CustOrg custOrg, CustOrg superOrg) {
// custOrg.setOrgFullName(assembleOrgFullName(custOrg.getOrgName(), superOrg.getOrgFullName()));
// custOrg.setOrgFullId(assembleOrgFullId(custOrg.getOrgId(), superOrg.getOrgFullId()));
// custOrg.setEndDate(calculateEndDate(custOrg.getEndDate(), superOrg.getEndDate()));
// int orgLevel = custOrg.getOrgFullName().split("/").length;
// custOrg.setOrgLevel(orgLevel);
// }
// protected static LocalDate calculateEndDate(LocalDate endDate, LocalDate superEndDate) {
// if (endDate == null) {
// return superEndDate;
// } else if (superEndDate == null) {
// return null;
// } else {
// return endDate.isAfter(superEndDate) ? superEndDate : endDate;
// }
// }
// protected static String assembleOrgFullName(String orgName, String superOrgFullName) {
// return superOrgFullName + "/" + orgName;
// }
// protected static String assembleOrgFullId(Long orgId, String superOrgFullId) {
// return superOrgFullId + orgId + "/";
// }
//
// protected static int calculateLeaveDiff(Integer newLeave, Integer oldLeave) {
// return newLeave - oldLeave;
// }
//
// protected void changeCustInfoRedundantFields(Collection<Long> orgIdList) {
// this.custInfoService.updateCustomersOrgNumAndOrgFullName(orgIdList);
// }
// protected void insert(CustOrg custOrg) {
// if (!ObjectUtil.isNull(custOrg)) {
// this.custOrgMapper.insert(custOrg);
// MqUtil.sendDataChange(custOrg, LeMqConstant.DataChangeType.ADD, LeMqConstant.Topic.DATA_CHANGE_ORG);
// }
// }
// protected void insertBatch(List<CustOrg> custOrgList) {
// if (!ObjectUtil.isNull(custOrgList)) {
// this.saveBatch(custOrgList);
// }
// }
// protected void deleteByOrgId(Collection<Long> orgIdList) {
// if (!CollUtil.isEmpty(orgIdList)) {
// // this.custOrgMapper.update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(CustOrg.class).in(CustOrg::getOrgId, orgIdList)).set(CustOrg::getIfDel, LeConstants.COMMON_YES));
// this.custOrgMapper.update(null, Wrappers.lambdaUpdate(CustOrg.class).in(CustOrg::getOrgId, orgIdList).set(CustOrg::getIfDel, LeConstants.COMMON_YES));
// Iterator var2 = orgIdList.iterator();
//
// while(var2.hasNext()) {
// Long orgId = (Long)var2.next();
// CustOrg custOrg = new CustOrg();
// custOrg.setOrgId(orgId);
// MqUtil.sendDataChange(custOrg, LeMqConstant.DataChangeType.REMOVE, LeMqConstant.Topic.DATA_CHANGE_ORG);
// }
//
// }
// }
// protected void updateByOrgId(CustOrg custOrg) {
// if (!ObjectUtil.isNull(custOrg)) {
// //this.update(custOrg, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(CustOrg.class).set(CustOrg::getOrgHeadId, custOrg.getOrgHeadId())).eq(CustOrg::getOrgId, custOrg.getOrgId()));
// this.update(custOrg, Wrappers.lambdaUpdate(CustOrg.class)
// .set(CustOrg::getOrgHeadId, custOrg.getOrgHeadId())
// .eq(CustOrg::getOrgId, custOrg.getOrgId()));
// CustomerCacheUtil.deleteCustomerNumBelongOrgMapCache();
// CustomerCacheUtil.deleteCustomerNumBelongOrgMapCache();
// MqUtil.sendDataChange(custOrg, LeMqConstant.DataChangeType.UPDATE, LeMqConstant.Topic.DATA_CHANGE_ORG);
// }
// }
// public CustOrg getCustOrg(Long id) {
// return (CustOrg)this.custOrgMapper.selectById(id);
// }
// protected List<CustOrg> listAllCustOrg() {
// return this.custOrgMapper.selectList((Wrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getIfDel, DelFlagEnum.DEL_FALSE.key()));
// }
// public CustOrg getCustOrgByOrgId(@NotNull Long orgId) {
// return (CustOrg)this.custOrgMapper.selectOne((Wrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getOrgId, orgId));
// }
// public CustOrg getTopOrg() {
// //return (CustOrg)this.custOrgMapper.selectOne((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getIfDel, DelFlagEnum.DEL_FALSE.key())).eq(CustOrg::getOrgLevel, 1));
// return (CustOrg)this.custOrgMapper.selectOne((LambdaQueryWrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getIfDel, DelFlagEnum.DEL_FALSE.key()).eq(CustOrg::getOrgLevel, 1));
// }
public List<OrgBasicInfoVO> listOrgBasicInfoByParams(QueryOrgsBasicInfoPO queryOrgsBasicInfoPO) {
return this.custOrgMapper.listOrgBasicInfoByParams(queryOrgsBasicInfoPO);
}
// public List<CustOrg> listOrgByLevel(Integer orgLeave) {
// // return this.custOrgMapper.selectList((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getOrgLevel, orgLeave)).eq(CustOrg::getIfDel, DelFlagEnum.DEL_FALSE.key()));
// return this.custOrgMapper.selectList(Wrappers.lambdaQuery(CustOrg.class)
// .eq(CustOrg::getOrgLevel, orgLeave)
// .eq(CustOrg::getIfDel, DelFlagEnum.DEL_FALSE.key()));
// }
// public CustOrg getTempCustOrg() {
// return (CustOrg)this.custOrgMapper.selectOne((Wrapper)Wrappers.lambdaQuery(CustOrg.class).eq(CustOrg::getOrgNum, "letemporaryorg"));
// }
// public void updateSortByOrgId(Long orgId, Integer newSort) {
// // this.update((Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(CustOrg.class).set(CustOrg::getSort, newSort)).eq(CustOrg::getOrgId, orgId));
// this.update(Wrappers.lambdaUpdate(CustOrg.class).set(CustOrg::getSort, newSort).eq(CustOrg::getOrgId, orgId));
// }
}

View File

@ -4,10 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.canteen.core.drp.api.DrpAuthorityApi;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.dto.*;
import com.bonus.canteen.core.drp.service.DrpSupplierService;
import com.bonus.canteen.core.drp.vo.DrpMaterialSupplierVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierVO;
import com.bonus.common.core.web.domain.AjaxResult;
import com.github.pagehelper.page.PageMethod;
import io.swagger.annotations.Api;
@ -65,44 +66,34 @@ public class DrpSupplierController {
}
}
// @RequiresPermissions({"drp:supplier:update"})
// @PostMapping({"/edit"})
// @RequiresAuthentication
// @ApiOperation("修改供应商信息")
// public LeResponse<?> editDrpSupplier(@RequestBody @Valid LeRequest<DrpSupplierEditDTO> leRequest) {
// DrpSupplierEditDTO content = (DrpSupplierEditDTO)leRequest.getContent();
// this.drpSupplierService.editDrpSupplier(content);
// return LeResponse.succ();
// }
//
// @PostMapping({"/remove/{supplierId}"})
// @RequiresGuest
// @ApiOperation("删除供应商信息")
// @RequiresPermissions({"drp:supplier:delete"})
// public LeResponse<?> removeBySupplierId(@PathVariable Long supplierId) {
// this.drpSupplierService.removeBySupplierId(supplierId);
// return LeResponse.succ();
// }
//
// @RequiresPermissions({"drp:supplier:status"})
// @PostMapping({"/edit/status"})
// @RequiresAuthentication
// @ApiOperation("变更供应商状态")
// public LeResponse<?> editDrpSupplierStatus(@RequestBody @Valid LeRequest<DrpSupplierEditStatusDTO> leRequest) {
// DrpSupplierEditStatusDTO content = (DrpSupplierEditStatusDTO)leRequest.getContent();
// this.drpSupplierService.editDrpSupplierStatus(content);
// return LeResponse.succ();
// }
//
// @PostMapping({"/list/supplier"})
// @RequiresAuthentication
// @ApiOperation("查询供应商集合")
// public LeResponse<List<DrpSupplierVO>> listSupplier(@RequestBody LeRequest<DrpSupplierQueryDTO> leRequest) {
// DrpSupplierQueryDTO content = (DrpSupplierQueryDTO)leRequest.getContent();
// List<DrpSupplierVO> resultList = this.drpSupplierService.listSupplier(content);
// return LeResponse.succ(resultList);
// }
//
@PostMapping({"/edit"})
@ApiOperation("修改供应商信息")
public AjaxResult editDrpSupplier(@RequestBody @Valid DrpSupplierEditDTO dto) {
this.drpSupplierService.editDrpSupplier(dto);
return AjaxResult.success();
}
@PostMapping({"/remove/{supplierId}"})
@ApiOperation("删除供应商信息")
public AjaxResult removeBySupplierId(@PathVariable Long supplierId) {
this.drpSupplierService.removeBySupplierId(supplierId);
return AjaxResult.success();
}
@PostMapping({"/edit/status"})
@ApiOperation("变更供应商状态")
public AjaxResult editDrpSupplierStatus(@RequestBody @Valid DrpSupplierEditStatusDTO dto) {
this.drpSupplierService.editDrpSupplierStatus(dto);
return AjaxResult.success();
}
@PostMapping({"/list/supplier"})
@ApiOperation("查询供应商集合")
public AjaxResult listSupplier(@RequestBody DrpSupplierQueryDTO dto) {
List<DrpSupplierVO> resultList = this.drpSupplierService.listSupplier(dto);
return AjaxResult.success(resultList);
}
// @PostMapping({"/list/supplierByMaterialId"})
// @RequiresAuthentication
// @ApiOperation("根据原料或类别查询供应商集合")
@ -139,23 +130,26 @@ public class DrpSupplierController {
// Long supplierId = (Long)leRequest.getContent();
// return this.drpSupplierService.getMainInfoById(supplierId);
// }
//
// @PostMapping({"/getMaterialSupplierPage"})
// @RequiresAuthentication
// @ApiOperation("获取原料供应商分页")
// public PageVO<DrpMaterialSupplierVO> getMaterialSupplier(@RequestBody LeRequest<DrpMaterialInfoDTO> leRequest) {
// DrpMaterialInfoDTO content = (DrpMaterialInfoDTO)leRequest.getContent();
// content.setAreaIdList(this.drpAuthorityApi.authAreaList(content.getAreaIdList()));
// return PageVO.of(this.drpSupplierService.getMaterialSupplier(content));
// }
//
// @PostMapping({"/bidMaterialSupplier"})
// @RequiresAuthentication
// @ApiOperation("原料绑定供应商")
// public void bidMaterialSupplier(@RequestBody LeRequest<DrpBidMaterialSupplierDTO> leRequest) {
// this.drpSupplierService.bidMaterialSupplier((DrpBidMaterialSupplierDTO)leRequest.getContent());
// }
//
@PostMapping({"/getMaterialSupplierPage"})
@ApiOperation("获取原料供应商分页")
public Page<DrpMaterialSupplierVO> getMaterialSupplier(@RequestBody DrpMaterialInfoDTO dto) {
try {
dto.setAreaIdList(this.drpAuthorityApi.authAreaList(dto.getAreaIdList()));
Page<DrpMaterialSupplierVO> resultPage = (Page<DrpMaterialSupplierVO>)this.drpSupplierService.getMaterialSupplier(dto);
return resultPage;
} catch (Exception e) {
log.error(e.toString(), e);
return null;
}
}
@PostMapping({"/bidMaterialSupplier"})
@ApiOperation("原料绑定供应商")
public void bidMaterialSupplier(@RequestBody DrpBidMaterialSupplierDTO dto) {
this.drpSupplierService.bidMaterialSupplier(dto);
}
// @PostMapping({"/getMaterialSupplierByMaterialId"})
// @RequiresAuthentication
// @ApiOperation("采购订单获取原料供应商")

View File

@ -0,0 +1,92 @@
package com.bonus.canteen.core.drp.dto;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
public class DrpBidMaterialSupplierDTO {
@ApiModelProperty("食堂ID")
private Long canteenId;
@ApiModelProperty("货品ID")
private Long materialId;
@ApiModelProperty("类别ID")
private Long categoryId;
@ApiModelProperty("供应商id")
private Long supplierId;
@ApiModelProperty("备选供应商列表")
private String alternativeSupplier;
@ApiModelProperty("货品IDList")
private List<Long> materialIdList;
@ApiModelProperty("类别IDList")
private List<Long> categoryIdList;
@ApiModelProperty("是否供应 1是 2否")
private Integer ifSupply;
public Long getCanteenId() {
return this.canteenId;
}
public Long getMaterialId() {
return this.materialId;
}
public Long getCategoryId() {
return this.categoryId;
}
public Long getSupplierId() {
return this.supplierId;
}
public String getAlternativeSupplier() {
return this.alternativeSupplier;
}
public List<Long> getMaterialIdList() {
return this.materialIdList;
}
public List<Long> getCategoryIdList() {
return this.categoryIdList;
}
public Integer getIfSupply() {
return this.ifSupply;
}
public void setCanteenId(final Long canteenId) {
this.canteenId = canteenId;
}
public void setMaterialId(final Long materialId) {
this.materialId = materialId;
}
public void setCategoryId(final Long categoryId) {
this.categoryId = categoryId;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setAlternativeSupplier(final String alternativeSupplier) {
this.alternativeSupplier = alternativeSupplier;
}
public void setMaterialIdList(final List<Long> materialIdList) {
this.materialIdList = materialIdList;
}
public void setCategoryIdList(final List<Long> categoryIdList) {
this.categoryIdList = categoryIdList;
}
public void setIfSupply(final Integer ifSupply) {
this.ifSupply = ifSupply;
}
public String toString() {
Long var10000 = this.getCanteenId();
return "DrpBidMaterialSupplierDTO(canteenId=" + var10000 + ", materialId=" + this.getMaterialId() + ", categoryId=" + this.getCategoryId() + ", supplierId=" + this.getSupplierId() + ", alternativeSupplier=" + this.getAlternativeSupplier() + ", materialIdList=" + String.valueOf(this.getMaterialIdList()) + ", categoryIdList=" + String.valueOf(this.getCategoryIdList()) + ", ifSupply=" + this.getIfSupply() + ")";
}
}

View File

@ -0,0 +1,133 @@
package com.bonus.canteen.core.drp.dto;
import com.bonus.canteen.core.common.page.PageDTO;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
public class DrpMaterialInfoDTO extends PageDTO {
@ApiModelProperty("关键字")
private String key;
@ApiModelProperty("类别id集合")
private List<Long> categoryIdList;
@ApiModelProperty("仓库id")
private Long warehouseId;
private String metadataValue;
@ApiModelProperty("仓库类别")
private Integer warehouseType;
@ApiModelProperty("原料类型(1原料2商品)")
private Integer materialType;
@ApiModelProperty("区域id列表")
private List<Long> areaIdList;
@ApiModelProperty("区域ID")
private Long areaId;
@ApiModelProperty("食堂ID")
private Long canteenId;
@ApiModelProperty("配置类型(1按货品名称2按货品类别)")
private Integer configType;
@ApiModelProperty("食堂名称")
private String canteenName;
@ApiModelProperty("导出字段")
private List<String> exportCols;
public String getKey() {
return this.key;
}
public List<Long> getCategoryIdList() {
return this.categoryIdList;
}
public Long getWarehouseId() {
return this.warehouseId;
}
public String getMetadataValue() {
return this.metadataValue;
}
public Integer getWarehouseType() {
return this.warehouseType;
}
public Integer getMaterialType() {
return this.materialType;
}
public List<Long> getAreaIdList() {
return this.areaIdList;
}
public Long getAreaId() {
return this.areaId;
}
public Long getCanteenId() {
return this.canteenId;
}
public Integer getConfigType() {
return this.configType;
}
public String getCanteenName() {
return this.canteenName;
}
public List<String> getExportCols() {
return this.exportCols;
}
public void setKey(final String key) {
this.key = key;
}
public void setCategoryIdList(final List<Long> categoryIdList) {
this.categoryIdList = categoryIdList;
}
public void setWarehouseId(final Long warehouseId) {
this.warehouseId = warehouseId;
}
public void setMetadataValue(final String metadataValue) {
this.metadataValue = metadataValue;
}
public void setWarehouseType(final Integer warehouseType) {
this.warehouseType = warehouseType;
}
public void setMaterialType(final Integer materialType) {
this.materialType = materialType;
}
public void setAreaIdList(final List<Long> areaIdList) {
this.areaIdList = areaIdList;
}
public void setAreaId(final Long areaId) {
this.areaId = areaId;
}
public void setCanteenId(final Long canteenId) {
this.canteenId = canteenId;
}
public void setConfigType(final Integer configType) {
this.configType = configType;
}
public void setCanteenName(final String canteenName) {
this.canteenName = canteenName;
}
public void setExportCols(final List<String> exportCols) {
this.exportCols = exportCols;
}
public String toString() {
String var10000 = this.getKey();
return "DrpMaterialInfoDTO(key=" + var10000 + ", categoryIdList=" + String.valueOf(this.getCategoryIdList()) + ", warehouseId=" + this.getWarehouseId() + ", metadataValue=" + this.getMetadataValue() + ", warehouseType=" + this.getWarehouseType() + ", materialType=" + this.getMaterialType() + ", areaIdList=" + String.valueOf(this.getAreaIdList()) + ", areaId=" + this.getAreaId() + ", canteenId=" + this.getCanteenId() + ", configType=" + this.getConfigType() + ", canteenName=" + this.getCanteenName() + ", exportCols=" + String.valueOf(this.getExportCols()) + ")";
}
}

View File

@ -0,0 +1,479 @@
package com.bonus.canteen.core.drp.dto;
import com.bonus.canteen.core.common.utils.SysUtil;
import com.bonus.canteen.core.drp.vo.DrpContractAttachmentDTO;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
public class DrpSupplierEditDTO {
@ApiModelProperty("供应商id")
private @NotNull(
message = "供应商id不能为空 ^_^"
) Long supplierId;
@ApiModelProperty("区域Id")
private @NotNull(
message = "区域Id不能为空!"
) Long areaId;
@ApiModelProperty("供应商名称")
private @NotBlank(
message = "供应商名称不能为空!"
) String supplierName;
@ApiModelProperty("详细地址")
private String address;
@ApiModelProperty("主要联系人")
private String linkman;
@ApiModelProperty("主要联系人电话")
private String linkmanNumber;
@ApiModelProperty("主要邮箱")
private String email;
@ApiModelProperty("主要微信号")
private String wechat;
@ApiModelProperty("开户行")
private String openingBank;
@ApiModelProperty("银行账号")
private String bankAccount;
@ApiModelProperty("供应商简称")
private String supplierSimpleName;
@ApiModelProperty("供应商电话")
private String telephone;
@ApiModelProperty("公司网站")
private String companyWeb;
@ApiModelProperty("区域-省")
private String regionProvince;
@ApiModelProperty("区域-市")
private String regionCity;
@ApiModelProperty("区域-区")
private String regionDistrict;
@ApiModelProperty("税率(1=3,2=6,3=13)%")
private Integer taxRate;
@ApiModelProperty("账期1日2周3月4两个月5季度6半年7年")
private Integer paymentDays;
@ApiModelProperty("备用联系人")
private String standbyLinkman;
@ApiModelProperty("备用手机号")
private String standbyPhone;
@ApiModelProperty("备用微信")
private String standbyWechat;
@ApiModelProperty("备用邮箱")
private String standbyEmail;
@ApiModelProperty("供应类目")
private List<Long> categoryIdList;
@ApiModelProperty("注册资金(万元)")
private BigDecimal registFund;
@ApiModelProperty("成立时间")
private LocalDate establishDate;
@ApiModelProperty("职工人数")
private Integer workersNum;
@ApiModelProperty("目前服务的客户数量")
private Integer clientNum;
@ApiModelProperty("去年营业收入(万元)")
private BigDecimal lastYearOperatingIncome;
@ApiModelProperty("前年营业收入(万元)")
private BigDecimal beforeYearOperatingIncome;
@ApiModelProperty("经营范围(工商信息)")
private String businessScope;
@ApiModelProperty("前五大客户")
private String topFiveClient;
@ApiModelProperty("前五大供应商")
private String topFiveSupplier;
@ApiModelProperty("公司简介")
private String companyIntroduction;
@ApiModelProperty("主要优势")
private String mainAdvantage;
@ApiModelProperty("是否接收通知(1是2否)")
private Integer ifReceiveNotice;
@ApiModelProperty("流程通知方式(1不通知2短信3公众号)")
private Integer noticeStyle;
@ApiModelProperty("供应商用户id")
private Long supplierUserId;
@ApiModelProperty("供应商状态(1-待审核,2-审核通过,3-禁用)")
private Integer status;
@ApiModelProperty("资质集合")
@Size(
min = 1,
message = "主要资质不能为空"
) List<DrpSupplierQualificationUpdateDTO> mainQualificationList;
@ApiModelProperty("送货人集合")
private List<DrpSupplierDeliverAddDTO> deliverVOList;
@ApiModelProperty("资质集合")
List<DrpSupplierQualificationSaveDTO> otherQualificationList;
@ApiModelProperty("身份证正")
private String idCardImgZ;
@ApiModelProperty("身份证反")
private String idCardImgF;
@ApiModelProperty("附件")
private List<DrpContractAttachmentDTO> attachmentList;
@ApiModelProperty("备注")
private String remark;
public void setIdCardImgZ(String idCardImgZ) {
this.idCardImgZ = SysUtil.getCutPath(idCardImgZ);
}
public void setIdCardImgF(String idCardImgF) {
this.idCardImgF = SysUtil.getCutPath(idCardImgF);
}
public Long getSupplierId() {
return this.supplierId;
}
public Long getAreaId() {
return this.areaId;
}
public String getSupplierName() {
return this.supplierName;
}
public String getAddress() {
return this.address;
}
public String getLinkman() {
return this.linkman;
}
public String getLinkmanNumber() {
return this.linkmanNumber;
}
public String getEmail() {
return this.email;
}
public String getWechat() {
return this.wechat;
}
public String getOpeningBank() {
return this.openingBank;
}
public String getBankAccount() {
return this.bankAccount;
}
public String getSupplierSimpleName() {
return this.supplierSimpleName;
}
public String getTelephone() {
return this.telephone;
}
public String getCompanyWeb() {
return this.companyWeb;
}
public String getRegionProvince() {
return this.regionProvince;
}
public String getRegionCity() {
return this.regionCity;
}
public String getRegionDistrict() {
return this.regionDistrict;
}
public Integer getTaxRate() {
return this.taxRate;
}
public Integer getPaymentDays() {
return this.paymentDays;
}
public String getStandbyLinkman() {
return this.standbyLinkman;
}
public String getStandbyPhone() {
return this.standbyPhone;
}
public String getStandbyWechat() {
return this.standbyWechat;
}
public String getStandbyEmail() {
return this.standbyEmail;
}
public List<Long> getCategoryIdList() {
return this.categoryIdList;
}
public BigDecimal getRegistFund() {
return this.registFund;
}
public LocalDate getEstablishDate() {
return this.establishDate;
}
public Integer getWorkersNum() {
return this.workersNum;
}
public Integer getClientNum() {
return this.clientNum;
}
public BigDecimal getLastYearOperatingIncome() {
return this.lastYearOperatingIncome;
}
public BigDecimal getBeforeYearOperatingIncome() {
return this.beforeYearOperatingIncome;
}
public String getBusinessScope() {
return this.businessScope;
}
public String getTopFiveClient() {
return this.topFiveClient;
}
public String getTopFiveSupplier() {
return this.topFiveSupplier;
}
public String getCompanyIntroduction() {
return this.companyIntroduction;
}
public String getMainAdvantage() {
return this.mainAdvantage;
}
public Integer getIfReceiveNotice() {
return this.ifReceiveNotice;
}
public Integer getNoticeStyle() {
return this.noticeStyle;
}
public Long getSupplierUserId() {
return this.supplierUserId;
}
public Integer getStatus() {
return this.status;
}
public List<DrpSupplierQualificationUpdateDTO> getMainQualificationList() {
return this.mainQualificationList;
}
public List<DrpSupplierDeliverAddDTO> getDeliverVOList() {
return this.deliverVOList;
}
public List<DrpSupplierQualificationSaveDTO> getOtherQualificationList() {
return this.otherQualificationList;
}
public String getIdCardImgZ() {
return this.idCardImgZ;
}
public String getIdCardImgF() {
return this.idCardImgF;
}
public List<DrpContractAttachmentDTO> getAttachmentList() {
return this.attachmentList;
}
public String getRemark() {
return this.remark;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setAreaId(final Long areaId) {
this.areaId = areaId;
}
public void setSupplierName(final String supplierName) {
this.supplierName = supplierName;
}
public void setAddress(final String address) {
this.address = address;
}
public void setLinkman(final String linkman) {
this.linkman = linkman;
}
public void setLinkmanNumber(final String linkmanNumber) {
this.linkmanNumber = linkmanNumber;
}
public void setEmail(final String email) {
this.email = email;
}
public void setWechat(final String wechat) {
this.wechat = wechat;
}
public void setOpeningBank(final String openingBank) {
this.openingBank = openingBank;
}
public void setBankAccount(final String bankAccount) {
this.bankAccount = bankAccount;
}
public void setSupplierSimpleName(final String supplierSimpleName) {
this.supplierSimpleName = supplierSimpleName;
}
public void setTelephone(final String telephone) {
this.telephone = telephone;
}
public void setCompanyWeb(final String companyWeb) {
this.companyWeb = companyWeb;
}
public void setRegionProvince(final String regionProvince) {
this.regionProvince = regionProvince;
}
public void setRegionCity(final String regionCity) {
this.regionCity = regionCity;
}
public void setRegionDistrict(final String regionDistrict) {
this.regionDistrict = regionDistrict;
}
public void setTaxRate(final Integer taxRate) {
this.taxRate = taxRate;
}
public void setPaymentDays(final Integer paymentDays) {
this.paymentDays = paymentDays;
}
public void setStandbyLinkman(final String standbyLinkman) {
this.standbyLinkman = standbyLinkman;
}
public void setStandbyPhone(final String standbyPhone) {
this.standbyPhone = standbyPhone;
}
public void setStandbyWechat(final String standbyWechat) {
this.standbyWechat = standbyWechat;
}
public void setStandbyEmail(final String standbyEmail) {
this.standbyEmail = standbyEmail;
}
public void setCategoryIdList(final List<Long> categoryIdList) {
this.categoryIdList = categoryIdList;
}
public void setRegistFund(final BigDecimal registFund) {
this.registFund = registFund;
}
public void setEstablishDate(final LocalDate establishDate) {
this.establishDate = establishDate;
}
public void setWorkersNum(final Integer workersNum) {
this.workersNum = workersNum;
}
public void setClientNum(final Integer clientNum) {
this.clientNum = clientNum;
}
public void setLastYearOperatingIncome(final BigDecimal lastYearOperatingIncome) {
this.lastYearOperatingIncome = lastYearOperatingIncome;
}
public void setBeforeYearOperatingIncome(final BigDecimal beforeYearOperatingIncome) {
this.beforeYearOperatingIncome = beforeYearOperatingIncome;
}
public void setBusinessScope(final String businessScope) {
this.businessScope = businessScope;
}
public void setTopFiveClient(final String topFiveClient) {
this.topFiveClient = topFiveClient;
}
public void setTopFiveSupplier(final String topFiveSupplier) {
this.topFiveSupplier = topFiveSupplier;
}
public void setCompanyIntroduction(final String companyIntroduction) {
this.companyIntroduction = companyIntroduction;
}
public void setMainAdvantage(final String mainAdvantage) {
this.mainAdvantage = mainAdvantage;
}
public void setIfReceiveNotice(final Integer ifReceiveNotice) {
this.ifReceiveNotice = ifReceiveNotice;
}
public void setNoticeStyle(final Integer noticeStyle) {
this.noticeStyle = noticeStyle;
}
public void setSupplierUserId(final Long supplierUserId) {
this.supplierUserId = supplierUserId;
}
public void setStatus(final Integer status) {
this.status = status;
}
public void setMainQualificationList(final List<DrpSupplierQualificationUpdateDTO> mainQualificationList) {
this.mainQualificationList = mainQualificationList;
}
public void setDeliverVOList(final List<DrpSupplierDeliverAddDTO> deliverVOList) {
this.deliverVOList = deliverVOList;
}
public void setOtherQualificationList(final List<DrpSupplierQualificationSaveDTO> otherQualificationList) {
this.otherQualificationList = otherQualificationList;
}
public void setAttachmentList(final List<DrpContractAttachmentDTO> attachmentList) {
this.attachmentList = attachmentList;
}
public void setRemark(final String remark) {
this.remark = remark;
}
public String toString() {
Long var10000 = this.getSupplierId();
return "DrpSupplierEditDTO(supplierId=" + var10000 + ", areaId=" + this.getAreaId() + ", supplierName=" + this.getSupplierName() + ", address=" + this.getAddress() + ", linkman=" + this.getLinkman() + ", linkmanNumber=" + this.getLinkmanNumber() + ", email=" + this.getEmail() + ", wechat=" + this.getWechat() + ", openingBank=" + this.getOpeningBank() + ", bankAccount=" + this.getBankAccount() + ", supplierSimpleName=" + this.getSupplierSimpleName() + ", telephone=" + this.getTelephone() + ", companyWeb=" + this.getCompanyWeb() + ", regionProvince=" + this.getRegionProvince() + ", regionCity=" + this.getRegionCity() + ", regionDistrict=" + this.getRegionDistrict() + ", taxRate=" + this.getTaxRate() + ", paymentDays=" + this.getPaymentDays() + ", standbyLinkman=" + this.getStandbyLinkman() + ", standbyPhone=" + this.getStandbyPhone() + ", standbyWechat=" + this.getStandbyWechat() + ", standbyEmail=" + this.getStandbyEmail() + ", categoryIdList=" + String.valueOf(this.getCategoryIdList()) + ", registFund=" + String.valueOf(this.getRegistFund()) + ", establishDate=" + String.valueOf(this.getEstablishDate()) + ", workersNum=" + this.getWorkersNum() + ", clientNum=" + this.getClientNum() + ", lastYearOperatingIncome=" + String.valueOf(this.getLastYearOperatingIncome()) + ", beforeYearOperatingIncome=" + String.valueOf(this.getBeforeYearOperatingIncome()) + ", businessScope=" + this.getBusinessScope() + ", topFiveClient=" + this.getTopFiveClient() + ", topFiveSupplier=" + this.getTopFiveSupplier() + ", companyIntroduction=" + this.getCompanyIntroduction() + ", mainAdvantage=" + this.getMainAdvantage() + ", ifReceiveNotice=" + this.getIfReceiveNotice() + ", noticeStyle=" + this.getNoticeStyle() + ", supplierUserId=" + this.getSupplierUserId() + ", status=" + this.getStatus() + ", mainQualificationList=" + String.valueOf(this.getMainQualificationList()) + ", deliverVOList=" + String.valueOf(this.getDeliverVOList()) + ", otherQualificationList=" + String.valueOf(this.getOtherQualificationList()) + ", idCardImgZ=" + this.getIdCardImgZ() + ", idCardImgF=" + this.getIdCardImgF() + ", attachmentList=" + String.valueOf(this.getAttachmentList()) + ", remark=" + this.getRemark() + ")";
}
}

View File

@ -0,0 +1,36 @@
package com.bonus.canteen.core.drp.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
public class DrpSupplierEditStatusDTO {
@ApiModelProperty("供应商id")
private @NotNull(
message = "供应商id不能为空 ^_^"
) Long supplierId;
@ApiModelProperty("供应商状态(1-待审核,2-审核通过,3-禁用)")
private @NotNull(
message = "供应商状态不能为空 ^_^"
) Integer status;
public Long getSupplierId() {
return this.supplierId;
}
public Integer getStatus() {
return this.status;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setStatus(final Integer status) {
this.status = status;
}
public String toString() {
Long var10000 = this.getSupplierId();
return "DrpSupplierEditStatusDTO(supplierId=" + var10000 + ", status=" + this.getStatus() + ")";
}
}

View File

@ -0,0 +1,84 @@
package com.bonus.canteen.core.drp.dto;
import com.bonus.canteen.core.common.utils.SysUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
@ApiModel
public class DrpSupplierQualificationUpdateDTO {
@ApiModelProperty("id")
private @NotNull(
message = "id不能为空!"
) Long id;
@ApiModelProperty("资质编号")
private String qualificationNum;
@ApiModelProperty("资质名称")
private @NotBlank(
message = "资质名称不能为空!"
) String qualificationName;
@ApiModelProperty("有效期")
private LocalDate validity;
@ApiModelProperty("资质照片")
private String imgUrl;
@ApiModelProperty("供应商id")
private @NotNull(
message = "供应商id不能为空 ^_^"
) Long supplierId;
public void setImgUrl(String imgUrl) {
this.imgUrl = SysUtil.getCutPath(imgUrl);
}
public Long getId() {
return this.id;
}
public String getQualificationNum() {
return this.qualificationNum;
}
public String getQualificationName() {
return this.qualificationName;
}
public LocalDate getValidity() {
return this.validity;
}
public String getImgUrl() {
return this.imgUrl;
}
public Long getSupplierId() {
return this.supplierId;
}
public void setId(final Long id) {
this.id = id;
}
public void setQualificationNum(final String qualificationNum) {
this.qualificationNum = qualificationNum;
}
public void setQualificationName(final String qualificationName) {
this.qualificationName = qualificationName;
}
public void setValidity(final LocalDate validity) {
this.validity = validity;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public String toString() {
Long var10000 = this.getId();
return "DrpSupplierQualificationUpdateDTO(id=" + var10000 + ", qualificationNum=" + this.getQualificationNum() + ", qualificationName=" + this.getQualificationName() + ", validity=" + String.valueOf(this.getValidity()) + ", imgUrl=" + this.getImgUrl() + ", supplierId=" + this.getSupplierId() + ")";
}
}

View File

@ -0,0 +1,43 @@
package com.bonus.canteen.core.drp.dto;
import com.bonus.canteen.core.common.page.PageDTO;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
public class DrpSupplierQueryDTO extends PageDTO {
@ApiModelProperty("供应商Id")
private List<Long> supplierIdList;
@ApiModelProperty("供应商名称")
private String supplierName;
@ApiModelProperty("区域id列表")
private List<Long> areaIdList;
public List<Long> getSupplierIdList() {
return this.supplierIdList;
}
public String getSupplierName() {
return this.supplierName;
}
public List<Long> getAreaIdList() {
return this.areaIdList;
}
public void setSupplierIdList(final List<Long> supplierIdList) {
this.supplierIdList = supplierIdList;
}
public void setSupplierName(final String supplierName) {
this.supplierName = supplierName;
}
public void setAreaIdList(final List<Long> areaIdList) {
this.areaIdList = areaIdList;
}
public String toString() {
String var10000 = String.valueOf(this.getSupplierIdList());
return "DrpSupplierQueryDTO(supplierIdList=" + var10000 + ", supplierName=" + this.getSupplierName() + ", areaIdList=" + String.valueOf(this.getAreaIdList()) + ")";
}
}

View File

@ -0,0 +1,33 @@
package com.bonus.canteen.core.drp.dto;
import io.swagger.annotations.ApiModelProperty;
public class MaterialAndUnitDTO {
@ApiModelProperty("货品id")
private Long materialId;
@ApiModelProperty("单位id")
private Long unitId;
public Long getMaterialId() {
return this.materialId;
}
public Long getUnitId() {
return this.unitId;
}
public MaterialAndUnitDTO setMaterialId(final Long materialId) {
this.materialId = materialId;
return this;
}
public MaterialAndUnitDTO setUnitId(final Long unitId) {
this.unitId = unitId;
return this;
}
public String toString() {
Long var10000 = this.getMaterialId();
return "MaterialAndUnitDTO(materialId=" + var10000 + ", unitId=" + this.getUnitId() + ")";
}
}

View File

@ -0,0 +1,37 @@
package com.bonus.canteen.core.drp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.drp.dto.DrpMaterialInfoDTO;
import com.bonus.canteen.core.drp.dto.MaterialAndUnitDTO;
import com.bonus.canteen.core.drp.model.DrpMaterialWinBidRecords;
import com.bonus.canteen.core.drp.vo.DrpLastOrderGoodsVO;
import com.bonus.canteen.core.drp.vo.DrpMaterialBidRecordsSupplierVO;
import com.bonus.canteen.core.drp.vo.DrpMaterialSupplierVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DrpMaterialWinBidRecordsMapper extends BaseMapper<DrpMaterialWinBidRecords> {
// List<DrpMaterialBidRecordsPageVO> listMaterialUnit(@Param("content") DrpMaterialBidRecordsPageDTO content);
//
// List<DrpMaterialSupplierWinRecordsVO> listSupplierWinRecords(@Param("supplierId") Long supplierId, @Param("materialIdList") List<Long> materialIdList, @Param("materialInquiryId") String materialInquiryId);
//
// List<DrpMaterialSupplierWinRecordsVO> listSupplierWinRecordsBySupplier(@Param("supplierId") Long supplierId, @Param("materialIdList") List<Long> materialIdList);
//
// List<DrpMaterialBidRecordsSupplierVO> listSupplierPriceByMaterialId(@Param("materialId") Long materialId);
//
// List<DrpMaterialBidRecordsSupplierVO> listSupplierPriceByMaterialIdLast(@Param("materialId") Long materialId);
List<DrpMaterialBidRecordsSupplierVO> listSupplierPriceByMaterialIdList(@Param("materialIdList") List<Long> materialIdList);
// DrpLastOrderGoodsVO getLastOrderGoodsPrice(@Param("materialId") Long materialId, @Param("unitId") Long unitId);
//
// List<DrpMarketPriceVO> getMarketPrice(@Param("materialId") Long materialId, @Param("unitId") Long unitId);
//
// List<DrpMarketPriceVO> getMarketPriceList(@Param("materialAndUnitDTOS") List<MaterialAndUnitDTO> materialAndUnitDTOS, @Param("areaId") Long areaId);
List<DrpMaterialSupplierVO> getMaterialSupplier(@Param("content") DrpMaterialInfoDTO content);
List<DrpLastOrderGoodsVO> getLastOrderGoodsPriceList(@Param("materialAndUnitDTOS") List<MaterialAndUnitDTO> materialAndUnitDTOS, @Param("areaId") Long areaId);
}

View File

@ -0,0 +1,23 @@
package com.bonus.canteen.core.drp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.drp.model.DrpMenuMaterialSupplier;
import com.bonus.canteen.core.drp.vo.DrpMaterialSupplierVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashSet;
import java.util.List;
@Mapper
public interface DrpMenuMaterialSupplierMapper extends BaseMapper<DrpMenuMaterialSupplier> {
// List<DrpMenuMaterialSupplierDetailVO> detail(@Param("materialId") Long materialId);
//
// List<DrpMenuMaterialSupplierCanteenVO> getSupplierByMaterialIdAndCanteenId(@Param("content") DrpMenuMaterialSupplierQueryDTO content);
//
// List<DrpMaterialSupplierVO> getMaterialSupplierByMaterialId(@Param("materialIdList") List<Long> materialIdList);
//
// HashSet<DrpSupplierSimpleVo> getMaterialSupplierCert(@Param("certId") Long certId, @Param("supplierIdList") List<Long> supplierIdList);
//
// List<DrpSupplierMaterialCertVO> checkSupplierMaterialCert(@Param("content") DrpSupplierMaterialCertDTO content);
}

View File

@ -2,8 +2,11 @@ package com.bonus.canteen.core.drp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.canteen.core.drp.dto.DrpMaterialInfoDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierQueryDTO;
import com.bonus.canteen.core.drp.model.DrpSupplier;
import com.bonus.canteen.core.drp.vo.DrpMaterialSupplierVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierVO;
import org.apache.ibatis.annotations.Mapper;
@ -22,8 +25,8 @@ public interface DrpSupplierMapper extends BaseMapper<DrpSupplier> {
@Select({"select a.supplier_id,a.supplier_name from drp_supplier a where a.supplier_user_id = #{userId}"})
DrpSupplierVO listSupplierByUserId(@Param("userId") Long userId);
// List<DrpSupplierVO> listSupplier(@Param("status") Integer status, @Param("delFlag") Integer delFlag, @Param("content") DrpSupplierQueryDTO content);
//
List<DrpSupplierVO> listSupplier(@Param("status") Integer status, @Param("delFlag") Integer delFlag, @Param("content") DrpSupplierQueryDTO content);
// List<DrpCompariseSupplierQualificationPageVO> pageCompariseSupplierQualification(@Param("content") DrpCompariseSupplierQualificationPageDTO content, @Param("delFlag") Integer delFlag);
//
// List<DrpSupplyStatisticsPageVO> supplyStatistics(@Param("content") DrpSupplyStatisticsPageDTO content, @Param("delFlag") Integer delFlag);
@ -40,6 +43,6 @@ public interface DrpSupplierMapper extends BaseMapper<DrpSupplier> {
// DrpSupplierTotalVO queryTotal();
//
// List<DrpSupplierVO> listSupplierNew(@Param("content") DrpSupplierQueryDTO content, @Param("status") Integer status, @Param("delFlag") Integer delFlag);
//
// List<DrpMaterialSupplierVO> getCategorySupplier(@Param("content") DrpMaterialInfoDTO content);
List<DrpMaterialSupplierVO> getCategorySupplier(@Param("content") DrpMaterialInfoDTO content);
}

View File

@ -0,0 +1,178 @@
package com.bonus.canteen.core.drp.model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
@ApiModel(
value = "DrpMaterialWinBidRecords对象",
description = "原料中标记录表"
)
public class DrpMaterialWinBidRecords {
@ApiModelProperty("记录ID")
private Long recordId;
@ApiModelProperty("原料id")
private Long materialId;
@ApiModelProperty("中标价")
private Integer winPrice;
@ApiModelProperty("中标日期")
private LocalDateTime winDate;
@ApiModelProperty("中标供应商")
private Long winSupplierId;
@TableField(
value = "crby",
fill = FieldFill.INSERT
)
@ApiModelProperty("创建人")
private String crby;
@TableField(
value = "crtime",
fill = FieldFill.INSERT
)
@ApiModelProperty("创建时间")
private LocalDateTime crtime;
@TableField(
value = "upby",
fill = FieldFill.UPDATE
)
@ApiModelProperty("更新人")
private String upby;
@TableField(
value = "uptime",
fill = FieldFill.UPDATE
)
@ApiModelProperty("更新时间")
private LocalDateTime uptime;
@ApiModelProperty("农贸市场价格")
private Long farmersMarketPrice;
@ApiModelProperty("中标价格有效期开始")
private LocalDateTime bidValidityStartTime;
@ApiModelProperty("中标价格有效期结束")
private LocalDateTime bidValidityEndTime;
@ApiModelProperty("货品招标单号")
private String materialInquiryId;
public Long getRecordId() {
return this.recordId;
}
public Long getMaterialId() {
return this.materialId;
}
public Integer getWinPrice() {
return this.winPrice;
}
public LocalDateTime getWinDate() {
return this.winDate;
}
public Long getWinSupplierId() {
return this.winSupplierId;
}
public String getCrby() {
return this.crby;
}
public LocalDateTime getCrtime() {
return this.crtime;
}
public String getUpby() {
return this.upby;
}
public LocalDateTime getUptime() {
return this.uptime;
}
public Long getFarmersMarketPrice() {
return this.farmersMarketPrice;
}
public LocalDateTime getBidValidityStartTime() {
return this.bidValidityStartTime;
}
public LocalDateTime getBidValidityEndTime() {
return this.bidValidityEndTime;
}
public String getMaterialInquiryId() {
return this.materialInquiryId;
}
public DrpMaterialWinBidRecords setRecordId(final Long recordId) {
this.recordId = recordId;
return this;
}
public DrpMaterialWinBidRecords setMaterialId(final Long materialId) {
this.materialId = materialId;
return this;
}
public DrpMaterialWinBidRecords setWinPrice(final Integer winPrice) {
this.winPrice = winPrice;
return this;
}
public DrpMaterialWinBidRecords setWinDate(final LocalDateTime winDate) {
this.winDate = winDate;
return this;
}
public DrpMaterialWinBidRecords setWinSupplierId(final Long winSupplierId) {
this.winSupplierId = winSupplierId;
return this;
}
public DrpMaterialWinBidRecords setCrby(final String crby) {
this.crby = crby;
return this;
}
public DrpMaterialWinBidRecords setCrtime(final LocalDateTime crtime) {
this.crtime = crtime;
return this;
}
public DrpMaterialWinBidRecords setUpby(final String upby) {
this.upby = upby;
return this;
}
public DrpMaterialWinBidRecords setUptime(final LocalDateTime uptime) {
this.uptime = uptime;
return this;
}
public DrpMaterialWinBidRecords setFarmersMarketPrice(final Long farmersMarketPrice) {
this.farmersMarketPrice = farmersMarketPrice;
return this;
}
public DrpMaterialWinBidRecords setBidValidityStartTime(final LocalDateTime bidValidityStartTime) {
this.bidValidityStartTime = bidValidityStartTime;
return this;
}
public DrpMaterialWinBidRecords setBidValidityEndTime(final LocalDateTime bidValidityEndTime) {
this.bidValidityEndTime = bidValidityEndTime;
return this;
}
public DrpMaterialWinBidRecords setMaterialInquiryId(final String materialInquiryId) {
this.materialInquiryId = materialInquiryId;
return this;
}
public String toString() {
Long var10000 = this.getRecordId();
return "DrpMaterialWinBidRecords(recordId=" + var10000 + ", materialId=" + this.getMaterialId() + ", winPrice=" + this.getWinPrice() + ", winDate=" + String.valueOf(this.getWinDate()) + ", winSupplierId=" + this.getWinSupplierId() + ", crby=" + this.getCrby() + ", crtime=" + String.valueOf(this.getCrtime()) + ", upby=" + this.getUpby() + ", uptime=" + String.valueOf(this.getUptime()) + ", farmersMarketPrice=" + this.getFarmersMarketPrice() + ", bidValidityStartTime=" + String.valueOf(this.getBidValidityStartTime()) + ", bidValidityEndTime=" + String.valueOf(this.getBidValidityEndTime()) + ", materialInquiryId=" + this.getMaterialInquiryId() + ")";
}
}

View File

@ -0,0 +1,154 @@
package com.bonus.canteen.core.drp.model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
@TableName("drp_menu_material_supplier")
@ApiModel(
description = "原料绑定食堂供应商"
)
public class DrpMenuMaterialSupplier implements Serializable {
private static final long serialVersionUID = 241673783169229609L;
@TableId
private Long id;
private Long canteenId;
private Long supplierId;
private Long materialId;
private Long categoryId;
private Integer delFlag;
@TableField(
value = "crby",
fill = FieldFill.INSERT
)
@ApiModelProperty("创建人")
private String crby;
@TableField(
value = "crtime",
fill = FieldFill.INSERT
)
@ApiModelProperty("创建时间")
private LocalDateTime crtime;
@TableField(
value = "upby",
fill = FieldFill.UPDATE
)
@ApiModelProperty("更新人")
private String upby;
@TableField(
value = "uptime",
fill = FieldFill.UPDATE
)
@ApiModelProperty("更新时间")
private LocalDateTime uptime;
private String alternativeSupplier;
@ApiModelProperty("是否供应 1是 2否")
private Integer ifSupply;
public Long getId() {
return this.id;
}
public Long getCanteenId() {
return this.canteenId;
}
public Long getSupplierId() {
return this.supplierId;
}
public Long getMaterialId() {
return this.materialId;
}
public Long getCategoryId() {
return this.categoryId;
}
public Integer getDelFlag() {
return this.delFlag;
}
public String getCrby() {
return this.crby;
}
public LocalDateTime getCrtime() {
return this.crtime;
}
public String getUpby() {
return this.upby;
}
public LocalDateTime getUptime() {
return this.uptime;
}
public String getAlternativeSupplier() {
return this.alternativeSupplier;
}
public Integer getIfSupply() {
return this.ifSupply;
}
public void setId(final Long id) {
this.id = id;
}
public void setCanteenId(final Long canteenId) {
this.canteenId = canteenId;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setMaterialId(final Long materialId) {
this.materialId = materialId;
}
public void setCategoryId(final Long categoryId) {
this.categoryId = categoryId;
}
public void setDelFlag(final Integer delFlag) {
this.delFlag = delFlag;
}
public void setCrby(final String crby) {
this.crby = crby;
}
public void setCrtime(final LocalDateTime crtime) {
this.crtime = crtime;
}
public void setUpby(final String upby) {
this.upby = upby;
}
public void setUptime(final LocalDateTime uptime) {
this.uptime = uptime;
}
public void setAlternativeSupplier(final String alternativeSupplier) {
this.alternativeSupplier = alternativeSupplier;
}
public void setIfSupply(final Integer ifSupply) {
this.ifSupply = ifSupply;
}
public String toString() {
Long var10000 = this.getId();
return "DrpMenuMaterialSupplier(id=" + var10000 + ", canteenId=" + this.getCanteenId() + ", supplierId=" + this.getSupplierId() + ", materialId=" + this.getMaterialId() + ", categoryId=" + this.getCategoryId() + ", delFlag=" + this.getDelFlag() + ", crby=" + this.getCrby() + ", crtime=" + String.valueOf(this.getCrtime()) + ", upby=" + this.getUpby() + ", uptime=" + String.valueOf(this.getUptime()) + ", alternativeSupplier=" + this.getAlternativeSupplier() + ", ifSupply=" + this.getIfSupply() + ")";
}
}

View File

@ -0,0 +1,34 @@
package com.bonus.canteen.core.drp.po;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
public class DrpSupplierModel implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("供应商id")
private Long supplierId;
@ApiModelProperty("供应商")
private String supplierName;
public Long getSupplierId() {
return this.supplierId;
}
public String getSupplierName() {
return this.supplierName;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setSupplierName(final String supplierName) {
this.supplierName = supplierName;
}
public String toString() {
Long var10000 = this.getSupplierId();
return "DrpSupplierModel(supplierId=" + var10000 + ", supplierName=" + this.getSupplierName() + ")";
}
}

View File

@ -2,10 +2,11 @@ package com.bonus.canteen.core.drp.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.dto.*;
import com.bonus.canteen.core.drp.model.DrpSupplier;
import com.bonus.canteen.core.drp.vo.DrpMaterialSupplierVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierVO;
import java.util.List;
import java.util.Map;
@ -15,14 +16,14 @@ public interface DrpSupplierService extends IService<DrpSupplier> {
Page<DrpSupplierPageVO> getDrpSupplierPage(DrpSupplierPageDTO content);
// void editDrpSupplier(DrpSupplierEditDTO content);
//
// void removeBySupplierId(Long supplierId);
//
// void editDrpSupplierStatus(DrpSupplierEditStatusDTO content);
//
// List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content);
//
void editDrpSupplier(DrpSupplierEditDTO content);
void removeBySupplierId(Long supplierId);
void editDrpSupplierStatus(DrpSupplierEditStatusDTO content);
List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content);
// List<DrpCompariseSupplierQualificationPageVO> compariseSupplierQualification(DrpCompariseSupplierQualificationPageDTO content);
//
// List<DrpSupplyStatisticsPageVO> supplyStatistics(DrpSupplyStatisticsPageDTO content);
@ -32,11 +33,11 @@ public interface DrpSupplierService extends IService<DrpSupplier> {
// Map<Long, List<DrpSupplierVO>> supplierByMaterialId(DrpSupplierDTO content);
//
// DrpSupplierTotalVO getTotal();
//
// List<DrpMaterialSupplierVO> getMaterialSupplier(DrpMaterialInfoDTO content);
//
// void bidMaterialSupplier(DrpBidMaterialSupplierDTO content);
//
List<DrpMaterialSupplierVO> getMaterialSupplier(DrpMaterialInfoDTO content);
void bidMaterialSupplier(DrpBidMaterialSupplierDTO content);
// List<DrpMaterialSupplierVO> getMaterialSupplierByMaterialId(List<Long> content);
//
// List<DrpSupplierVO> listSupplierNew(DrpSupplierQueryDTO content);

View File

@ -13,33 +13,26 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.canteen.core.drp.api.DrpAuthorityApi;
import com.bonus.canteen.core.drp.constant.DrpBusinessConstants;
import com.bonus.canteen.core.drp.constant.DrpQuantityMainFlagEnum;
import com.bonus.canteen.core.drp.constant.DrpSupplierStatusEnum;
import com.bonus.canteen.core.drp.dto.DrpSupplierAddDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierPageDTO;
import com.bonus.canteen.core.drp.dto.DrpSupplierQualificationSaveDTO;
import com.bonus.canteen.core.drp.mapper.DrpSupplierCategoryMapper;
import com.bonus.canteen.core.drp.mapper.DrpSupplierDeliverMapper;
import com.bonus.canteen.core.drp.mapper.DrpSupplierMapper;
import com.bonus.canteen.core.drp.mapper.DrpSupplierQualificationMapper;
import com.bonus.canteen.core.drp.model.DrpSupplier;
import com.bonus.canteen.core.drp.model.DrpSupplierCategory;
import com.bonus.canteen.core.drp.model.DrpSupplierDeliver;
import com.bonus.canteen.core.drp.model.DrpSupplierQualification;
import com.bonus.canteen.core.drp.dto.*;
import com.bonus.canteen.core.drp.mapper.*;
import com.bonus.canteen.core.drp.model.*;
import com.bonus.canteen.core.drp.po.CategoryModel;
import com.bonus.canteen.core.drp.po.DrpSupplierModel;
import com.bonus.canteen.core.drp.service.DrpSupplierCategoryService;
import com.bonus.canteen.core.drp.service.DrpSupplierDeliverService;
import com.bonus.canteen.core.drp.service.DrpSupplierQualificationService;
import com.bonus.canteen.core.drp.service.DrpSupplierService;
import com.bonus.canteen.core.drp.vo.DrpSupplierDeliverVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierPageVO;
import com.bonus.canteen.core.drp.vo.DrpSupplierQualificationDetailPageVO;
import com.bonus.canteen.core.drp.vo.*;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.houqin.constant.DelFlagEnum;
import com.bonus.common.houqin.i18n.I18n;
import com.bonus.common.houqin.utils.LeBeanUtil;
import com.bonus.common.houqin.utils.id.Id;
import com.bonus.common.security.utils.SecurityUtils;
import com.github.pagehelper.page.PageMethod;
import com.google.common.collect.Maps;
import org.apache.commons.compress.utils.Lists;
@ -84,15 +77,15 @@ public class DrpSupplierServiceImpl extends ServiceImpl<DrpSupplierMapper, DrpSu
// @Autowired
// @Lazy
// private DrpIntoDetailMapper drpIntoDetailMapper;
// @Autowired
// @Lazy
// private DrpMaterialWinBidRecordsMapper drpMaterialWinBidRecordsMapper;
// @Autowired
// @Lazy
// private DrpMenuMaterialSupplierMapper drpMenuMaterialSupplierMapper;
// @Autowired
// @Lazy
// private DrpAuthorityApi drpAuthorityApi;
@Autowired
@Lazy
private DrpMaterialWinBidRecordsMapper drpMaterialWinBidRecordsMapper;
@Autowired
@Lazy
private DrpMenuMaterialSupplierMapper drpMenuMaterialSupplierMapper;
@Autowired
@Lazy
private DrpAuthorityApi drpAuthorityApi;
@Autowired
@Lazy
private DrpSupplierDeliverService drpSupplierDeliverService;
@ -232,97 +225,113 @@ public class DrpSupplierServiceImpl extends ServiceImpl<DrpSupplierMapper, DrpSu
}
}
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void editDrpSupplier(DrpSupplierEditDTO content) {
// List<DrpSupplier> check = ((DrpSupplierMapper)this.baseMapper).selectList(((LambdaQueryWrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpSupplier.class).eq(DrpSupplier::getSupplierName, content.getSupplierName())).eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())).ne(DrpSupplier::getSupplierId, content.getSupplierId())).select(new SFunction[]{DrpSupplier::getSupplierId}));
// if (CollUtil.isNotEmpty(check)) {
// throw new LeException(I18n.getMessage("drp.supplier-name-have", new Object[0]));
// } else {
// if (ObjectUtil.isNotEmpty(content.getSupplierUserId())) {
// Long checkSupplierUserId = ((DrpSupplierMapper)this.baseMapper).selectCount((Wrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpSupplier.class).eq(DrpSupplier::getSupplierUserId, content.getSupplierUserId())).eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())).ne(DrpSupplier::getSupplierId, content.getSupplierId()));
// if (checkSupplierUserId > 0L) {
// throw new LeException(I18n.getMessage("drp.supplier-is-bind", new Object[0]));
// }
// }
//
// DrpSupplier supplier = new DrpSupplier();
// BeanUtil.copyProperties(content, supplier, new String[0]);
// this.drpSupplierCategoryService.remove((Wrapper)Wrappers.lambdaQuery(DrpSupplierCategory.class).eq(DrpSupplierCategory::getSupplierId, content.getSupplierId()));
// if (CollUtil.isNotEmpty(content.getCategoryIdList())) {
// this.insertSupplierCategoryBatch(content.getCategoryIdList(), content.getSupplierId());
// }
//
// supplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
// if (CollUtil.isNotEmpty(content.getAttachmentList())) {
// supplier.setAttachment(JSONObject.toJSONString(content.getAttachmentList()));
// }
//
// if (CollUtil.isNotEmpty(content.getDeliverVOList())) {
// this.drpSupplierDeliverMapper.delete((Wrapper)Wrappers.lambdaQuery(DrpSupplierDeliver.class).eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
// content.getDeliverVOList().forEach((d) -> {
// d.setSupplierId(supplier.getSupplierId());
// this.drpSupplierDeliverService.add(d);
// });
// } else {
// this.drpSupplierDeliverMapper.delete((Wrapper)Wrappers.lambdaQuery(DrpSupplierDeliver.class).eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
// }
//
// ((DrpSupplierMapper)this.baseMapper).update(supplier, (Wrapper)Wrappers.lambdaQuery(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId()));
// if (ObjectUtil.isEmpty(content.getSupplierUserId())) {
// ((DrpSupplierMapper)this.baseMapper).update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getSupplierUserId, (Object)null));
// }
//
// Iterator var4 = content.getMainQualificationList().iterator();
//
// DrpSupplierQualification drpSupplierQualification;
// while(var4.hasNext()) {
// DrpSupplierQualificationUpdateDTO drpSupplierQualificationUpdateDTO = (DrpSupplierQualificationUpdateDTO)var4.next();
// drpSupplierQualification = new DrpSupplierQualification();
// BeanUtil.copyProperties(drpSupplierQualificationUpdateDTO, drpSupplierQualification, new String[0]);
// this.drpSupplierQualificationService.updateById(drpSupplierQualification);
// }
//
// if (CollUtil.isNotEmpty(content.getOtherQualificationList())) {
// this.drpSupplierQualificationMapper.delete((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpSupplierQualification.class).eq(DrpSupplierQualification::getSupplierId, content.getSupplierId())).eq(DrpSupplierQualification::getMainFlag, DrpQuantityMainFlagEnum.OTHER.getKey()));
// var4 = content.getOtherQualificationList().iterator();
//
// while(var4.hasNext()) {
// DrpSupplierQualificationSaveDTO drpSupplierQualificationSaveDTO = (DrpSupplierQualificationSaveDTO)var4.next();
// drpSupplierQualification = new DrpSupplierQualification();
// BeanUtil.copyProperties(drpSupplierQualificationSaveDTO, drpSupplierQualification, new String[0]);
// drpSupplierQualification.setSupplierId(supplier.getSupplierId());
// drpSupplierQualification.setMainFlag(DrpQuantityMainFlagEnum.OTHER.getKey());
// this.drpSupplierQualificationService.save(drpSupplierQualification);
// }
// }
//
// }
// }
//
// @Transactional(
// rollbackFor = {Exception.class}
// )
// public void removeBySupplierId(Long supplierId) {
// if (ObjectUtil.isEmpty(supplierId)) {
// log.info("***[库存中心_供应商管理]_删除供应商信息_传入的供应商id为空************");
// throw new LeException(I18n.getMessage("drp.supplier-id-is-null", new Object[0]));
// } else {
// ((DrpSupplierMapper)this.baseMapper).update((Object)null, (Wrapper)((LambdaUpdateWrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, supplierId)).set(DrpSupplier::getDelFlag, DelFlagEnum.DEL_TRUE.key())).set(DrpSupplier::getSupplierUserId, (Object)null));
// }
// }
//
// public void editDrpSupplierStatus(DrpSupplierEditStatusDTO content) {
// String username = SecurityUtils.getUser().getUsername();
// ((DrpSupplierMapper)this.baseMapper).update((Object)null, (Wrapper)((LambdaUpdateWrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getStatus, content.getStatus())).set(DrpSupplier::getUpby, username));
// }
//
// public List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content) {
// content.setAreaIdList(this.drpAuthorityApi.authAreaList(content.getAreaIdList()));
// return ((DrpSupplierMapper)this.baseMapper).listSupplier(DrpSupplierStatusEnum.NORMAL.key(), DelFlagEnum.DEL_FALSE.key(), content);
// }
//
@Transactional(
rollbackFor = {Exception.class}
)
public void editDrpSupplier(DrpSupplierEditDTO content) {
List<DrpSupplier> check = ((DrpSupplierMapper)this.baseMapper).selectList(Wrappers.lambdaQuery(DrpSupplier.class)
.eq(DrpSupplier::getSupplierName, content.getSupplierName())
.eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())
.ne(DrpSupplier::getSupplierId, content.getSupplierId()).select(DrpSupplier::getSupplierId));
if (CollUtil.isNotEmpty(check)) {
throw new ServiceException(I18n.getMessage("drp.supplier-name-have", new Object[0]));
} else {
if (ObjectUtil.isNotEmpty(content.getSupplierUserId())) {
Long checkSupplierUserId = ((DrpSupplierMapper)this.baseMapper).selectCount(Wrappers.lambdaQuery(DrpSupplier.class)
.eq(DrpSupplier::getSupplierUserId, content.getSupplierUserId())
.eq(DrpSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())
.ne(DrpSupplier::getSupplierId, content.getSupplierId()));
if (checkSupplierUserId > 0L) {
throw new ServiceException(I18n.getMessage("drp.supplier-is-bind", new Object[0]));
}
}
DrpSupplier supplier = new DrpSupplier();
BeanUtil.copyProperties(content, supplier, new String[0]);
this.drpSupplierCategoryService.remove(Wrappers.lambdaQuery(DrpSupplierCategory.class).eq(DrpSupplierCategory::getSupplierId, content.getSupplierId()));
if (CollUtil.isNotEmpty(content.getCategoryIdList())) {
this.insertSupplierCategoryBatch(content.getCategoryIdList(), content.getSupplierId());
}
supplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
if (CollUtil.isNotEmpty(content.getAttachmentList())) {
supplier.setAttachment(JSONObject.toJSONString(content.getAttachmentList()));
}
if (CollUtil.isNotEmpty(content.getDeliverVOList())) {
this.drpSupplierDeliverMapper.delete(Wrappers.lambdaQuery(DrpSupplierDeliver.class)
.eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
content.getDeliverVOList().forEach((d) -> {
d.setSupplierId(supplier.getSupplierId());
this.drpSupplierDeliverService.add(d);
});
} else {
this.drpSupplierDeliverMapper.delete(Wrappers.lambdaQuery(DrpSupplierDeliver.class)
.eq(DrpSupplierDeliver::getSupplierId, supplier.getSupplierId()));
}
((DrpSupplierMapper)this.baseMapper).update(supplier, Wrappers.lambdaQuery(DrpSupplier.class)
.eq(DrpSupplier::getSupplierId, content.getSupplierId()));
if (ObjectUtil.isEmpty(content.getSupplierUserId())) {
((DrpSupplierMapper)this.baseMapper).update((DrpSupplier) null, (Wrappers.lambdaUpdate(DrpSupplier.class)
.eq(DrpSupplier::getSupplierId, content.getSupplierId())).set(DrpSupplier::getSupplierUserId, (Object)null));
}
Iterator var4 = content.getMainQualificationList().iterator();
DrpSupplierQualification drpSupplierQualification;
while(var4.hasNext()) {
DrpSupplierQualificationUpdateDTO drpSupplierQualificationUpdateDTO = (DrpSupplierQualificationUpdateDTO)var4.next();
drpSupplierQualification = new DrpSupplierQualification();
BeanUtil.copyProperties(drpSupplierQualificationUpdateDTO, drpSupplierQualification, new String[0]);
this.drpSupplierQualificationService.updateById(drpSupplierQualification);
}
if (CollUtil.isNotEmpty(content.getOtherQualificationList())) {
this.drpSupplierQualificationMapper.delete(Wrappers.lambdaQuery(DrpSupplierQualification.class)
.eq(DrpSupplierQualification::getSupplierId, content.getSupplierId())
.eq(DrpSupplierQualification::getMainFlag, DrpQuantityMainFlagEnum.OTHER.getKey()));
var4 = content.getOtherQualificationList().iterator();
while(var4.hasNext()) {
DrpSupplierQualificationSaveDTO drpSupplierQualificationSaveDTO = (DrpSupplierQualificationSaveDTO)var4.next();
drpSupplierQualification = new DrpSupplierQualification();
BeanUtil.copyProperties(drpSupplierQualificationSaveDTO, drpSupplierQualification, new String[0]);
drpSupplierQualification.setSupplierId(supplier.getSupplierId());
drpSupplierQualification.setMainFlag(DrpQuantityMainFlagEnum.OTHER.getKey());
this.drpSupplierQualificationService.save(drpSupplierQualification);
}
}
}
}
@Transactional(
rollbackFor = {Exception.class}
)
public void removeBySupplierId(Long supplierId) {
if (ObjectUtil.isEmpty(supplierId)) {
log.info("***[库存中心_供应商管理]_删除供应商信息_传入的供应商id为空************");
throw new ServiceException(I18n.getMessage("drp.supplier-id-is-null", new Object[0]));
} else {
((DrpSupplierMapper)this.baseMapper).update((DrpSupplier) null,
(Wrappers.lambdaUpdate(DrpSupplier.class).eq(DrpSupplier::getSupplierId, supplierId))
.set(DrpSupplier::getDelFlag, DelFlagEnum.DEL_TRUE.key()).set(DrpSupplier::getSupplierUserId, (Object)null));
}
}
public void editDrpSupplierStatus(DrpSupplierEditStatusDTO content) {
String username = SecurityUtils.getUsername();
((DrpSupplierMapper)this.baseMapper).update((DrpSupplier) null, Wrappers.lambdaUpdate(DrpSupplier.class)
.eq(DrpSupplier::getSupplierId, content.getSupplierId())
.set(DrpSupplier::getStatus, content.getStatus()).set(DrpSupplier::getUpby, username));
}
public List<DrpSupplierVO> listSupplier(DrpSupplierQueryDTO content) {
content.setAreaIdList(this.drpAuthorityApi.authAreaList(content.getAreaIdList()));
return ((DrpSupplierMapper)this.baseMapper).listSupplier(DrpSupplierStatusEnum.NORMAL.key(), DelFlagEnum.DEL_FALSE.key(), content);
}
// public List<DrpCompariseSupplierQualificationPageVO> compariseSupplierQualification(DrpCompariseSupplierQualificationPageDTO content) {
// List<DrpCompariseSupplierQualificationPageVO> resultList = ((DrpSupplierMapper)this.baseMapper).pageCompariseSupplierQualification(content, DelFlagEnum.DEL_FALSE.key());
// Iterator var3 = resultList.iterator();
@ -471,99 +480,107 @@ public class DrpSupplierServiceImpl extends ServiceImpl<DrpSupplierMapper, DrpSu
this.drpSupplierCategoryService.saveBatch(supplierCategoryList);
}
// public List<DrpMaterialSupplierVO> getMaterialSupplier(DrpMaterialInfoDTO content) {
// List drpMaterialSupplierList;
// if (!ObjectUtil.isNull(content.getConfigType()) && !ObjectUtil.equal(content.getConfigType(), 1)) {
// PageMethod.startPage(content);
// drpMaterialSupplierList = ((DrpSupplierMapper)this.baseMapper).getCategorySupplier(content);
// } else {
// PageMethod.startPage(content);
// drpMaterialSupplierList = this.drpMaterialWinBidRecordsMapper.getMaterialSupplier(content);
// if (CollUtil.isEmpty(drpMaterialSupplierList)) {
// return drpMaterialSupplierList;
// }
//
// List<DrpMaterialBidRecordsSupplierVO> drpMaterialBidRecordsSupplierVOS = this.drpMaterialWinBidRecordsMapper.listSupplierPriceByMaterialIdList((List)drpMaterialSupplierList.stream().map(DrpMaterialSupplierVO::getMaterialId).collect(Collectors.toList()));
// Map<Long, List<DrpMaterialBidRecordsSupplierVO>> collect = (Map)drpMaterialBidRecordsSupplierVOS.stream().collect(Collectors.groupingBy(DrpMaterialBidRecordsSupplierVO::getMaterialId));
// List<MaterialAndUnitDTO> materialAndUnitDTOS = (List)drpMaterialSupplierList.stream().map((d) -> {
// return (new MaterialAndUnitDTO()).setMaterialId(d.getMaterialId()).setUnitId(d.getUnitId());
// }).collect(Collectors.toList());
// List<DrpLastOrderGoodsVO> lastOrderGoodsPriceList = this.drpMaterialWinBidRecordsMapper.getLastOrderGoodsPriceList(materialAndUnitDTOS, content.getAreaId());
// Map<String, DrpLastOrderGoodsVO> orderGoodsVOMap = (Map)lastOrderGoodsPriceList.stream().collect(Collectors.toMap((d) -> {
// Long var10000 = d.getMaterialId();
// return "" + var10000 + "-" + d.getUnitId();
// }, Function.identity(), (k1, k2) -> {
// return k1;
// }));
// if (CollUtil.isNotEmpty(drpMaterialSupplierList)) {
// drpMaterialSupplierList.forEach((d) -> {
// List<DrpMaterialBidRecordsSupplierVO> detailList = (List)collect.get(d.getMaterialId());
// List<DrpSupplierModel> nearestSupplierList = Lists.newArrayList();
// if (CollUtil.isNotEmpty(detailList)) {
// detailList.forEach((e) -> {
// DrpSupplierModel drpSupplierModel = new DrpSupplierModel();
// drpSupplierModel.setSupplierId(e.getWinSupplierId());
// drpSupplierModel.setSupplierName(e.getWinSupplierName());
// nearestSupplierList.add(drpSupplierModel);
// });
// }
//
// d.setNearestSupplierList(nearestSupplierList);
// Long var10001 = d.getMaterialId();
// DrpLastOrderGoodsVO drpLastOrderGoodsVO = (DrpLastOrderGoodsVO)orderGoodsVOMap.get("" + var10001 + "-" + d.getUnitId());
// d.setLastOrderGoods(drpLastOrderGoodsVO);
// });
// }
// }
//
// return drpMaterialSupplierList;
// }
//
// public void bidMaterialSupplier(DrpBidMaterialSupplierDTO content) {
// if (CollUtil.isNotEmpty(content.getMaterialIdList())) {
// content.getMaterialIdList().forEach((materialId) -> {
// content.setMaterialId(materialId);
// this.packageData(content);
// });
// }
//
// if (CollUtil.isNotEmpty(content.getCategoryIdList())) {
// content.getCategoryIdList().forEach((categoryId) -> {
// content.setCategoryId(categoryId);
// this.packageData(content);
// });
// } else {
// this.packageData(content);
// }
//
// }
//
// private void packageData(DrpBidMaterialSupplierDTO content) {
// DrpMenuMaterialSupplier drpMenuMaterialSupplier = (DrpMenuMaterialSupplier)this.drpMenuMaterialSupplierMapper.selectOne(((LambdaQueryWrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(DrpMenuMaterialSupplier.class).eq(DrpMenuMaterialSupplier::getCanteenId, content.getCanteenId())).eq(DrpMenuMaterialSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())).eq(ObjectUtil.isNotNull(content.getMaterialId()), DrpMenuMaterialSupplier::getMaterialId, content.getMaterialId())).eq(ObjectUtil.isNotNull(content.getCategoryId()), DrpMenuMaterialSupplier::getCategoryId, content.getCategoryId()));
// if (ObjectUtil.isEmpty(drpMenuMaterialSupplier)) {
// drpMenuMaterialSupplier = new DrpMenuMaterialSupplier();
// drpMenuMaterialSupplier.setId(Id.next());
// drpMenuMaterialSupplier.setSupplierId(content.getSupplierId());
// drpMenuMaterialSupplier.setCanteenId(content.getCanteenId());
// drpMenuMaterialSupplier.setMaterialId(content.getMaterialId());
// drpMenuMaterialSupplier.setCategoryId(content.getCategoryId());
// drpMenuMaterialSupplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
// drpMenuMaterialSupplier.setAlternativeSupplier(content.getAlternativeSupplier());
// drpMenuMaterialSupplier.setIfSupply(content.getIfSupply());
// this.drpMenuMaterialSupplierMapper.insert(drpMenuMaterialSupplier);
// } else {
// drpMenuMaterialSupplier.setSupplierId(content.getSupplierId());
// drpMenuMaterialSupplier.setMaterialId(content.getMaterialId());
// drpMenuMaterialSupplier.setCanteenId(content.getCanteenId());
// drpMenuMaterialSupplier.setCategoryId(content.getCategoryId());
// drpMenuMaterialSupplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
// drpMenuMaterialSupplier.setAlternativeSupplier(content.getAlternativeSupplier());
// drpMenuMaterialSupplier.setIfSupply(content.getIfSupply());
// this.drpMenuMaterialSupplierMapper.updateById(drpMenuMaterialSupplier);
// }
//
// }
//
public List<DrpMaterialSupplierVO> getMaterialSupplier(DrpMaterialInfoDTO content) {
List<DrpMaterialSupplierVO> drpMaterialSupplierList;
if (!ObjectUtil.isNull(content.getConfigType()) && !ObjectUtil.equal(content.getConfigType(), 1)) {
PageMethod.startPage(content);
drpMaterialSupplierList = ((DrpSupplierMapper)this.baseMapper).getCategorySupplier(content);
} else {
PageMethod.startPage(content);
drpMaterialSupplierList = this.drpMaterialWinBidRecordsMapper.getMaterialSupplier(content);
if (CollUtil.isEmpty(drpMaterialSupplierList)) {
return drpMaterialSupplierList;
}
List<DrpMaterialBidRecordsSupplierVO> drpMaterialBidRecordsSupplierVOS =
this.drpMaterialWinBidRecordsMapper.listSupplierPriceByMaterialIdList((List)drpMaterialSupplierList.stream()
.map(DrpMaterialSupplierVO::getMaterialId).collect(Collectors.toList()));
Map<Long, List<DrpMaterialBidRecordsSupplierVO>> collect = (Map)drpMaterialBidRecordsSupplierVOS.stream()
.collect(Collectors.groupingBy(DrpMaterialBidRecordsSupplierVO::getMaterialId));
List<MaterialAndUnitDTO> materialAndUnitDTOS = (List)drpMaterialSupplierList.stream().map((d) -> {
return (new MaterialAndUnitDTO()).setMaterialId(d.getMaterialId()).setUnitId(d.getUnitId());
}).collect(Collectors.toList());
List<DrpLastOrderGoodsVO> lastOrderGoodsPriceList = this.drpMaterialWinBidRecordsMapper.getLastOrderGoodsPriceList(materialAndUnitDTOS, content.getAreaId());
Map<String, DrpLastOrderGoodsVO> orderGoodsVOMap = (Map)lastOrderGoodsPriceList.stream().collect(Collectors.toMap((d) -> {
Long var10000 = d.getMaterialId();
return "" + var10000 + "-" + d.getUnitId();
}, Function.identity(), (k1, k2) -> {
return k1;
}));
if (CollUtil.isNotEmpty(drpMaterialSupplierList)) {
drpMaterialSupplierList.forEach((d) -> {
List<DrpMaterialBidRecordsSupplierVO> detailList = (List)collect.get(d.getMaterialId());
List<DrpSupplierModel> nearestSupplierList = Lists.newArrayList();
if (CollUtil.isNotEmpty(detailList)) {
detailList.forEach((e) -> {
DrpSupplierModel drpSupplierModel = new DrpSupplierModel();
drpSupplierModel.setSupplierId(e.getWinSupplierId());
drpSupplierModel.setSupplierName(e.getWinSupplierName());
nearestSupplierList.add(drpSupplierModel);
});
}
d.setNearestSupplierList(nearestSupplierList);
Long var10001 = d.getMaterialId();
DrpLastOrderGoodsVO drpLastOrderGoodsVO = (DrpLastOrderGoodsVO)orderGoodsVOMap.get("" + var10001 + "-" + d.getUnitId());
d.setLastOrderGoods(drpLastOrderGoodsVO);
});
}
}
return drpMaterialSupplierList;
}
public void bidMaterialSupplier(DrpBidMaterialSupplierDTO content) {
if (CollUtil.isNotEmpty(content.getMaterialIdList())) {
content.getMaterialIdList().forEach((materialId) -> {
content.setMaterialId(materialId);
this.packageData(content);
});
}
if (CollUtil.isNotEmpty(content.getCategoryIdList())) {
content.getCategoryIdList().forEach((categoryId) -> {
content.setCategoryId(categoryId);
this.packageData(content);
});
} else {
this.packageData(content);
}
}
private void packageData(DrpBidMaterialSupplierDTO content) {
DrpMenuMaterialSupplier drpMenuMaterialSupplier = (DrpMenuMaterialSupplier)this.drpMenuMaterialSupplierMapper
.selectOne(Wrappers.lambdaQuery(DrpMenuMaterialSupplier.class)
.eq(DrpMenuMaterialSupplier::getCanteenId, content.getCanteenId())
.eq(DrpMenuMaterialSupplier::getDelFlag, DelFlagEnum.DEL_FALSE.key())
.eq(ObjectUtil.isNotNull(content.getMaterialId()), DrpMenuMaterialSupplier::getMaterialId, content.getMaterialId())
.eq(ObjectUtil.isNotNull(content.getCategoryId()), DrpMenuMaterialSupplier::getCategoryId, content.getCategoryId()));
if (ObjectUtil.isEmpty(drpMenuMaterialSupplier)) {
drpMenuMaterialSupplier = new DrpMenuMaterialSupplier();
drpMenuMaterialSupplier.setId(Id.next());
drpMenuMaterialSupplier.setSupplierId(content.getSupplierId());
drpMenuMaterialSupplier.setCanteenId(content.getCanteenId());
drpMenuMaterialSupplier.setMaterialId(content.getMaterialId());
drpMenuMaterialSupplier.setCategoryId(content.getCategoryId());
drpMenuMaterialSupplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
drpMenuMaterialSupplier.setAlternativeSupplier(content.getAlternativeSupplier());
drpMenuMaterialSupplier.setIfSupply(content.getIfSupply());
this.drpMenuMaterialSupplierMapper.insert(drpMenuMaterialSupplier);
} else {
drpMenuMaterialSupplier.setSupplierId(content.getSupplierId());
drpMenuMaterialSupplier.setMaterialId(content.getMaterialId());
drpMenuMaterialSupplier.setCanteenId(content.getCanteenId());
drpMenuMaterialSupplier.setCategoryId(content.getCategoryId());
drpMenuMaterialSupplier.setDelFlag(DelFlagEnum.DEL_FALSE.key());
drpMenuMaterialSupplier.setAlternativeSupplier(content.getAlternativeSupplier());
drpMenuMaterialSupplier.setIfSupply(content.getIfSupply());
this.drpMenuMaterialSupplierMapper.updateById(drpMenuMaterialSupplier);
}
}
// public List<DrpMaterialSupplierVO> getMaterialSupplierByMaterialId(List<Long> materialIdList) {
// return this.drpMenuMaterialSupplierMapper.getMaterialSupplierByMaterialId(materialIdList);
// }

View File

@ -0,0 +1,80 @@
package com.bonus.canteen.core.drp.vo;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
public class DrpLastOrderGoodsVO {
@ApiModelProperty("最近一次采购价格")
private Integer lastOrderGoodsPrice;
@ApiModelProperty("最近一次采购日期")
private LocalDateTime lastOrderGoodsDate;
@ApiModelProperty("最近一次采购供应商")
private Long lastOrderGoodsSupplierId;
@ApiModelProperty("最近一次采购供应商名称")
private String lastOrderGoodsSupplierName;
private String orderGoodsId;
private Long materialId;
private Long unitId;
public Integer getLastOrderGoodsPrice() {
return this.lastOrderGoodsPrice;
}
public LocalDateTime getLastOrderGoodsDate() {
return this.lastOrderGoodsDate;
}
public Long getLastOrderGoodsSupplierId() {
return this.lastOrderGoodsSupplierId;
}
public String getLastOrderGoodsSupplierName() {
return this.lastOrderGoodsSupplierName;
}
public String getOrderGoodsId() {
return this.orderGoodsId;
}
public Long getMaterialId() {
return this.materialId;
}
public Long getUnitId() {
return this.unitId;
}
public void setLastOrderGoodsPrice(final Integer lastOrderGoodsPrice) {
this.lastOrderGoodsPrice = lastOrderGoodsPrice;
}
public void setLastOrderGoodsDate(final LocalDateTime lastOrderGoodsDate) {
this.lastOrderGoodsDate = lastOrderGoodsDate;
}
public void setLastOrderGoodsSupplierId(final Long lastOrderGoodsSupplierId) {
this.lastOrderGoodsSupplierId = lastOrderGoodsSupplierId;
}
public void setLastOrderGoodsSupplierName(final String lastOrderGoodsSupplierName) {
this.lastOrderGoodsSupplierName = lastOrderGoodsSupplierName;
}
public void setOrderGoodsId(final String orderGoodsId) {
this.orderGoodsId = orderGoodsId;
}
public void setMaterialId(final Long materialId) {
this.materialId = materialId;
}
public void setUnitId(final Long unitId) {
this.unitId = unitId;
}
public String toString() {
Integer var10000 = this.getLastOrderGoodsPrice();
return "DrpLastOrderGoodsVO(lastOrderGoodsPrice=" + var10000 + ", lastOrderGoodsDate=" + String.valueOf(this.getLastOrderGoodsDate()) + ", lastOrderGoodsSupplierId=" + this.getLastOrderGoodsSupplierId() + ", lastOrderGoodsSupplierName=" + this.getLastOrderGoodsSupplierName() + ", orderGoodsId=" + this.getOrderGoodsId() + ", materialId=" + this.getMaterialId() + ", unitId=" + this.getUnitId() + ")";
}
}

View File

@ -0,0 +1,135 @@
package com.bonus.canteen.core.drp.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
@ApiModel
public class DrpMaterialBidRecordsSupplierVO {
@ApiModelProperty("中标价")
private Integer winPrice;
@ApiModelProperty("中标日期")
private LocalDateTime winDate;
@ApiModelProperty("中标供应商id")
private Long winSupplierId;
@ApiModelProperty("中标供应商")
private String winSupplierName;
@ApiModelProperty("中标价格有效期开始")
private LocalDateTime bidValidityStartTime;
@ApiModelProperty("中标价格有效期结束")
private LocalDateTime bidValidityEndTime;
@ApiModelProperty("货品招标单号")
private String materialInquiryId;
@ApiModelProperty("货品id")
private Long materialId;
@ApiModelProperty("货品名称")
private String materialName;
@ApiModelProperty("货品编码")
private String materialCode;
@ApiModelProperty("货品单位")
private String unitName;
@ApiModelProperty("货品类别")
private String categoryName;
public Integer getWinPrice() {
return this.winPrice;
}
public LocalDateTime getWinDate() {
return this.winDate;
}
public Long getWinSupplierId() {
return this.winSupplierId;
}
public String getWinSupplierName() {
return this.winSupplierName;
}
public LocalDateTime getBidValidityStartTime() {
return this.bidValidityStartTime;
}
public LocalDateTime getBidValidityEndTime() {
return this.bidValidityEndTime;
}
public String getMaterialInquiryId() {
return this.materialInquiryId;
}
public Long getMaterialId() {
return this.materialId;
}
public String getMaterialName() {
return this.materialName;
}
public String getMaterialCode() {
return this.materialCode;
}
public String getUnitName() {
return this.unitName;
}
public String getCategoryName() {
return this.categoryName;
}
public void setWinPrice(final Integer winPrice) {
this.winPrice = winPrice;
}
public void setWinDate(final LocalDateTime winDate) {
this.winDate = winDate;
}
public void setWinSupplierId(final Long winSupplierId) {
this.winSupplierId = winSupplierId;
}
public void setWinSupplierName(final String winSupplierName) {
this.winSupplierName = winSupplierName;
}
public void setBidValidityStartTime(final LocalDateTime bidValidityStartTime) {
this.bidValidityStartTime = bidValidityStartTime;
}
public void setBidValidityEndTime(final LocalDateTime bidValidityEndTime) {
this.bidValidityEndTime = bidValidityEndTime;
}
public void setMaterialInquiryId(final String materialInquiryId) {
this.materialInquiryId = materialInquiryId;
}
public void setMaterialId(final Long materialId) {
this.materialId = materialId;
}
public void setMaterialName(final String materialName) {
this.materialName = materialName;
}
public void setMaterialCode(final String materialCode) {
this.materialCode = materialCode;
}
public void setUnitName(final String unitName) {
this.unitName = unitName;
}
public void setCategoryName(final String categoryName) {
this.categoryName = categoryName;
}
public String toString() {
Integer var10000 = this.getWinPrice();
return "DrpMaterialBidRecordsSupplierVO(winPrice=" + var10000 + ", winDate=" + String.valueOf(this.getWinDate()) + ", winSupplierId=" + this.getWinSupplierId() + ", winSupplierName=" + this.getWinSupplierName() + ", bidValidityStartTime=" + String.valueOf(this.getBidValidityStartTime()) + ", bidValidityEndTime=" + String.valueOf(this.getBidValidityEndTime()) + ", materialInquiryId=" + this.getMaterialInquiryId() + ", materialId=" + this.getMaterialId() + ", materialName=" + this.getMaterialName() + ", materialCode=" + this.getMaterialCode() + ", unitName=" + this.getUnitName() + ", categoryName=" + this.getCategoryName() + ")";
}
}

View File

@ -0,0 +1,163 @@
package com.bonus.canteen.core.drp.vo;
import com.bonus.canteen.core.drp.po.DrpSupplierModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
public class DrpMaterialSupplierVO {
@ApiModelProperty("货品id")
private Long materialId;
@ApiModelProperty("货品编号")
private String materialCode;
@ApiModelProperty("货品名称")
private String materialName;
@ApiModelProperty("货品类别")
private Long categoryId;
@ApiModelProperty("区域id")
private Long areaId;
@ApiModelProperty("区域名称")
private String areaName;
@ApiModelProperty("货品类别名称")
private String categoryName;
@ApiModelProperty("单位id")
private Long unitId;
@ApiModelProperty("单位名称")
private String unitName;
@ApiModelProperty("供应商id")
private Long supplierId;
@ApiModelProperty("供应商名称")
private String supplierName;
@ApiModelProperty("最近中标供应商")
private List<DrpSupplierModel> nearestSupplierList;
@ApiModelProperty("备选供应商列表")
private String alternativeSupplier;
@ApiModelProperty("最近一次送货信息")
private DrpLastOrderGoodsVO lastOrderGoods;
@ApiModelProperty("是否供应 1是 2否")
private Integer ifSupply;
public Long getMaterialId() {
return this.materialId;
}
public String getMaterialCode() {
return this.materialCode;
}
public String getMaterialName() {
return this.materialName;
}
public Long getCategoryId() {
return this.categoryId;
}
public Long getAreaId() {
return this.areaId;
}
public String getAreaName() {
return this.areaName;
}
public String getCategoryName() {
return this.categoryName;
}
public Long getUnitId() {
return this.unitId;
}
public String getUnitName() {
return this.unitName;
}
public Long getSupplierId() {
return this.supplierId;
}
public String getSupplierName() {
return this.supplierName;
}
public List<DrpSupplierModel> getNearestSupplierList() {
return this.nearestSupplierList;
}
public String getAlternativeSupplier() {
return this.alternativeSupplier;
}
public DrpLastOrderGoodsVO getLastOrderGoods() {
return this.lastOrderGoods;
}
public Integer getIfSupply() {
return this.ifSupply;
}
public void setMaterialId(final Long materialId) {
this.materialId = materialId;
}
public void setMaterialCode(final String materialCode) {
this.materialCode = materialCode;
}
public void setMaterialName(final String materialName) {
this.materialName = materialName;
}
public void setCategoryId(final Long categoryId) {
this.categoryId = categoryId;
}
public void setAreaId(final Long areaId) {
this.areaId = areaId;
}
public void setAreaName(final String areaName) {
this.areaName = areaName;
}
public void setCategoryName(final String categoryName) {
this.categoryName = categoryName;
}
public void setUnitId(final Long unitId) {
this.unitId = unitId;
}
public void setUnitName(final String unitName) {
this.unitName = unitName;
}
public void setSupplierId(final Long supplierId) {
this.supplierId = supplierId;
}
public void setSupplierName(final String supplierName) {
this.supplierName = supplierName;
}
public void setNearestSupplierList(final List<DrpSupplierModel> nearestSupplierList) {
this.nearestSupplierList = nearestSupplierList;
}
public void setAlternativeSupplier(final String alternativeSupplier) {
this.alternativeSupplier = alternativeSupplier;
}
public void setLastOrderGoods(final DrpLastOrderGoodsVO lastOrderGoods) {
this.lastOrderGoods = lastOrderGoods;
}
public void setIfSupply(final Integer ifSupply) {
this.ifSupply = ifSupply;
}
public String toString() {
Long var10000 = this.getMaterialId();
return "DrpMaterialSupplierVO(materialId=" + var10000 + ", materialCode=" + this.getMaterialCode() + ", materialName=" + this.getMaterialName() + ", categoryId=" + this.getCategoryId() + ", areaId=" + this.getAreaId() + ", areaName=" + this.getAreaName() + ", categoryName=" + this.getCategoryName() + ", unitId=" + this.getUnitId() + ", unitName=" + this.getUnitName() + ", supplierId=" + this.getSupplierId() + ", supplierName=" + this.getSupplierName() + ", nearestSupplierList=" + String.valueOf(this.getNearestSupplierList()) + ", alternativeSupplier=" + this.getAlternativeSupplier() + ", lastOrderGoods=" + String.valueOf(this.getLastOrderGoods()) + ", ifSupply=" + this.getIfSupply() + ")";
}
}

View File

@ -1,33 +0,0 @@
<?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.bonus.canteen.core.customer.mapper.CustOrgMapper">
<select id="listOrgBasicInfoByParams" resultType="com.bonus.canteen.core.customer.vo.OrgBasicInfoVO">
SELECT dept_id as org_id, dept_name as org_name, parent_id as super_id, del_flag as if_del
FROM sys_dept
<where>
<if test="params.delFlags != null and params.delFlags.size() > 0">
del_flag IN
<foreach collection="params.delFlags" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="params.orgIds != null and params.orgIds.size() > 0">
AND dept_id IN
<foreach collection="params.orgIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="params.superIds != null and params.superIds.size() > 0">
AND parent_id IN
<foreach collection="params.superIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,331 @@
<?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.bonus.canteen.core.drp.mapper.DrpMaterialWinBidRecordsMapper">
<!-- <select id="listMaterialUnit" resultType="com.bonus.canteen.core.drp.vo.DrpMaterialBidRecordsPageVO">-->
<!-- SELECT distinct sub.material_id,-->
<!-- sub.material_name,-->
<!-- sub.material_code,-->
<!-- sub.category_id,-->
<!-- d.category_name,-->
<!-- sub.unit_id,-->
<!-- du.unit_name,-->
<!-- sub.image_url,-->
<!-- dms.supplier_id,-->
<!-- ds.supplier_name,-->
<!-- sub.area_id,-->
<!-- aa.area_name-->
<!-- FROM menu_material sub-->
<!-- LEFT JOIN drp_unit du ON du.unit_id = sub.unit_id-->
<!-- LEFT JOIN menu_material_category d ON d.category_id = sub.category_id-->
<!-- left join drp_menu_material_supplier dms on sub.material_id = dms.material_id-->
<!-- left join drp_supplier ds on dms.supplier_id = ds.supplier_id-->
<!-- left join alloc_area aa on sub.area_id = aa.area_id-->
<!-- left join drp_material_latest_price dmlp-->
<!-- on sub.material_id = dmlp.material_id and dmlp.unit_id = sub.unit_id and dmlp.price_type = 1-->
<!-- WHERE sub.del_flag = 2-->
<!-- <if test="content.areaId != null">-->
<!-- and sub.area_id = #{content.areaId}-->
<!-- </if>-->
<!-- <if test="content.areaIdList != null and content.areaIdList.size() != 0">-->
<!-- and sub.area_id in-->
<!-- <foreach collection="content.areaIdList" item="areaId" separator="," open="(" close=")">-->
<!-- #{areaId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- &lt;!&ndash;区域权限&ndash;&gt;-->
<!-- <if test="content.areaAuth != null and content.areaAuth.size() > 0">-->
<!-- and sub.area_id in-->
<!-- <foreach collection="content.areaAuth" item="areaId" separator="," open="(" close=")">-->
<!-- #{areaId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="content.materialName != null and content.materialName != ''">-->
<!-- and (sub.material_name like concat(concat('%', #{content.materialName}), '%')-->
<!-- or sub.material_code like concat(concat('%', #{content.materialName}), '%')-->
<!-- )-->
<!-- </if>-->
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
<!-- and sub.category_id in-->
<!-- <foreach close=")" collection="content.categoryIdList" item="categoryId" open="(" separator=",">-->
<!-- #{categoryId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="content.materialType != null">-->
<!-- and sub.material_type = #{content.materialType}-->
<!-- </if>-->
<!-- <if test="content.winSupplierId != null">-->
<!-- and dmlp.supplier_id = #{content.winSupplierId}-->
<!-- </if>-->
<!-- <if test="content.bidTimeStart != null">-->
<!-- and dmlp.start_time >= #{content.bidTimeStart}-->
<!-- </if>-->
<!-- <if test="content.bidTimeEnd != null">-->
<!-- and dmlp.end_time <![CDATA[ <= ]]> #{content.bidTimeEnd}-->
<!-- </if>-->
<!-- <if test="content.priceState != null ">-->
<!-- <if test="content.priceState == 1">-->
<!-- and now() between dmlp.start_time and dmlp.end_time-->
<!-- </if>-->
<!-- <if test="content.priceState == 2">-->
<!-- and (NOT now() between dmlp.start_time and dmlp.end_time)-->
<!-- </if>-->
<!-- </if>-->
<!-- <if test="content.startTime != null">-->
<!-- and dmlp.crtime >= #{content.startTime}-->
<!-- </if>-->
<!-- <if test="content.endTime != null">-->
<!-- and dmlp.crtime <![CDATA[ <= ]]> #{content.endTime}-->
<!-- </if>-->
<!-- </select>-->
<!-- <select id="listSupplierWinRecords" resultType="com.bonus.canteen.core.drp.vo.DrpMaterialSupplierWinRecordsVO">-->
<!-- SELECT-->
<!-- a.material_id,-->
<!-- b.unit_id,-->
<!-- a.win_price-->
<!-- FROM-->
<!-- drp_material_win_bid_records a-->
<!-- LEFT JOIN menu_material b ON a.material_id = b.material_id-->
<!-- WHERE-->
<!-- a.win_supplier_id = #{supplierId}-->
<!-- AND a.material_id IN-->
<!-- <foreach collection="materialIdList" item="materialId" separator="," open="(" close=")">-->
<!-- #{materialId}-->
<!-- </foreach>-->
<!-- <if test="materialInquiryId != null">-->
<!-- and a.material_inquiry_id= #{materialInquiryId}-->
<!-- </if>-->
<!-- order by a.crtime desc-->
<!-- </select>-->
<!-- <select id="listSupplierPriceByMaterialId"-->
<!-- resultType="com.bonus.canteen.core.drp.vo.DrpMaterialBidRecordsSupplierVO">-->
<!-- SELECT a.win_supplier_id,-->
<!-- b.supplier_name winSupplierName,-->
<!-- a.win_date,-->
<!-- a.win_price,-->
<!-- a.farmers_market_price,-->
<!-- a.bid_validity_start_time,-->
<!-- a.bid_validity_end_time,-->
<!-- a.material_inquiry_id,-->
<!-- mm.material_name,-->
<!-- mm.material_code,-->
<!-- mmc.category_name,-->
<!-- du.unit_id,-->
<!-- du.unit_name-->
<!-- FROM drp_material_win_bid_records a-->
<!-- LEFT JOIN drp_supplier b ON b.supplier_id = a.win_supplier_id-->
<!-- LEFT JOIN menu_material mm on a.material_id = mm.material_id-->
<!-- LEFT JOIN menu_material_category mmc on mm.category_id = mmc.category_id-->
<!-- LEFT JOIN drp_unit du on mm.unit_id = du.unit_id-->
<!-- WHERE a.material_id = #{materialId}-->
<!-- </select>-->
<!-- <select id="listSupplierWinRecordsBySupplier"-->
<!-- resultType="com.bonus.canteen.core.drp.vo.DrpMaterialSupplierWinRecordsVO">-->
<!-- SELECT-->
<!-- sub.material_id,-->
<!-- sub.unit_id,-->
<!-- sub.win_price-->
<!-- FROM (-->
<!-- SELECT-->
<!-- a.material_id,-->
<!-- b.unit_id,-->
<!-- a.win_price,-->
<!-- ROW_NUMBER() OVER (PARTITION BY a.material_id ORDER BY a.crtime DESC) AS rn-->
<!-- FROM-->
<!-- drp_material_win_bid_records a-->
<!-- LEFT JOIN menu_material b ON a.material_id = b.material_id-->
<!-- WHERE-->
<!-- a.win_supplier_id = #{supplierId} and now() between a.bid_validity_start_time and a.bid_validity_end_time-->
<!-- AND a.material_id IN-->
<!-- <foreach collection="materialIdList" item="materialId" separator="," open="(" close=")">-->
<!-- #{materialId}-->
<!-- </foreach>-->
<!-- ) sub-->
<!-- WHERE sub.rn = 1-->
<!-- </select>-->
<!-- <select id="listSupplierPriceByMaterialIdLast"-->
<!-- resultType="com.bonus.canteen.core.drp.vo.DrpMaterialBidRecordsSupplierVO">-->
<!-- SELECT a.win_supplier_id,-->
<!-- b.supplier_name winSupplierName,-->
<!-- a.win_date,-->
<!-- a.win_price,-->
<!-- a.farmers_market_price,-->
<!-- a.bid_validity_start_time,-->
<!-- a.bid_validity_end_time,-->
<!-- a.material_inquiry_id-->
<!-- FROM drp_material_win_bid_records a-->
<!-- LEFT JOIN drp_supplier b ON b.supplier_id = a.win_supplier_id-->
<!-- WHERE a.material_id = #{materialId}-->
<!-- order by a.crtime desc-->
<!-- limit 1-->
<!-- </select>-->
<select id="listSupplierPriceByMaterialIdList" resultType="com.bonus.canteen.core.drp.vo.DrpMaterialBidRecordsSupplierVO">
SELECT
sub.material_id,
sub.win_supplier_id,
sub.winSupplierName,
sub.win_date,
sub.win_price,
sub.bid_validity_start_time,
sub.bid_validity_end_time,
sub.material_inquiry_id
FROM
(
SELECT
a.material_id,
a.win_supplier_id,
b.supplier_name winSupplierName,
a.win_date,
a.win_price,
a.bid_validity_start_time,
a.bid_validity_end_time,
a.material_inquiry_id,
ROW_NUMBER() OVER ( PARTITION BY a.material_id ORDER BY a.crtime DESC ) AS row_num
FROM
drp_material_win_bid_records a
LEFT JOIN drp_supplier b ON b.supplier_id = a.win_supplier_id
) sub
WHERE
sub.row_num = 1
AND sub.material_id IN
<foreach collection="materialIdList" item="materialId" separator="," open="(" close=")">
#{materialId}
</foreach>
</select>
<select id="getLastOrderGoodsPrice"
resultType="com.bonus.canteen.core.drp.vo.DrpLastOrderGoodsVO">
select dogd.single_price as lastOrderGoodsPrice, dog.crtime as lastOrderGoodsDate,
dog.supplier_id as lastOrderGoodsSupplierId, ds.supplier_name as lastOrderGoodsSupplierName
from drp_order_goods_detail dogd
left join drp_order_goods dog on dogd.order_goods_id = dog.order_goods_id
left join drp_supplier ds on dog.supplier_id = ds.supplier_id
where dogd.material_id = #{materialId} and dogd.unit_id = #{unitId}
and dog.order_status = 2
and dog.del_flag = 2
and dog.approve_status = 3
order by dog.crtime desc
limit 1
</select>
<!-- <select id="getMarketPrice" resultType="com.bonus.canteen.core.drp.vo.DrpMarketPriceVO">-->
<!-- select dmpd.unit_price, dmp.harvest_time, dmp.harvest_source-->
<!-- from drp_market_price_detail dmpd-->
<!-- left join drp_market_price dmp on dmpd.harvest_id = dmp.harvest_id-->
<!-- where dmpd.material_id = #{materialId} and dmpd.unit_id = #{unitId}-->
<!-- and dmp.del_flag = 2-->
<!-- and dmp.commit_status = 2-->
<!-- order by dmp.crtime desc-->
<!-- limit 3-->
<!-- </select>-->
<select id="getMaterialSupplier" resultType="com.bonus.canteen.core.drp.vo.DrpMaterialSupplierVO">
select mm.material_id,
mm.material_name,
mm.material_code,
mm.category_id,
mmc.category_name,
mm.unit_id,
du.unit_name,
dms.supplier_id,
ds.supplier_name,
dms.alternative_supplier,
mm.area_id,
aa.area_name,
dms.if_supply
from menu_material mm
left join drp_menu_material_supplier dms on mm.material_id = dms.material_id and dms.category_id is null
<if test="content.canteenId != null">
and dms.canteen_id = #{content.canteenId}
</if>
left join drp_supplier ds on dms.supplier_id = ds.supplier_id
left join menu_material_category mmc on mm.category_id = mmc.category_id
left join drp_unit du on mm.unit_id = du.unit_id
left join alloc_area aa on mm.area_id = aa.area_id
<where>
and mm.del_flag = 2
-- 根据所选食堂的所属区域过滤原料
and (
mm.area_id in (select area_id from alloc_canteen where canteen_id = #{content.canteenId})
or mm.area_id is null
)
<if test="content.key != null and content.key != ''">
and (
mm.material_name like concat('%', #{content.key}, '%')
or mm.material_code like concat('%', #{content.key}, '%')
or mm.bar_code like concat('%', #{content.key}, '%')
)
</if>
<if test="content.categoryIdList != null and content.categoryIdList.size() > 0">
and mm.category_id in
<foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">
#{categoryId}
</foreach>
</if>
<if test="content.areaIdList != null and content.areaIdList.size() > 0">
and ( mm.area_id in
<foreach collection="content.areaIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
or mm.area_id is null
)
</if>
</where>
</select>
<select id="getLastOrderGoodsPriceList" resultType="com.bonus.canteen.core.drp.vo.DrpLastOrderGoodsVO">
select * from (
select dogd.single_price as lastOrderGoodsPrice,
dog.crtime as lastOrderGoodsDate,
dog.supplier_id as lastOrderGoodsSupplierId,
ds.supplier_name as lastOrderGoodsSupplierName,
dogd.order_goods_id as orderGoodsId,
dogd.material_id as materialId,
dogd.unit_id as unitId,
ROW_NUMBER() OVER ( PARTITION BY dogd.material_id ORDER BY dogd.crtime DESC ) AS rn
from drp_order_goods_detail dogd
left join drp_order_goods dog on dogd.order_goods_id = dog.order_goods_id
left join drp_supplier ds on dog.supplier_id = ds.supplier_id
left join alloc_canteen ac on dog.canteen_id = ac.canteen_id
where dog.order_status = 2
and dog.del_flag = 2
and dog.approve_status = 3
<if test="materialAndUnitDTOS != null and materialAndUnitDTOS.size() > 0">
and CONCAT(dogd.material_id, dogd.unit_id) IN
<foreach collection="materialAndUnitDTOS" item="item" open="(" separator="," close=")">
CONCAT(#{item.materialId}, #{item.unitId})
</foreach>
</if>
<if test="areaId != null ">
and ac.area_id = #{areaId}
</if>
) sub
where sub.rn = 1
</select>
<!-- <select id="getMarketPriceList" resultType="com.bonus.canteen.core.drp.vo.DrpMarketPriceVO">-->
<!-- select * from (-->
<!-- select dmpd.unit_price,-->
<!-- dmp.harvest_time,-->
<!-- dmp.harvest_source,-->
<!-- dmpd.material_id as materialId,-->
<!-- dmpd.unit_id as unitId,-->
<!-- ROW_NUMBER() OVER ( PARTITION BY dmpd.material_id ORDER BY dmp.crtime DESC ) AS rn-->
<!-- from drp_market_price_detail dmpd-->
<!-- left join drp_market_price dmp on dmpd.harvest_id = dmp.harvest_id-->
<!-- left join alloc_area ac on dmp.area_id = ac.area_id-->
<!-- where dmp.del_flag = 2-->
<!-- and dmp.commit_status = 2-->
<!-- <if test="materialAndUnitDTOS != null and materialAndUnitDTOS.size() > 0">-->
<!-- and CONCAT(dmpd.material_id, dmpd.unit_id) IN-->
<!-- <foreach collection="materialAndUnitDTOS" item="item" open="(" separator="," close=")">-->
<!-- CONCAT(#{item.materialId}, #{item.unitId})-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="areaId != null">-->
<!-- and ac.area_id = #{areaId}-->
<!-- </if>-->
<!-- ) sub-->
<!-- where sub.rn in (1, 2, 3)-->
<!-- </select>-->
</mapper>

View File

@ -290,58 +290,59 @@
<!-- </foreach>-->
<!-- </if>-->
<!-- </select>-->
<!-- <select id="listSupplier" resultType="net.xnzn.core.drp.vo.DrpSupplierVO">-->
<!-- SELECT-->
<!-- ds.supplier_id,-->
<!-- ds.supplier_name,-->
<!-- ds.supplier_score,-->
<!-- ds.area_id,-->
<!-- aa.area_name-->
<!-- FROM-->
<!-- drp_supplier ds-->
<!-- LEFT JOIN alloc_area aa ON aa.area_id = ds.area_id-->
<!-- where ds.status = #{status}-->
<!-- and ds.del_flag = #{delFlag}-->
<!-- <if test="content.areaIdList != null and content.areaIdList.size() > 0">-->
<!-- and ds.area_id in-->
<!-- <foreach collection="content.areaIdList" item="item" separator="," open="(" close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="content.supplierName != null and content.supplierName != ''">-->
<!-- and ds.supplier_name like concat('%',#{content.supplierName},'%')-->
<!-- </if>-->
<!-- </select>-->
<!-- <select id="getCategorySupplier" resultType="net.xnzn.core.drp.vo.DrpMaterialSupplierVO"-->
<!-- parameterType="net.xnzn.core.drp.dto.DrpMaterialInfoDTO">-->
<!-- select-->
<!-- mmc.category_id,-->
<!-- mmc.category_name,-->
<!-- dms.supplier_id,-->
<!-- ds.supplier_name,-->
<!-- dms.alternative_supplier,-->
<!-- dms.canteen_id-->
<!-- from menu_material_category mmc-->
<!-- left join drp_menu_material_supplier dms on mmc.category_id = dms.category_id and dms.material_id is null-->
<!-- <if test="content.canteenId != null">-->
<!-- and dms.canteen_id = #{content.canteenId}-->
<!-- </if>-->
<!-- left join drp_supplier ds on dms.supplier_id = ds.supplier_id-->
<!-- <where>-->
<!-- and mmc.del_flag = 2-->
<!-- and (-->
<!-- mmc.area_id in (select area_id from alloc_canteen where canteen_id = #{content.canteenId})-->
<!-- or mmc.area_id is null-->
<!-- )-->
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
<!-- and mmc.category_id in-->
<!-- <foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">-->
<!-- #{categoryId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- </where>-->
<!-- </select>-->
<select id="listSupplier" resultType="com.bonus.canteen.core.drp.vo.DrpSupplierVO">
SELECT
ds.supplier_id,
ds.supplier_name,
ds.supplier_score,
ds.area_id,
aa.area_name
FROM
drp_supplier ds
LEFT JOIN alloc_area aa ON aa.area_id = ds.area_id
where ds.status = #{status}
and ds.del_flag = #{delFlag}
<if test="content.areaIdList != null and content.areaIdList.size() > 0">
and ds.area_id in
<foreach collection="content.areaIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="content.supplierName != null and content.supplierName != ''">
and ds.supplier_name like concat('%',#{content.supplierName},'%')
</if>
</select>
<select id="getCategorySupplier" resultType="com.bonus.canteen.core.drp.vo.DrpMaterialSupplierVO"
parameterType="com.bonus.canteen.core.drp.dto.DrpMaterialInfoDTO">
select
mmc.category_id,
mmc.category_name,
dms.supplier_id,
ds.supplier_name,
dms.alternative_supplier,
dms.canteen_id
from menu_material_category mmc
left join drp_menu_material_supplier dms on mmc.category_id = dms.category_id and dms.material_id is null
<if test="content.canteenId != null">
and dms.canteen_id = #{content.canteenId}
</if>
left join drp_supplier ds on dms.supplier_id = ds.supplier_id
<where>
and mmc.del_flag = 2
and (
mmc.area_id in (select area_id from alloc_canteen where canteen_id = #{content.canteenId})
or mmc.area_id is null
)
<if test="content.categoryIdList != null and content.categoryIdList.size() > 0">
and mmc.category_id in
<foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">
#{categoryId}
</foreach>
</if>
</where>
</select>
</mapper>