|
@@ -107,61 +107,113 @@ public class ShopServiceImpl implements ShopService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改供应商资料
|
|
|
+ *
|
|
|
+ * @param shopUpdateDto ShopUpdateDto{
|
|
|
+ * shopId 供应商Id
|
|
|
+ * userId 用户Id
|
|
|
+ * name 组织名称
|
|
|
+ * sName 供应商公司简称(sname)
|
|
|
+ * email 邮箱
|
|
|
+ * contractPhone 固定电话
|
|
|
+ * linkMan 联系人
|
|
|
+ * provinceId 省(provinceID)
|
|
|
+ * cityId 市(cityID)
|
|
|
+ * townId 所在县区Id(townID)
|
|
|
+ * address 地址
|
|
|
+ * socialCreditCode 统一社会信用代码(营业执照编号)
|
|
|
+ * businessLicense 营业执照(businessLicenseImage)
|
|
|
+ * firstShopType 医疗=1和非医疗=2
|
|
|
+ * secondShopType 医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
|
|
|
+ * mainProduct 主打项目(mainpro)
|
|
|
+ * mainProductDesc 主打商品说明(productDesc)
|
|
|
+ * legalPerson 法人代表
|
|
|
+ * registeredCapital 注册资本
|
|
|
+ * faxNumber 传真号(fax)
|
|
|
+ * companyNature 传真号(nature)
|
|
|
+ * turnover 年营业额
|
|
|
+ * medicalPracticeLicenseImg 医疗执业许可证(medicalPracticeLicenseImg1)
|
|
|
+ * shopDesc 公司介绍(info)
|
|
|
+ * businessScope 经营范围
|
|
|
+ * logo 公司LOGO
|
|
|
+ * }
|
|
|
+ * @param operationLicence 生产经营证书(productionLicence)
|
|
|
+ * @param hygienicLicense 卫生许可证
|
|
|
+ * @param taxLicense 税务登记证
|
|
|
+ * @param honorCertification 荣誉证书(certificateHonor)
|
|
|
+ * @param productCertification 产品证书
|
|
|
+ * @return ClubUpdateDto
|
|
|
+ */
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> updateShopUserInfo(ShopUpdateDto shopUpdateDto, String operationLicence, String hygienicLicense, String taxLicense, String honorCertification, String productCertification) {
|
|
|
- ShopPo shop = new ShopPo();
|
|
|
- UserPo user = new UserPo();
|
|
|
+ public ResponseJson<ShopUpdateDto> updateShopUserInfo(ShopUpdateDto shopUpdateDto, String operationLicence, String hygienicLicense, String taxLicense, String honorCertification, String productCertification) {
|
|
|
+ // 参数校验
|
|
|
+ if (null == shopUpdateDto.getUserId() || null == shopUpdateDto.getShopId()) {
|
|
|
+ return ResponseJson.error("参数异常", null);
|
|
|
+ }
|
|
|
if (StringUtils.isNotBlank(shopUpdateDto.getEmail())) {
|
|
|
Integer userIdByEmail = baseMapper.getUserIdByEmail(shopUpdateDto.getEmail());
|
|
|
if (null != userIdByEmail && !userIdByEmail.equals(shopUpdateDto.getUserId())) {
|
|
|
- return ResponseJson.error("该邮箱已被使用");
|
|
|
+ return ResponseJson.error("该邮箱已被使用", null);
|
|
|
}
|
|
|
- shop.setContractEmail1(shopUpdateDto.getEmail());
|
|
|
- shop.setContractEmail2(shopUpdateDto.getEmail());
|
|
|
}
|
|
|
+ /*
|
|
|
+ 组装用户数据 user
|
|
|
+ */
|
|
|
+ UserPo user = new UserPo();
|
|
|
+ user.setUserId(shopUpdateDto.getUserId());
|
|
|
+ user.setName(shopUpdateDto.getName());
|
|
|
user.setUserName(shopUpdateDto.getSName());
|
|
|
- /*loginDao.updateUser(user);
|
|
|
- supplierDao.updateShop(shop);
|
|
|
+ user.setEmail(shopUpdateDto.getEmail());
|
|
|
+ // 更新供应商用户信息
|
|
|
+ shopMapper.updateShopUserByUpdateInfo(user);
|
|
|
+ // 更新供应商信息
|
|
|
+ shopMapper.updateShopByUpdateInfo(shopUpdateDto);
|
|
|
if (StringUtils.isNotBlank(shopUpdateDto.getSocialCreditCode())) {
|
|
|
- supplierDao.deleteShopCert(shopUpdateDto.getShopID());
|
|
|
+ // 清除数据库证书数据
|
|
|
+ shopMapper.deleteShopCertByShopId(shopUpdateDto.getShopId());
|
|
|
ShopCertVo shopCert = new ShopCertVo();
|
|
|
- shopCert.setShopID(shopUpdateDto.getShopID());
|
|
|
- shopCert.setShopCertTypeID(2);
|
|
|
- shopCert.setImage(shopUpdateDto.getProductionLicence());
|
|
|
+ shopCert.setShopId(shopUpdateDto.getShopId());
|
|
|
+ shopCert.setShopCertTypeId(2);
|
|
|
+ shopCert.setImage(operationLicence);
|
|
|
shopCert.setName("生产经营证书");
|
|
|
- supplierDao.insertShopCert(shopCert);
|
|
|
- shopCert.setShopCertTypeID(5);
|
|
|
- shopCert.setImage(shopUpdateDto.getHygienicLicense());
|
|
|
+ // 保存生产经营证书
|
|
|
+ shopMapper.insertShopCert(shopCert);
|
|
|
+ shopCert.setShopCertTypeId(5);
|
|
|
+ shopCert.setImage(hygienicLicense);
|
|
|
shopCert.setName("卫生许可证");
|
|
|
- supplierDao.insertShopCert(shopCert);
|
|
|
- shopCert.setShopCertTypeID(6);
|
|
|
- shopCert.setImage(shopUpdateDto.getTaxLicense());
|
|
|
+ // 保存卫生许可证
|
|
|
+ shopMapper.insertShopCert(shopCert);
|
|
|
+ shopCert.setShopCertTypeId(6);
|
|
|
+ shopCert.setImage(taxLicense);
|
|
|
shopCert.setName("税务登记证");
|
|
|
- supplierDao.insertShopCert(shopCert);
|
|
|
- if (StringUtils.isNotBlank(shopUpdateDto.getCertificateHonor())) {
|
|
|
- String[] images = shopUpdateDto.getCertificateHonor().split(",");
|
|
|
+ // 保存税务登记证
|
|
|
+ shopMapper.insertShopCert(shopCert);
|
|
|
+ if (StringUtils.isNotBlank(honorCertification)) {
|
|
|
+ String[] images = honorCertification.split(",");
|
|
|
for (String image : images) {
|
|
|
if (StringUtils.isNotBlank(image)) {
|
|
|
- shopCert.setShopCertTypeID(1);
|
|
|
+ shopCert.setShopCertTypeId(1);
|
|
|
shopCert.setImage(image);
|
|
|
shopCert.setName("荣誉证书");
|
|
|
- supplierDao.insertShopCert(shopCert);
|
|
|
+ // 保存荣誉证书
|
|
|
+ shopMapper.insertShopCert(shopCert);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(shopUpdateDto.getProductCertification())) {
|
|
|
- String[] images = shopUpdateDto.getProductCertification().split(",");
|
|
|
+ if (StringUtils.isNotBlank(productCertification)) {
|
|
|
+ String[] images = productCertification.split(",");
|
|
|
for (String image : images) {
|
|
|
if (StringUtils.isNotBlank(image)) {
|
|
|
- shopCert.setShopCertTypeID(3);
|
|
|
+ shopCert.setShopCertTypeId(3);
|
|
|
shopCert.setImage(image);
|
|
|
shopCert.setName("产品证书");
|
|
|
- supplierDao.insertShopCert(shopCert);
|
|
|
+ // 保存产品证书
|
|
|
+ shopMapper.insertShopCert(shopCert);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return model.success();*/
|
|
|
- return null;
|
|
|
+ return ResponseJson.success("修改供应商资料成功", shopUpdateDto);
|
|
|
}
|
|
|
}
|