|
|
@@ -19,7 +19,9 @@ import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 店铺申请外观实现类
|
|
|
@@ -103,7 +105,7 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
// 保存审核时的审核人信息和是否通过状态
|
|
|
- storeApply.setAuthPerson(user.getUserName());
|
|
|
+ storeApply.setFinalPerson(user.getUserName());
|
|
|
storeApply.setAuthTime(date);
|
|
|
storeApply.setStatus(status);
|
|
|
// 保存审核时的企业信息
|
|
|
@@ -123,6 +125,66 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
|
|
|
return ResultMap.success(null);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ResultMap checkApply(String uuid, StoreApply apply) {
|
|
|
+ // 通过uuid找到店铺申请信息
|
|
|
+ User user = SystemSession.getUser();
|
|
|
+ if (user == null || user.getEnterprise() == null) {
|
|
|
+ return new ResultMap(CodeType.NOT_PERMIT, "请进行用户登录操作");
|
|
|
+ }
|
|
|
+ // 验证参数合法性
|
|
|
+ if (StringUtils.isEmpty(uuid) || StringUtils.isEmpty(apply)) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "店铺申请UUID或申请信息不存在");
|
|
|
+ }
|
|
|
+ StoreApply storeApply = storeApplyService.findByUuid(uuid);
|
|
|
+ if (StringUtils.isEmpty(apply.getEnType())) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "公司资质类型不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(apply.getEnQualification())) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "公司资质信息不能为空");
|
|
|
+ }
|
|
|
+ if (StoreType.AGENCY == apply.getType() || StoreType.ORIGINAL_FACTORY == apply.getType()) {
|
|
|
+ if (CollectionUtils.isEmpty(apply.getBrands())) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "品牌审核信息不能为空");
|
|
|
+ }
|
|
|
+ for (StoreBrandInfo brandInfo : apply.getBrands()) {
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("registrant", brandInfo.getRegistrant());
|
|
|
+ map.put("number", brandInfo.getNumber());
|
|
|
+ map.put("registrationDate", brandInfo.getRegistrationDate());
|
|
|
+ map.put("address", brandInfo.getAddress());
|
|
|
+ map.put("effectiveDate", brandInfo.getEffectiveDate());
|
|
|
+ map.put("approvalUnit", brandInfo.getApprovalUnit());
|
|
|
+ if (checkIsNull(map)) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "品牌信息不能为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Date date = new Date();
|
|
|
+ storeApply.setReason(null);
|
|
|
+ storeApply.setAuthPerson(user.getUserName());
|
|
|
+ storeApply.setAuthTime(date);
|
|
|
+ storeApply.setStatus(StoreApply.ApplyStatus.CHECK);
|
|
|
+ // 保存审核时的企业信息
|
|
|
+ storeApply.setEnType(apply.getEnType());
|
|
|
+ storeApply.setEnQualification(apply.getEnQualification());
|
|
|
+ storeApply.setBrands(apply.getBrands());
|
|
|
+ storeApply.setBannerUrl("http://dfs.ubtob.com/group1/M00/19/BF/CgpkyFlSBRmAcascAANK5vkByag940.jpg");
|
|
|
+ storeApply.setLogoUrl("https://mall.usoftchina.com/static/img/store/common/default.png");
|
|
|
+ StoreApply savedApply = storeApplyService.handlerApply(storeApply);
|
|
|
+ return ResultMap.success(savedApply.getUuid());
|
|
|
+ }
|
|
|
+
|
|
|
+ private Boolean checkIsNull(Map<String, Object> map) {
|
|
|
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
|
|
|
+ if (entry.getValue() == null || "".equals(entry.getValue())) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public ResultMap confirmOpenStore(String uuid, StoreApply storeApply) {
|
|
|
Date date = new Date();
|