Commit c32ea00d by 墨竹

feat:代码优化

parent 06826390
......@@ -5,7 +5,6 @@ import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.ToolUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil;
......@@ -149,15 +148,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
if (clerkDTO != null) {
dto.setClerkType(clerkDTO.getClerkType());
}
Date now = new Date();
dto.setStaffClerkRelationId(ToolUtil.randomUUID());
dto.setStatusFlag(1);
dto.setOpenConcatFlag(1);
dto.setCreateTime(now);
dto.setUpdateTime(now);
int insert = mapper.insert(EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, dto));
String s = insert > 0 ? dto.getStaffClerkRelationId() : null;
if (null != s) {
String staffClerkRelationId = insert(dto);
if (StringUtils.isNotBlank(staffClerkRelationId)) {
String wxEnterpriseId = dto.getWxEnterpriseId();
clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId);
//推入日志
......@@ -175,7 +167,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
hmQrcodeQDTO.setInvokingType(channelCode);
hmQrcodeApiService.add(hmQrcodeQDTO);
}
return s;
return staffClerkRelationId;
}
@Override
......@@ -203,12 +195,14 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override
public String insert(StaffClerkRelationDTO staffClerkRelation) {
Integer manageFlag = staffClerkRelation.getManageFlag();
String uuid = StringUtil.randomUUID();
staffClerkRelation.setStaffClerkRelationId(uuid);
staffClerkRelation.setCreateTime(new Date());
staffClerkRelation.setUpdateTime(new Date());
staffClerkRelation.setStatusFlag(1);
staffClerkRelation.setOpenConcatFlag(1);
staffClerkRelation.setManageFlag(manageFlag == null ? 0 : manageFlag);
TabHaobanStaffClerkRelation relation = EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, staffClerkRelation);
mapper.insert(relation);
return uuid;
......@@ -376,6 +370,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override
public List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId) {
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,mapper.listManageBindByStaffId(staffId));
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, mapper.listManageBindByStaffId(staffId));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment