|
@@ -2,6 +2,7 @@ package com.caimei.controller.wechat;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.caimei.annotation.CurrentUser;
|
|
|
+import com.caimei.annotation.Idempotent;
|
|
|
import com.caimei.aop.IpSave;
|
|
|
import com.caimei.model.ResponseJson;
|
|
|
import com.caimei.model.dto.ProductSaveDto;
|
|
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -256,6 +258,100 @@ public class WxAuthApi {
|
|
|
// 机构用户编辑授权
|
|
|
return authService.saveAuth(auth, bannerList, false, 2);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 添加/编辑授权
|
|
|
+ */
|
|
|
+ @ApiOperation("添加/编辑授权")
|
|
|
+ @ApiImplicitParam(name = "params", value = "authId:授权id;authParty:授权机构;provinceId;cityId;" +
|
|
|
+ "townId;address;lngAndLat;mobile;userMobile:对应机构用户手机号;" +
|
|
|
+ "firstClubType:一级分类为医美=1,生美=2,项目公司=3,个人=4,其他=5;" +
|
|
|
+ "secondClubType:医美的二级分类为诊所=1、门诊=2、医院=3,其他=4。生美二级分类,美容院=5,养生馆=6,其他=7;" +
|
|
|
+ "medicalLicenseImage:医疗许可证图;empNum:员工人数;" +
|
|
|
+ "logo;customFlag:是否需要自定义属性:0否,1是;remarks:店铺备注;createBy:创建人id;source:1供应商保存,2机构保存" +
|
|
|
+ "linkMan:运营联系人;linkMobile:运营联系人手机号", required = true)
|
|
|
+ @PostMapping("/save1")
|
|
|
+ @Idempotent(prefix = "idempotent_auth_save", keys = {"#params"}, expire = 5)
|
|
|
+ public ResponseJson saveAuth1( @RequestBody String params) throws ParseException {
|
|
|
+
|
|
|
+ JSONObject paramsMap = JSONObject.parseObject(params);
|
|
|
+ Integer authId = paramsMap.getInteger("authId");
|
|
|
+ Integer authUserId = paramsMap.getInteger("authUserId");
|
|
|
+ Integer createBy = paramsMap.getInteger("createBy");
|
|
|
+ Integer provinceId = paramsMap.getInteger("provinceId");
|
|
|
+ Integer cityId = paramsMap.getInteger("cityId");
|
|
|
+ Integer townId = paramsMap.getInteger("townId");
|
|
|
+ String address = paramsMap.getString("address");
|
|
|
+ String lngAndLat = paramsMap.getString("lngAndLat");
|
|
|
+ String mobile = paramsMap.getString("mobile");
|
|
|
+ String userMobile = paramsMap.getString("userMobile");
|
|
|
+ String linkMan = paramsMap.getString("linkMan");
|
|
|
+ String linkMobile = paramsMap.getString("linkMobile");
|
|
|
+ Integer firstClubType = paramsMap.getInteger("firstClubType");
|
|
|
+ Integer secondClubType = paramsMap.getInteger("secondClubType");
|
|
|
+ String medicalLicenseImage = paramsMap.getString("medicalLicenseImage");
|
|
|
+ Integer empNum = paramsMap.getInteger("empNum");
|
|
|
+ String logo = paramsMap.getString("logo");
|
|
|
+ String authCode = paramsMap.getString("authCode");
|
|
|
+ String authDateStr = paramsMap.getString("authDate");
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd");
|
|
|
+ Date authDate = null;
|
|
|
+ if (StringUtils.isNotEmpty(authDateStr)) {
|
|
|
+ authDate = format.parse(authDateStr);
|
|
|
+ }
|
|
|
+ Integer authImageType = paramsMap.getInteger("authImageType");
|
|
|
+ String authImageLogo = paramsMap.getString("authImageLogo");
|
|
|
+ String authImage = paramsMap.getString("authImage");
|
|
|
+ Integer customFlag = paramsMap.getInteger("customFlag");
|
|
|
+ String remarks = paramsMap.getString("remarks");
|
|
|
+ List<String> bannerList = (List<String>) paramsMap.get("bannerList");
|
|
|
+ String authParty = paramsMap.getString("authParty");
|
|
|
+ Integer source = paramsMap.getInteger("source");
|
|
|
+ String relationId = paramsMap.getString("relationId");
|
|
|
+ String relationName = paramsMap.getString("relationName");
|
|
|
+ if (null == source) {
|
|
|
+ // 默认供应商保存
|
|
|
+ source = 1;
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ 组装授权数据
|
|
|
+ */
|
|
|
+ CmBrandAuthPo auth = new CmBrandAuthPo();
|
|
|
+ auth.setId(authId);
|
|
|
+ auth.setAuthUserId(authUserId);
|
|
|
+ auth.setAuthParty(authParty);
|
|
|
+ auth.setProvinceId(provinceId);
|
|
|
+ auth.setCityId(cityId);
|
|
|
+ auth.setTownId(townId);
|
|
|
+ auth.setAddress(address);
|
|
|
+ auth.setCustomFlag(customFlag);
|
|
|
+ auth.setRemarks(remarks);
|
|
|
+ if (StringUtils.isEmpty(lngAndLat)) {
|
|
|
+ return ResponseJson.error("参数异常,经纬度不能为空");
|
|
|
+ }
|
|
|
+ String[] split = lngAndLat.split(",");
|
|
|
+ auth.setLng(new BigDecimal(split[0]));
|
|
|
+ auth.setLat(new BigDecimal(split[1]));
|
|
|
+ auth.setMobile(mobile);
|
|
|
+ auth.setUserMobile(userMobile);
|
|
|
+ auth.setLinkMan(linkMan);
|
|
|
+ auth.setLinkMobile(linkMobile);
|
|
|
+ auth.setFirstClubType(firstClubType);
|
|
|
+ auth.setSecondClubType(secondClubType);
|
|
|
+ auth.setMedicalLicenseImage(medicalLicenseImage);
|
|
|
+ auth.setEmpNum(empNum);
|
|
|
+ auth.setLogo(logo);
|
|
|
+ auth.setAuthCode(authCode);
|
|
|
+ auth.setAuthDate(authDate);
|
|
|
+ auth.setAuthImageLogo(authImageLogo);
|
|
|
+ auth.setAuthImage(authImage);
|
|
|
+ auth.setAuthImageType(authImageType);
|
|
|
+ auth.setCreateBy(createBy);
|
|
|
+ auth.setCreateSource(2);
|
|
|
+ auth.setRelationId(relationId);
|
|
|
+ auth.setRelationName(relationName);
|
|
|
+
|
|
|
+ return authService.saveAuth(auth, bannerList, false, source);
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation("设备分类下拉框列表")
|
|
|
@ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id")
|