|
@@ -7,11 +7,8 @@ import com.caimei365.user.mapper.*;
|
|
|
import com.caimei365.user.model.ResponseJson;
|
|
|
import com.caimei365.user.model.dto.ClubUpdateDto;
|
|
|
import com.caimei365.user.model.dto.SuperVipDto;
|
|
|
-import com.caimei365.user.model.po.SuperVipPo;
|
|
|
+import com.caimei365.user.model.po.*;
|
|
|
import com.caimei365.user.model.dto.JsonParamsDto;
|
|
|
-import com.caimei365.user.model.po.ClubRemarksPo;
|
|
|
-import com.caimei365.user.model.po.UserBeansHistoryPo;
|
|
|
-import com.caimei365.user.model.po.UserPo;
|
|
|
import com.caimei365.user.model.vo.*;
|
|
|
import com.caimei365.user.service.ClubService;
|
|
|
import com.caimei365.user.service.SellerService;
|
|
@@ -205,6 +202,12 @@ public class ClubServiceImpl implements ClubService {
|
|
|
}
|
|
|
// 更新机构用户信息
|
|
|
clubMapper.updateClubUserByUpdateInfo(user);
|
|
|
+ //添加操作日志
|
|
|
+ int type = insertOperationalLogs(club);
|
|
|
+
|
|
|
+ if (type == 1) {
|
|
|
+ club.setLastModify(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
+ }
|
|
|
// 更新机构信息
|
|
|
clubMapper.updateClubByUpdateInfo(club);
|
|
|
|
|
@@ -240,6 +243,381 @@ public class ClubServiceImpl implements ClubService {
|
|
|
return ResponseJson.success("修改机构资料成功", club);
|
|
|
}
|
|
|
|
|
|
+ private int insertOperationalLogs(ClubUpdateDto club) {
|
|
|
+ int type = 0;
|
|
|
+ log.info("====开始操作记录====");
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
+ OperationalLogsPo operationalLogsPo = new OperationalLogsPo();
|
|
|
+ ClubVo clubVo = clubMapper.selClubData(club.getClubId());
|
|
|
+ // 判断修改的内容
|
|
|
+ if (club.getClubId() != null) {
|
|
|
+
|
|
|
+ if (clubVo != null) {
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getName())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getName())) {
|
|
|
+ if (!club.getName().equals(clubVo.getName())) {
|
|
|
+ list.add("修改了机构名称");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了机构名称");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getName())) {
|
|
|
+ list.add("新增了机构名称");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getLinkMan())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getLinkMan())) {
|
|
|
+ if (!club.getLinkMan().equals(clubVo.getLinkMan())) {
|
|
|
+ list.add("修改了联系人");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了联系人");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getLinkMan())) {
|
|
|
+ list.add("新增了联系人");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (clubVo.getLinkManIdentity() != null) {
|
|
|
+ if (club.getLinkManIdentity() != null ) {
|
|
|
+ if (club.getLinkManIdentity().equals(clubVo.getLinkManIdentity())) {
|
|
|
+ list.add("修改了联系人身份");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了联系人身份");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (club.getLinkManIdentity() != null ) {
|
|
|
+ list.add("新增了联系人身份");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getContractEmail())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getContractEmail())) {
|
|
|
+ if (!club.getContractEmail().equals(clubVo.getContractEmail())) {
|
|
|
+ list.add("修改了联系邮箱");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了联系邮箱");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getContractEmail())) {
|
|
|
+ list.add("新增了联系邮箱");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getShortName())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getShortName())) {
|
|
|
+ if (!club.getShortName().equals(clubVo.getShortName())) {
|
|
|
+ list.add("修改了机构简称");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了机构简称");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getShortName())) {
|
|
|
+ list.add("新增了机构简称");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (clubVo.getProvinceId() != null || clubVo.getCityId() != null || clubVo.getTownId() != null || StringUtils.isNotBlank(clubVo.getAddress())) {
|
|
|
+ if (club.getProvinceId() != null || club.getCityId() != null || club.getTownId() != null || StringUtils.isNotBlank(club.getAddress())) {
|
|
|
+ if (!club.getProvinceId().equals(clubVo.getProvinceId()) || !club.getCityId().equals(clubVo.getCityId()) || !club.getTownId().equals(clubVo.getTownId()) || !club.getAddress().equals(clubVo.getAddress())) {
|
|
|
+ list.add("修改了详细地址");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了详细地址");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (club.getProvinceId() != null || club.getCityId() != null || club.getTownId() != null || StringUtils.isNotBlank(club.getAddress())) {
|
|
|
+ list.add("新增了详细地址");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+/*
|
|
|
+ if (clubVo.getCityId() != null) {
|
|
|
+ if (club.getCityId() != null) {
|
|
|
+ if (!club.getCityId().equals(clubVo.getCityId())) {
|
|
|
+ list.add("修改了详细地址");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了详细地址");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (club.getCityId() != null) {
|
|
|
+ list.add("新增了详细地址");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (clubVo.getTownId() != null) {
|
|
|
+ if (club.getTownId() != null) {
|
|
|
+ if (!club.getTownId().equals(clubVo.getTownId())) {
|
|
|
+ list.add("修改了详细地址");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了详细地址");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (club.getTownId() != null) {
|
|
|
+ list.add("新增了详细地址");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getAddress())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getAddress())) {
|
|
|
+ if (!club.getAddress().equals(clubVo.getAddress())) {
|
|
|
+ list.add("修改了详细地址");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了详细地址");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getAddress())) {
|
|
|
+ list.add("新增了详细地址");
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getSocialCreditCode())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getSocialCreditCode())) {
|
|
|
+ if (!club.getSocialCreditCode().equals(clubVo.getSocialCreditCode())) {
|
|
|
+ list.add("修改了营业执照编号");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了营业执照编号");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getSocialCreditCode())) {
|
|
|
+ list.add("新增了营业执照编号");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getBusinessLicense())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getBusinessLicense())) {
|
|
|
+ if (!club.getBusinessLicense().equals(clubVo.getBusinessLicense())) {
|
|
|
+ list.add("修改了营业执照");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了营业执照");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getBusinessLicense())) {
|
|
|
+ list.add("新增了营业执照");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getShopPhoto())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getShopPhoto())) {
|
|
|
+ if (!club.getShopPhoto().equals(clubVo.getShopPhoto())) {
|
|
|
+ list.add("修改了门头照");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了门头照");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getShopPhoto())) {
|
|
|
+ list.add("新增了门头照");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (clubVo.getFirstClubType() != null) {
|
|
|
+ if (club.getFirstClubType() != null) {
|
|
|
+ if (!club.getFirstClubType().equals(clubVo.getFirstClubType())) {
|
|
|
+ list.add("修改了机构类型分类");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了机构类型分类");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (club.getFirstClubType() != null) {
|
|
|
+ list.add("新增了机构类型分类");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (clubVo.getSecondClubType() != null) {
|
|
|
+ if (club.getSecondClubType() != null) {
|
|
|
+ if (!club.getSecondClubType().equals(clubVo.getSecondClubType())) {
|
|
|
+ list.add("修改了机构类型二级分类");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了机构类型二级分类");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (club.getSecondClubType() != null) {
|
|
|
+ list.add("新增了机构类型二级分类");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getDepartment())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getDepartment())) {
|
|
|
+ if (!club.getDepartment().equals(clubVo.getDepartment())) {
|
|
|
+ list.add("修改了科室");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了科室");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getDepartment())) {
|
|
|
+ list.add("新增了科室");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getMedicalPracticeLicense())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getMedicalPracticeLicense())) {
|
|
|
+ if (!club.getMedicalPracticeLicense().equals(clubVo.getMedicalPracticeLicense())) {
|
|
|
+ list.add("修改了医美分类必须上传医疗执业许可证");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了医美分类必须上传医疗执业许可证");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getMedicalPracticeLicense())) {
|
|
|
+ list.add("新增了医美分类必须上传医疗执业许可证");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getMainProduct())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getMainProduct())) {
|
|
|
+ if (!club.getMainProduct().equals(clubVo.getMainProduct())) {
|
|
|
+ list.add("修改了主打项目");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了主打项目");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getMainProduct())) {
|
|
|
+ list.add("新增了主打项目");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getFax())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getFax())) {
|
|
|
+ if (!club.getFax().equals(clubVo.getFax())) {
|
|
|
+ list.add("修改了传真");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了传真");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getFax())) {
|
|
|
+ list.add("新增了传真");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getContractPhone())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getContractPhone())) {
|
|
|
+ if (!club.getContractPhone().equals(clubVo.getContractPhone())) {
|
|
|
+ list.add("修改了固定电话");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了固定电话");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getContractPhone())) {
|
|
|
+ list.add("新增了固定电话");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getProfile())) {
|
|
|
+ if (StringUtils.isNotBlank(club.getProfile())) {
|
|
|
+ if (!club.getProfile().equals(clubVo.getProfile())) {
|
|
|
+ list.add("修改了公司简介");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add("删除了公司简介");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(club.getProfile())) {
|
|
|
+ list.add("新增了公司简介");
|
|
|
+ type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ operationalLogsPo.setInstitutionName(club.getName());
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(club.getLinkMan())) {
|
|
|
+ operationalLogsPo.setContact(club.getLinkMan());
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getLinkMan())) {
|
|
|
+ operationalLogsPo.setContact(club.getLinkMan());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ operationalLogsPo.setOperationType("编辑");
|
|
|
+ operationalLogsPo.setActionContent(StringUtils.strip(list.toString(),"[]"));
|
|
|
+
|
|
|
+ // 机构修改 机构联系人 为操作人
|
|
|
+ if (StringUtils.isNotBlank(club.getLinkMan())) {
|
|
|
+ operationalLogsPo.setOperator(club.getLinkMan());
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotBlank(clubVo.getLinkMan())) {
|
|
|
+ operationalLogsPo.setOperator(clubVo.getLinkMan());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 协销帮忙修改 取协销人员
|
|
|
+ if (club.getServiceProviderId() != null) {
|
|
|
+ String spName = clubMapper.selSpName(club.getServiceProviderId());
|
|
|
+ operationalLogsPo.setOperator(spName);
|
|
|
+ }
|
|
|
+ operationalLogsPo.setOperationTime(new Date());
|
|
|
+
|
|
|
+ log.info("operationalLogsPo====="+operationalLogsPo);
|
|
|
+ clubMapper.insertOpLogs(operationalLogsPo);
|
|
|
+ return type;
|
|
|
+ }
|
|
|
+
|
|
|
private void saveUserBeans(UserVo user) {
|
|
|
//机构完善资料,送500采美豆
|
|
|
UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|