Quellcode durchsuchen

达沃特 禅道 2023年5月26日13:54:45

纪新园 vor 2 Jahren
Ursprung
Commit
e1325a225f
16 geänderte Dateien mit 590 neuen und 14 gelöschten Zeilen
  1. 3 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java
  2. 22 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/CorpsAddrController.java
  3. 108 1
      blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/CorpsDescController.java
  4. 42 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/excel/CorpAddrDWTExcel.java
  5. 42 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/excel/CorpDWTExcel.java
  6. 23 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/excel/CorpsImportExcel.java
  7. 8 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/CorpsDescMapper.java
  8. 155 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/CorpsDescMapper.xml
  9. 3 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/service/ICorpsAddrService.java
  10. 4 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/service/ICorpsDescService.java
  11. 26 3
      blade-service/blade-client/src/main/java/org/springblade/client/corps/service/impl/CorpsAddrServiceImpl.java
  12. 21 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/service/impl/CorpsDescServiceImpl.java
  13. 68 4
      blade-service/blade-client/src/main/java/org/springblade/client/goods/controller/GoodsDescController.java
  14. 45 0
      blade-service/blade-client/src/main/java/org/springblade/client/goods/excel/GoodsOutDWTExcel.java
  15. 1 1
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/excel/DatasetExcel.java
  16. 19 5
      blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

+ 3 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java

@@ -58,6 +58,7 @@ public interface IUserClient {
 	String USER_ALL = API_PREFIX + "/selectUserAll";
 	String LOGIN_BY_ACCOUNT = API_PREFIX + "/loginByAccount";
 	String UPDATE_OPEN_ID = API_PREFIX + "/updateOpenId";
+	String SELECT_USER_BY_NAMES = API_PREFIX + "/selectUserByNames";
 
 	@GetMapping(LIST_USER_BY_ROLE_ID)
 	R<List<User>> listUserByRoleId(@RequestParam("roleId") Long roleId);
@@ -202,4 +203,6 @@ public interface IUserClient {
 						@RequestParam(value = "tenantId", required = false) String tenantId
 	);
 
+	@GetMapping(SELECT_USER_BY_NAMES)
+    String selectUserByNames(@RequestParam(value = "adminProfilesName", required = false) String adminProfilesName);
 }

+ 22 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/CorpsAddrController.java

@@ -17,6 +17,7 @@
 package org.springblade.client.corps.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -26,10 +27,13 @@ import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 
 import org.bouncycastle.crypto.agreement.srp.SRP6Util;
+import org.springblade.client.corps.excel.CorpAddrDWTExcel;
+import org.springblade.client.corps.excel.CorpsExcel;
 import org.springblade.client.corps.service.ICorpsAddrService;
 import org.springblade.client.corps.service.impl.CorpsAttnServiceImpl;
 import org.springblade.client.entity.CorpsAttn;
 import org.springblade.client.entity.CorpsDesc;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -41,6 +45,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.client.entity.CorpsAddr;
 import org.springblade.client.vo.CorpsAddrVO;
 import org.springblade.core.boot.ctrl.BladeController;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -157,5 +162,22 @@ public class CorpsAddrController extends BladeController {
 		return R.data(corpsAddrList);
 	}
 
+	/**
+	 * 导入用户地址
+	 */
+	@PostMapping("/importCorpsAddr")
+	@ApiOperationSupport(order = 12)
+	@ApiOperation(value = "导入客户地址", notes = "传入excel")
+	public R importCorpsAddr(@RequestParam("file") MultipartFile file, @RequestParam("corpId") Long corpId) {
+		if (ObjectUtils.isNull(corpId)) {
+			throw new SecurityException("请先保存");
+		}
+		List<CorpAddrDWTExcel> excelList = ExcelUtil.read(file, CorpAddrDWTExcel.class);
+		if (CollectionUtils.isEmpty(excelList)) {
+			throw new SecurityException("数据不能为空");
+		}
+		return corpsAddrService.importCorpsAddr(excelList, corpId);
+	}
+
 
 }

+ 108 - 1
blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/CorpsDescController.java

@@ -141,6 +141,113 @@ public class CorpsDescController extends BladeController {
 	}
 
 	/**
+	 *  客户详情导出
+	 */
+	@GetMapping("/export")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入corpsDesc")
+	public void export(CorpsDescVO corpsDesc, HttpServletResponse response) {
+		//获取客户子类别
+		if (StringUtils.isNotBlank(corpsDesc.getCorpsTypeId())) {
+			Long corpsTypeId = Long.parseLong(corpsDesc.getCorpsTypeId());
+			List<Long> corpsTypeIdList = new ArrayList<>();
+			corpsTypeService.selectChildById(corpsTypeId, corpsTypeIdList);
+			corpsTypeIdList.add(corpsTypeId);
+			corpsDesc.setTypeList(corpsTypeIdList);
+		} else if (StringUtils.isNotBlank(corpsDesc.getCorpsTypeName())) {
+			LambdaQueryWrapper<CorpsType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+			lambdaQueryWrapper.eq(CorpsType::getCname, corpsDesc.getCorpsTypeName());
+			lambdaQueryWrapper.eq(CorpsType::getIsDeleted, 0);
+			lambdaQueryWrapper.eq(CorpsType::getTenantId, SecureUtil.getTenantId());
+			List<CorpsType> corpsTypeList = corpsTypeService.list(lambdaQueryWrapper);
+			if (CollectionUtils.isNotEmpty(corpsTypeList)) {
+				List<Long> corpsTypeIdList = new ArrayList<>();
+				corpsTypeList.stream().forEach(item -> {
+					corpsTypeService.selectChildById(item.getId(), corpsTypeIdList);
+					corpsTypeIdList.add(item.getId());
+				});
+				corpsDesc.setTypeList(corpsTypeIdList);
+			}
+		}
+		corpsDesc.setTenantId(AuthUtil.getTenantId());
+
+		corpsDesc.setIsDeleted(0);
+
+		List<CorpsDescVO> list = corpsDescService.selectCorpsDesc(corpsDesc);
+
+		String belongtocompany = "";//所属公司ids
+		for (CorpsDescVO descVO : list) {
+			if (ObjectUtil.isNotEmpty(descVO.getBelongtocompany())) {
+				belongtocompany = belongtocompany + descVO.getBelongtocompany() + ",";
+			}
+		}
+		List<CorpsDesc> corpsDescList = corpsDescService.selectByCorpIds(belongtocompany);
+
+		if (CollectionUtils.isNotEmpty(list)) {
+			list.forEach(item -> {
+				if (StringUtils.isNotBlank(item.getAdminProfiles())) {
+					List<User> updateUserList = userClient.selectUserIds(item.getAdminProfiles());
+					StringBuffer stringBuffer = new StringBuffer();
+					if (CollectionUtils.isNotEmpty(updateUserList)) {
+						updateUserList.forEach(items -> {
+							if (items != null) {
+								stringBuffer.append(items.getName()).append(",");
+							}
+						});
+					}
+					item.setAdminProfilesName(stringBuffer.toString());
+				}
+				if (item.getBelongtocompany() != null) {
+					if (ObjectUtil.isNotEmpty(corpsDescList)) {
+						item.setBelongCompany(corpsDescList.stream().filter(e -> e.getId().toString().equals(item.getBelongtocompany())).findFirst().get().getCname());
+					}
+				}
+
+				List<Long> typeIdList = corpsTypeDescService.list(new LambdaQueryWrapper<CorpsTypeDesc>().eq(CorpsTypeDesc::getCorpId, item.getId()))
+					.stream().map(CorpsTypeDesc::getCorpTypeId).collect(Collectors.toList());
+
+				if (CollectionUtil.isNotEmpty(typeIdList)) {
+					String typeName = corpsTypeService.list(new LambdaQueryWrapper<CorpsType>()
+						.in(CorpsType::getId, typeIdList)
+						.eq(CorpsType::getCorpType, item.getCorpType())
+						.eq(CorpsType::getIsDeleted, 0)
+					).stream().map(CorpsType::getCname).collect(Collectors.joining(","));
+					item.setCorpsTypeName(typeName);
+				}
+				//获取客户地址
+				List<CorpsAddr> corpsAddrList = corpsAddrService.list(new QueryWrapper<CorpsAddr>().eq("pid", item.getId()).eq("is_deleted", 0));
+				if (corpsAddrList != null && corpsAddrList.size() > 0) {
+					item.setAddr(corpsAddrList.stream().map(CorpsAddr::getAddr).collect(Collectors.joining("-")));
+				}
+			});
+		}
+		ExcelUtil.export(response, "客户资料", "客户资料", BeanUtil.copy(list, CorpDWTExcel.class), CorpDWTExcel.class);
+	}
+
+	/**
+	 * 批量修改分管员
+	 */
+	@PostMapping("/importCorp")
+	@ApiOperationSupport(order = 12)
+	@ApiOperation(value = "导入客户资料", notes = "传入excel")
+	public R importCorp(@RequestParam("file") MultipartFile file) {
+		List<CorpsImportExcel> excelList = ExcelUtil.read(file, CorpsImportExcel.class);
+		if (CollectionUtils.isEmpty(excelList)) {
+			throw new SecurityException("数据不能为空");
+		}
+		return corpsDescService.importCorp(excelList);
+	}
+	/**
+	 *  导出分管员模板
+	 */
+	@GetMapping("/exportAdminProfiles")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入corpsDesc")
+	public void exportAdminProfiles(HttpServletResponse response) {
+		ExcelUtil.export(response, "分管员模板", "分管员模板", new ArrayList<>(), CorpsImportExcel.class);
+	}
+
+	/**
 	 * 自定义分页 客户详情
 	 */
 	@GetMapping("/page")
@@ -932,7 +1039,7 @@ public class CorpsDescController extends BladeController {
 						map.put("attn", corpsAddr.getAttn());
 						map.put("tel", corpsAddr.getTel());
 						map.put("alias", corpsAddr.getAlias());
-						if (ObjectUtils.isNotNull(corpsAddr.getAddr())){
+						if (ObjectUtils.isNotNull(corpsAddr.getAddr())) {
 							List<String> list = Arrays.asList(corpsAddr.getAddr().split(","));
 							String addr = list.stream().distinct().collect(Collectors.joining());
 							addr = addr.replace(",", "");

+ 42 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/excel/CorpAddrDWTExcel.java

@@ -0,0 +1,42 @@
+package org.springblade.client.corps.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class CorpAddrDWTExcel implements Serializable {
+
+	/**
+	 * 地址
+	 */
+	@ExcelProperty("地址(必填)")
+	private String addr;
+	/**
+	 * 联系人
+	 */
+	@ExcelProperty("联系人(必填)")
+	private String attn;
+	/**
+	 * 电话
+	 */
+	@ExcelProperty("电话(必填)")
+	private String tel;
+	/**
+	 * 备注
+	 */
+	@ExcelProperty("备注")
+	private String remarks;
+
+
+
+
+}

+ 42 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/excel/CorpDWTExcel.java

@@ -0,0 +1,42 @@
+package org.springblade.client.corps.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class CorpDWTExcel implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@ExcelProperty("编号")
+	private String code;
+
+	@ExcelProperty("名称")
+	private String cname;
+
+	@ExcelProperty("所属公司")
+	private String companyName;
+
+	@ExcelProperty("代理品牌")
+	private String goodtypes;
+
+	@ExcelProperty("类别")
+	private String corpsTypeName;
+
+	@ExcelProperty("分管员")
+	private String adminProfilesName;
+
+	@ExcelProperty("地址")
+	private String addr;
+
+
+
+
+}

+ 23 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/excel/CorpsImportExcel.java

@@ -0,0 +1,23 @@
+package org.springblade.client.corps.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class CorpsImportExcel implements Serializable {
+
+	@ExcelProperty("客户编号(必填)")
+	private String code;
+
+	@ExcelProperty("分管员(必填)")
+	private String adminProfilesName;
+
+}

+ 8 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/CorpsDescMapper.java

@@ -30,6 +30,14 @@ public interface CorpsDescMapper extends BaseMapper<CorpsDesc> {
 	List<CorpsDescVO> selectCorpsDescPage(IPage page, @Param("CorpsDesc") CorpsDescVO corpsDesc);
 
 	/**
+	 *
+	 *
+	 * @param corpsDesc
+	 * @return
+	 */
+	List<CorpsDescVO> selectCorpsDesc(@Param("CorpsDesc") CorpsDescVO corpsDesc);
+
+	/**
 	 * 获得船公司名
 	 *
 	 * @param corpsDesc

+ 155 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/CorpsDescMapper.xml

@@ -645,4 +645,159 @@
             ORDER BY tel DESC
         </if>
     </select>
+    <select id="selectCorpsDesc" resultType="org.springblade.client.vo.CorpsDescVO">
+        select
+        *
+        from
+        basic_corps_desc
+        where
+        1 = 1
+        <if test="CorpsDesc.id!=null">
+            and id = #{CorpsDesc.id}
+        </if>
+        <if test="CorpsDesc.isDeleted!=null">
+            and is_deleted = #{CorpsDesc.isDeleted}
+        </if>
+        <if test="CorpsDesc.code!=null and CorpsDesc.code != ''">
+            and code like CONCAT(CONCAT('%', #{CorpsDesc.code}), '%')
+        </if>
+        <if test="CorpsDesc.corpType!=null and CorpsDesc.corpType != '' and CorpsDesc.corpType != 'KG'">
+            and corp_type like CONCAT(CONCAT('%', #{CorpsDesc.corpType}), '%')
+        </if>
+        <if test="CorpsDesc.corpType!=null and CorpsDesc.corpType != '' and CorpsDesc.corpType == 'KG'">
+            and (corp_type like '%KH%' or corp_type like '%GYS%')
+        </if>
+        <if test="CorpsDesc.cname!=null and CorpsDesc.cname != ''">
+            and cname like CONCAT(CONCAT('%', #{CorpsDesc.cname}), '%')
+        </if>
+        <if test="CorpsDesc.line!=null and CorpsDesc.line != ''">
+            and line like CONCAT(CONCAT('%', #{CorpsDesc.line}), '%')
+        </if>
+        <if test="CorpsDesc.enname!=null and CorpsDesc.enname != ''">
+            and enname = #{CorpsDesc.enname}
+        </if>
+        <if test="CorpsDesc.goodtypes!=null and CorpsDesc.goodtypes != ''">
+            and goodtypes like CONCAT(CONCAT('%', #{CorpsDesc.goodtypes}), '%')
+        </if>
+        <if test="CorpsDesc.companytype!=null and CorpsDesc.companytype != ''">
+            and companytype = #{CorpsDesc.companytype}
+        </if>
+        <if test="CorpsDesc.belongtoarea!=null and CorpsDesc.belongtoarea != ''">
+            and belongtoarea like CONCAT(CONCAT('%',  #{CorpsDesc.belongtoarea}), '%')
+        </if>
+        <if test="CorpsDesc.attn!=null and CorpsDesc.attn != ''">
+            and attn like CONCAT(CONCAT('%',  #{CorpsDesc.attn}), '%')
+        </if>
+        <if test="CorpsDesc.tel!=null and CorpsDesc.tel != ''">
+            and tel = #{CorpsDesc.tel}
+        </if>
+        <if test="CorpsDesc.position!=null and CorpsDesc.position != ''">
+            and id = #{CorpsDesc.position}
+        </if>
+        <if test="CorpsDesc.invioceTitle!=null and CorpsDesc.invioceTitle != ''">
+            and invioce_title = #{CorpsDesc.invioceTitle}
+        </if>
+        <if test="CorpsDesc.taxCode!=null and CorpsDesc.taxCode != ''">
+            and tax_code = #{CorpsDesc.taxCode}
+        </if>
+        <if test="CorpsDesc.invioceAddrTel!=null and CorpsDesc.invioceAddrTel != ''">
+            and invioce_addr_tel = #{CorpsDesc.invioceAddrTel}
+        </if>
+        <if test="CorpsDesc.accountName!=null and CorpsDesc.accountName != ''">
+            and account_name = #{CorpsDesc.accountName}
+        </if>
+        <if test="CorpsDesc.accountBank!=null and CorpsDesc.accountBank != ''">
+            and account_bank = #{CorpsDesc.accountBank}
+        </if>
+        <if test="CorpsDesc.accountNo!=null and CorpsDesc.accountNo != ''">
+            and account_no = #{CorpsDesc.accountNo}
+        </if>
+        <if test="CorpsDesc.accountNameFcy!=null and CorpsDesc.accountNameFcy != ''">
+            and account_name_fcy = #{CorpsDesc.accountNameFcy}
+        </if>
+        <if test="CorpsDesc.accountBankFcy!=null and CorpsDesc.accountBankFcy != ''">
+            and account_bank_fcy = #{CorpsDesc.accountBankFcy}
+        </if>
+        <if test="CorpsDesc.accountNoFcy!=null and CorpsDesc.accountNoFcy != ''">
+            and account_no_fcy = #{CorpsDesc.accountNoFcy}
+        </if>
+        <if test="CorpsDesc.addr!=null and CorpsDesc.addr != ''">
+            and addr = #{CorpsDesc.addr}
+        </if>
+        <if test="CorpsDesc.storageAddr!=null and CorpsDesc.storageAddr != ''">
+            and storage_addr = #{CorpsDesc.storageAddr}
+        </if>
+        <if test="CorpsDesc.subStorageAddr!=null and CorpsDesc.subStorageAddr != ''">
+            and sub_storage_addr = #{CorpsDesc.subStorageAddr}
+        </if>
+        <if test="CorpsDesc.creditstatus!=null and CorpsDesc.creditstatus != ''">
+            and creditstatus = #{CorpsDesc.creditstatus}
+        </if>
+        <if test="CorpsDesc.creditLevel!=null and CorpsDesc.creditLevel != ''">
+            and credit_level like CONCAT(CONCAT('%',  #{CorpsDesc.creditLevel}), '%')
+        </if>
+        <if test="CorpsDesc.adminProfiles!=null and CorpsDesc.adminProfiles != ''">
+            and (admin_profiles like CONCAT(CONCAT('%',  #{CorpsDesc.adminProfiles}), '%')
+            or admin_profiles = '' or admin_profiles IS NULL)
+        </if>
+        <if test="CorpsDesc.belongtocompany!=null and CorpsDesc.belongtocompany != ''">
+            and (belongtocompany = #{CorpsDesc.belongtocompany}
+            or belongtocompany IS NULL)
+        </if>
+        <if test="CorpsDesc.creditGrant!=null">
+            and credit_grant = #{CorpsDesc.creditGrant}
+        </if>
+        <if test="CorpsDesc.creditDay!=null">
+            and credit_day = #{CorpsDesc.creditDay}
+        </if>
+        <if test="CorpsDesc.creditRate!=null">
+            and credit_rate = #{CorpsDesc.creditRate}
+        </if>
+        <if test="CorpsDesc.remarks!=null and CorpsDesc.remarks != ''">
+            and remarks = #{CorpsDesc.remarks}
+        </if>
+        <if test="CorpsDesc.version!=null and CorpsDesc.version != ''">
+            and version = #{CorpsDesc.version}
+        </if>
+        <if test="CorpsDesc.tenantId!=null and CorpsDesc.tenantId != ''">
+            and tenant_id = #{CorpsDesc.tenantId}
+        </if>
+        <if test="CorpsDesc.createUser!=null">
+            and create_user = #{CorpsDesc.createUser}
+        </if>
+        <if test="CorpsDesc.updateUser!=null">
+            and update_user = #{CorpsDesc.updateUser}
+        </if>
+        <if test="CorpsDesc.status!=null">
+            and status = #{CorpsDesc.status}
+        </if>
+        <if test='CorpsDesc.typeList !=null and CorpsDesc.typeList.size>0'>
+            and id in (
+            SELECT
+            DISTINCT
+            corp_id
+            FROM
+            basic_corps_type_desc
+            WHERE
+            status = 0
+            AND corp_type_id in
+            <foreach collection="CorpsDesc.typeList" index="index" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+            )
+        </if>
+
+        <if test="CorpsDesc.sort != null and CorpsDesc.sort != '' and CorpsDesc.sort == 0 and CorpsDesc.typeSort == 1">
+            ORDER BY cname ASC
+        </if>
+        <if test="CorpsDesc.sort != null and CorpsDesc.sort != '' and CorpsDesc.sort == 0 and CorpsDesc.typeSort == 2">
+            ORDER BY tel ASC
+        </if>
+        <if test="CorpsDesc.sort != null and CorpsDesc.sort != '' and CorpsDesc.sort == 1 and CorpsDesc.typeSort == 1">
+            ORDER BY cname DESC
+        </if>
+        <if test="CorpsDesc.sort != null and CorpsDesc.sort != '' and CorpsDesc.sort == 1 and CorpsDesc.typeSort == 2">
+            ORDER BY tel DESC
+        </if>
+    </select>
 </mapper>

+ 3 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/service/ICorpsAddrService.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.client.corps.service;
 
+import org.springblade.client.corps.excel.CorpAddrDWTExcel;
 import org.springblade.client.entity.CorpsAddr;
 import org.springblade.client.entity.CorpsDesc;
 import org.springblade.client.vo.CorpsAddrVO;
@@ -49,4 +50,6 @@ public interface ICorpsAddrService extends IService<CorpsAddr> {
 	 * @return
 	 */
 	List<CorpsAddr> getCorpsAddr(Long pid,String tenantId);
+
+    R importCorpsAddr(List<CorpAddrDWTExcel> excelList, Long corpId);
 }

+ 4 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/service/ICorpsDescService.java

@@ -222,4 +222,8 @@ public interface ICorpsDescService extends IService<CorpsDesc> {
 	R importCorpsNew(List<CorpsYCPExcel> excelList);
 
 	R preserve(CorpsAddr corpsAddr);
+
+	List<CorpsDescVO> selectCorpsDesc(CorpsDescVO corpsDesc);
+
+	R importCorp(List<CorpsImportExcel> excelList);
 }

+ 26 - 3
blade-service/blade-client/src/main/java/org/springblade/client/corps/service/impl/CorpsAddrServiceImpl.java

@@ -16,16 +16,14 @@
  */
 package org.springblade.client.corps.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.AllArgsConstructor;
+import org.springblade.client.corps.excel.CorpAddrDWTExcel;
 import org.springblade.client.corps.mapper.CorpsAddrMapper;
 import org.springblade.client.corps.service.ICorpsAddrService;
 import org.springblade.client.entity.CorpsAddr;
-import org.springblade.client.entity.CorpsAttn;
 import org.springblade.client.entity.CorpsDesc;
 import org.springblade.client.vo.CorpsAddrVO;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -33,6 +31,7 @@ import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -55,6 +54,30 @@ public class CorpsAddrServiceImpl extends ServiceImpl<CorpsAddrMapper, CorpsAddr
 		return baseMapper.getCorpsAddr(pid, tenantId);
 	}
 
+	@Override
+	public R importCorpsAddr(List<CorpAddrDWTExcel> excelList, Long corpId) {
+		List<CorpsAddr> corpsAddrList = new ArrayList<>();
+		for (CorpAddrDWTExcel corpAddrDWTExcel : excelList) {
+			CorpsAddr corpsAddr = new CorpsAddr();
+			corpsAddr.setPid(corpId);
+			corpsAddr.setTenantId(AuthUtil.getTenantId());
+			corpsAddr.setAddr(corpAddrDWTExcel.getAddr());
+			CorpsAddr corpsAttn = baseMapper.selectCorpsAddrCode(corpsAddr.getAddr(), corpsAddr.getPid(), SecureUtil.getTenantId());
+			if (corpsAttn == null) {
+				corpsAddr.setCreateUser(AuthUtil.getUserId());
+				corpsAddr.setCreateTime(new Date());
+			} else {
+				corpsAddr.setUpdateUser(AuthUtil.getUserId());
+				corpsAddr.setUpdateTime(new Date());
+			}
+			corpsAddr.setAttn(corpAddrDWTExcel.getAttn());
+			corpsAddr.setTel(corpAddrDWTExcel.getTel());
+			corpsAddrList.add(corpsAddr);
+		}
+		this.saveOrUpdateBatch(corpsAddrList);
+		return R.data("保存成功");
+	}
+
 	public R saveOrUpdateAddr(CorpsDesc corpsDesc, Long userId, Long pId, String tenantId, Date date) {
 		if (CollectionUtils.isNotEmpty(corpsDesc.getCorpsAddrList())) {
 			for (CorpsAddr corpsAddr : corpsDesc.getCorpsAddrList()) {

+ 21 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/service/impl/CorpsDescServiceImpl.java

@@ -1039,6 +1039,27 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, CorpsDesc
 	}
 
 	@Override
+	public List<CorpsDescVO> selectCorpsDesc(CorpsDescVO corpsDesc) {
+		return baseMapper.selectCorpsDesc(corpsDesc);
+	}
+
+	@Override
+	public R importCorp(List<CorpsImportExcel> excelList) {
+		List<CorpsDesc> corpsDescList = new ArrayList<>();
+		for (CorpsImportExcel item : excelList) {
+			CorpsDesc corpsDesc = baseMapper.selectCorpsDescCode(item.getCode(), AuthUtil.getTenantId());
+			if (ObjectUtils.isNull(corpsDesc)) {
+				throw new RuntimeException("编号:" + item.getCode() + "不存在,修改失败");
+			}
+			String userIds = userClient.selectUserByNames(item.getAdminProfilesName());
+			corpsDesc.setAdminProfiles(userIds);
+			corpsDescList.add(corpsDesc);
+		}
+		this.updateBatchById(corpsDescList);
+		return R.success("修改成功");
+	}
+
+	@Override
 	public IPage<CorpsDescDto> selectPartsCorpsDescPage(IPage<CorpsDescDto> page, CorpsDescDto corpsDescDto) {
 		//获取客户子类别
 		if (StringUtils.isNotBlank(corpsDescDto.getCorpsTypeId())) {

+ 68 - 4
blade-service/blade-client/src/main/java/org/springblade/client/goods/controller/GoodsDescController.java

@@ -28,15 +28,13 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
+import org.springblade.client.corps.excel.CorpDWTExcel;
 import org.springblade.client.corps.service.ICorpsAttnService;
 import org.springblade.client.corps.service.ICorpsDescService;
 import org.springblade.client.entity.*;
 import org.springblade.client.feign.IRedisClient;
 import org.springblade.client.goods.enums.GoodsTypeEnum;
-import org.springblade.client.goods.excel.GoodsExcel;
-import org.springblade.client.goods.excel.GoodsExcels;
-import org.springblade.client.goods.excel.GoodsInfoExcel;
-import org.springblade.client.goods.excel.GoodsOutExcel;
+import org.springblade.client.goods.excel.*;
 import org.springblade.client.goods.mapper.GoodsFilesMapper;
 import org.springblade.client.goods.service.*;
 import org.springblade.client.vo.GoodsDescVO;
@@ -47,6 +45,7 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.mocha.entity.PriceBank;
@@ -242,6 +241,71 @@ public class GoodsDescController extends BladeController {
 		return R.data(iPage);
 	}
 
+	@GetMapping("/export")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入goodsDesc")
+	public void export(
+					 @RequestParam(name = "cname", required = false) String cname,
+					 @RequestParam(name = "cnameInt", required = false) String cnameInt,
+					 @RequestParam(name = "ename", required = false) String ename,
+					 @RequestParam(name = "code", required = false) String code,
+					 @RequestParam(name = "goodsTypeId", required = false) String goodsTypeId,
+					 @RequestParam(name = "belongToCorpId", required = false) String belongToCorpId,
+					 @RequestParam(name = "status", required = false) String status,
+					 @RequestParam(name = "unit", required = false) String unit,
+					 @RequestParam(name = "remarks", required = false) String remarks,
+					 @RequestParam(name = "upperFrame", required = false) String upperFrame,
+					 @RequestParam(name = "label", required = false) String label,
+					 @RequestParam(name = "artsVision", required = false) String artsVision,
+		 HttpServletResponse response) {
+		LambdaQueryWrapper<GoodsDesc> goodsDescLambdaQueryWrapper = new LambdaQueryWrapper<>();
+
+		//指定分类为一级分类,查询此分类所有二级分类的商品
+		if (StringUtils.isNotBlank(goodsTypeId)) {
+			Long goodsId = Long.parseLong(goodsTypeId);
+			List<Long> goodsIdList = new ArrayList<>();
+			selectChildById(goodsId, goodsIdList);
+			goodsIdList.add(goodsId);
+
+			goodsDescLambdaQueryWrapper.in(GoodsDesc::getGoodsTypeId, goodsIdList);
+		}
+
+		if (StringUtils.isNotBlank(belongToCorpId)) {
+			LambdaQueryWrapper<CorpsDesc> gysIdListQueryWrapper = new LambdaQueryWrapper<>();
+			gysIdListQueryWrapper.select(CorpsDesc::getId)
+				.eq(CorpsDesc::getBelongtocompany, belongToCorpId)
+				.eq(CorpsDesc::getCorpType, "GYS")
+				.eq(CorpsDesc::getIsDeleted, 0)
+				.eq(CorpsDesc::getTenantId, AuthUtil.getTenantId());
+
+			List<Long> gysIdList = corpsDescService.list(gysIdListQueryWrapper).stream().map(CorpsDesc::getId).collect(Collectors.toList());
+			if (CollectionUtils.isNotEmpty(gysIdList)) {
+				goodsDescLambdaQueryWrapper.in(GoodsDesc::getCorpId, gysIdList);
+			} else {
+				goodsDescLambdaQueryWrapper.in(GoodsDesc::getCorpId, "''");
+			}
+		}
+
+		goodsDescLambdaQueryWrapper.like(!StringUtils.isBlank(cname), GoodsDesc::getCname, cname);
+		goodsDescLambdaQueryWrapper.like(!StringUtils.isBlank(cnameInt), GoodsDesc::getCnameInt, cnameInt);
+		goodsDescLambdaQueryWrapper.like(!StringUtils.isBlank(ename), GoodsDesc::getEname, ename);
+		goodsDescLambdaQueryWrapper.like(!StringUtils.isBlank(code), GoodsDesc::getCode, code);
+		goodsDescLambdaQueryWrapper.like(!StringUtils.isBlank(label), GoodsDesc::getCode, label);
+		goodsDescLambdaQueryWrapper.like(!StringUtils.isBlank(remarks), GoodsDesc::getCode, remarks);
+		goodsDescLambdaQueryWrapper.eq(GoodsDesc::getTenantId, AuthUtil.getTenantId());
+		goodsDescLambdaQueryWrapper.eq(GoodsDesc::getType, 0);
+		goodsDescLambdaQueryWrapper.eq(ObjectUtils.isNotNull(status), GoodsDesc::getStatus, status);
+		goodsDescLambdaQueryWrapper.eq(ObjectUtils.isNotNull(unit), GoodsDesc::getUnit, unit);
+		goodsDescLambdaQueryWrapper.eq(ObjectUtils.isNotNull(upperFrame), GoodsDesc::getUpperFrame, upperFrame);
+		if (StringUtils.isNotEmpty(artsVision)) {
+			goodsDescLambdaQueryWrapper.and(i -> i.like(GoodsDesc::getArtsVision, artsVision).or().isNull(GoodsDesc::getArtsVision));
+		}
+		goodsDescLambdaQueryWrapper.orderByDesc(GoodsDesc::getCreateTime);
+		List<GoodsDesc> list = goodsDescService.list(goodsDescLambdaQueryWrapper);
+		ExcelUtil.export(response, "产品信息", "产品信息", BeanUtil.copy(list, GoodsOutDWTExcel.class), GoodsOutDWTExcel.class);
+
+	}
+
 	@GetMapping("/product")
 	public R<?> product(GoodsDesc goodsDesc) {
 		redisClient.basicData("goods");

+ 45 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/excel/GoodsOutDWTExcel.java

@@ -0,0 +1,45 @@
+package org.springblade.client.goods.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class GoodsOutDWTExcel
+{
+	@ExcelProperty("产品编码")
+	private String code;
+	@ExcelProperty("产品名称")
+	private String cname;
+	/**
+	 * 品牌
+	 */
+	@ExcelProperty("品牌")
+	private String brand;
+
+	@ExcelProperty("花纹")
+	private String brandItem;
+
+	@ExcelProperty("规格型号")
+	private String typeno;
+
+	@ExcelProperty("负荷")
+	private String specsOne;
+	@ExcelProperty("速级")
+	private String specsTwo;
+	@ExcelProperty("供应商")
+	private String corpName;
+	@ExcelProperty("加强型")
+	private String level;
+	@ExcelProperty("所属公司")
+	private String artsVisionName;
+
+
+}

+ 1 - 1
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/excel/DatasetExcel.java

@@ -51,7 +51,7 @@ public class DatasetExcel {
 	/**
 	 * 发货数量
 	 */
-	@ExcelProperty(value = "货数量")
+	@ExcelProperty(value = "货数量")
 	private BigDecimal actualQuantity;
 
 	@ExcelProperty(value = "金额")

+ 19 - 5
blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

@@ -25,18 +25,20 @@ import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tenant.annotation.NonDS;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.system.user.service.IUserService;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.entity.UserInfo;
 import org.springblade.system.user.entity.UserOauth;
 import org.springblade.system.user.enums.UserEnum;
+import org.springblade.system.user.service.IUserService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 用户服务Feign实现类
@@ -155,14 +157,26 @@ public class UserClient implements IUserClient {
 	@Override
 	public User loginByAccount(String account, String phone, String userType, String tenantId) {
 		LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
-		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(account),User::getAccount, account);
-		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(phone),User::getPhone, phone);
-		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(userType),User::getUserType, userType);
-		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(tenantId),User::getTenantId, tenantId);
+		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(account), User::getAccount, account);
+		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(phone), User::getPhone, phone);
+		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(userType), User::getUserType, userType);
+		userLambdaQueryWrapper.eq(ObjectUtils.isNotNull(tenantId), User::getTenantId, tenantId);
 		userLambdaQueryWrapper.eq(User::getIsDeleted, 0);
 		return service.getOne(userLambdaQueryWrapper);
 	}
 
+	@Override
+	public String selectUserByNames(String adminProfilesName) {
+		List<Long> ids = service.list(new LambdaQueryWrapper<User>().eq(User::getIsDeleted, 0)
+			.eq(User::getTenantId,AuthUtil.getTenantId())
+			.apply("find_in_set(real_name,'" + adminProfilesName + "')")).stream().map(User::getId).collect(Collectors.toList());
+		List<String> idLists = new ArrayList<>();
+		for (Long id : ids) {
+			idLists.add(id + "");
+		}
+		return String.join(",", idLists);
+	}
+
 	/**
 	 * 获取用户
 	 * @param user