demand: 返货快递不拼接备注。批量导入校验操作员。新增根据规则筛选供应商接口。根据虚拟单筛选总数重算。总部不能作为寄件网点
committer: heyu
This commit is contained in:
parent
6ff77cea3c
commit
c80db35415
@ -13,6 +13,7 @@ package com.xdadan.erp.web.emis;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
@ -87,7 +88,7 @@ public class EmisSiteController extends EmisBaseController
|
||||
}
|
||||
}
|
||||
|
||||
List<EmisSite> list = emisSiteService.selectEmisSiteList(emisSite);
|
||||
List<EmisSite> list = emisSiteService.selectEmisSiteList(emisSite).stream().filter(i->!"88888".equals(i.getSiteCode())).collect(Collectors.toList());
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.core.domain.entity.SysUser;
|
||||
import com.xdadan.erp.emis.domain.EmisTransPlanRule;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -72,6 +73,13 @@ public class EmisSupplierController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/chooseSupplier")
|
||||
public TableDataInfo chooseSupplier(EmisSupplier emisSupplier) {
|
||||
startPage();
|
||||
List<EmisSupplier> list = emisSupplierService.selectSupplierInfoByConditions(emisSupplier);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公司供应商表列表
|
||||
*/
|
||||
|
||||
@ -91,4 +91,12 @@ public interface EmisSupplierMapper extends BaseMapper<EmisSupplier>
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisSupplierByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据条件筛选供应商
|
||||
*
|
||||
* @param emisSupplier
|
||||
* @return
|
||||
*/
|
||||
List<EmisSupplier> selectSupplierInfoByConditions(EmisSupplier emisSupplier);
|
||||
}
|
||||
|
||||
@ -2844,7 +2844,7 @@ public class EmisBaseService {
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(waybill.getVirtualRemark())) {
|
||||
if ("002".equals(waybill.getTransLineType()) && StringUtil.isNotBlank(waybill.getVirtualRemark())) {
|
||||
// 取每个虚拟单号的后六位,用逗号拼接
|
||||
String[] codes = waybill.getVirtualRemark().split(",");
|
||||
String shortCodes = Arrays.stream(codes)
|
||||
|
||||
@ -83,4 +83,12 @@ public interface IEmisSupplierService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisSupplierById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件删选供应商
|
||||
*
|
||||
* @param emisSupplier
|
||||
* @return
|
||||
*/
|
||||
List<EmisSupplier> selectSupplierInfoByConditions(EmisSupplier emisSupplier);
|
||||
}
|
||||
|
||||
@ -10,7 +10,12 @@
|
||||
|
||||
package com.xdadan.erp.emis.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.xdadan.erp.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xdadan.erp.emis.domain.EmisSupplier;
|
||||
@ -124,4 +129,62 @@ public class EmisSupplierServiceImpl implements IEmisSupplierService
|
||||
return emisSupplierMapper.deleteEmisSupplierById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmisSupplier> selectSupplierInfoByConditions(EmisSupplier emisSupplier) {
|
||||
List<EmisSupplier> originalList = emisSupplierMapper.selectSupplierInfoByConditions(emisSupplier);
|
||||
List<EmisSupplier> resultList = new ArrayList<>();
|
||||
Set<String> codeSet = new HashSet<>();
|
||||
|
||||
for (EmisSupplier supplier : originalList) {
|
||||
String code = supplier.getCode();
|
||||
String name = supplier.getName();
|
||||
|
||||
// 如果code或name包含逗号,说明有多个值需要拆分
|
||||
if (StringUtils.isNotBlank(code) && code.contains(",") ||
|
||||
StringUtils.isNotBlank(name) && name.contains(",")) {
|
||||
|
||||
String[] codes = StringUtils.isNotBlank(code) ? code.split(",") : new String[0];
|
||||
String[] names = StringUtils.isNotBlank(name) ? name.split(",") : new String[0];
|
||||
|
||||
// 取两个数组的最大长度,确保能处理code和name数量不一致的情况
|
||||
int maxLength = Math.max(codes.length, names.length);
|
||||
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
String currentCode = null;
|
||||
String currentName = null;
|
||||
|
||||
if (i < codes.length) {
|
||||
currentCode = codes[i].trim();
|
||||
}
|
||||
if (i < names.length) {
|
||||
currentName = names[i].trim();
|
||||
}
|
||||
|
||||
// 如果code为空或已存在,跳过
|
||||
if (StringUtils.isBlank(currentCode) || codeSet.contains(currentCode)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 添加到去重Set中
|
||||
codeSet.add(currentCode);
|
||||
|
||||
EmisSupplier newSupplier = new EmisSupplier();
|
||||
// 设置拆分后的code和name
|
||||
newSupplier.setCode(currentCode);
|
||||
newSupplier.setName(currentName);
|
||||
|
||||
resultList.add(newSupplier);
|
||||
}
|
||||
} else {
|
||||
// 如果code和name都不包含逗号,检查是否已存在
|
||||
if (StringUtils.isNotBlank(code) && !codeSet.contains(code)) {
|
||||
codeSet.add(code);
|
||||
resultList.add(supplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -959,12 +959,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
if (empUser == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "操作员不正确");
|
||||
}
|
||||
if(!"1".equals(empUser.getBlOpen())){
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "操作员已停用");
|
||||
}
|
||||
emisWaybillSave.setOperateEmployeeCode(empUser.getEmpCode());
|
||||
} else if ("2".equals(pickupMethod)) {
|
||||
SysUser empUser = getEmisStaffBySiteCodeAndEmpName(getCurrentUser().getOwnerSiteCode(), emisWaybillSave.getOperateEmployeeCode());
|
||||
if (empUser == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "取件员不正确");
|
||||
}
|
||||
if(!"1".equals(empUser.getBlOpen())){
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "取件员已停用");
|
||||
}
|
||||
emisWaybillSave.setTakePieceEmployeeCode(empUser.getEmpCode());
|
||||
}
|
||||
|
||||
|
||||
@ -257,4 +257,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectSupplierInfoByConditions" parameterType="emisSupplier" resultMap="EmisSupplierResult">
|
||||
select distinct r.supplier_code as code,
|
||||
(SELECT GROUP_CONCAT(s.name)
|
||||
FROM emis_supplier s
|
||||
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
||||
AND s.del_flag = '0') as name
|
||||
from emis_trans_plan_rule r
|
||||
<where>
|
||||
r.del_flag = '0'
|
||||
<if test="params.startSiteCode != null and params.startSiteCode != ''"> and r.start_site_code = #{params.startSiteCode}</if>
|
||||
<if test="params.nextSiteCode != null and params.nextSiteCode != ''"> and r.next_site_code = #{params.nextSiteCode}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
</mapper>
|
||||
@ -2017,6 +2017,7 @@
|
||||
<if test="custOrderId != null and custOrderId != ''"> and cust_order_id=#{custOrderId}</if>
|
||||
<if test="billCodeSub != null and billCodeSub != ''"> and bill_code_sub like concat('%', #{billCodeSub}, '%')</if>
|
||||
<if test="orderStatus != null and orderStatus != ''"> and order_status=#{orderStatus}</if>
|
||||
<if test="blVirtual ==1"> and bl_virtual=#{blVirtual}</if>
|
||||
<if test="waybillStatus != null and waybillStatus != ''"> and waybill_status=#{waybillStatus}</if>
|
||||
<if test="orderType != null and orderType != ''"> and order_type like concat('%', #{orderType}, '%')</if>
|
||||
<if test="orderDate != null "> and order_date = #{orderDate}</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user