Commit c99c172a by huangZW

111

parent d20891d8
......@@ -47,7 +47,11 @@ public class AuditSettingApiServiceImpl implements AuditSettingApiService{
String wxEnterpriseId) {
TabHaobanAuditSetting tab = auditSettingMapper.findSetting(wxEnterpriseId);
if(tab == null){
return null;
AuditSettingDTO dto = new AuditSettingDTO();
dto.setWxEnterpriseId(wxEnterpriseId);
dto.setAuditFlag(1);
dto.setClerkChangeFlag(0);
return dto;
}
AuditSettingDTO dto = EntityUtil.changeEntity(AuditSettingDTO.class, tab);
return dto;
......
......@@ -35,6 +35,7 @@ import com.gic.haoban.common.utils.GooglePhoneNumberUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.dto.AuditSettingDTO;
import com.gic.haoban.manage.api.dto.ClerkMainStoreRelatedDTO;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
......@@ -44,6 +45,7 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.AuditSettingApiService;
import com.gic.haoban.manage.api.service.BindApiService;
import com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService;
import com.gic.haoban.manage.api.service.DepartmentApiService;
......@@ -98,6 +100,9 @@ public class ClerkController extends WebBaseController{
private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired
private ClerkNewService clerkNewService;
@Autowired
private AuditSettingApiService auditSettingApiService;
//导购列表
@RequestMapping("/clerk-list")
public HaobanResponse clerkList(String storeId,String bindFlag,String departmentId) {
......@@ -288,7 +293,6 @@ public class ClerkController extends WebBaseController{
String nationcode = staffDTO.getNationCode();
String postion = staffDTO.getPostion();
Integer sex = staffDTO.getSex();
staffDTO.setWxEnterpriseId(wxEnterpriseId);
if(StringUtils.isBlank(staffName)) {
return resultResponse(HaoBanErrCode.ERR_10004);
}
......@@ -307,42 +311,34 @@ public class ClerkController extends WebBaseController{
com.gic.enterprise.api.dto.StoreDTO store = storeService.getStoreByIdNoStatus(storeId);
//校验手机是否唯一
if (store == null) {
return resultResponse(HaoBanErrCode.ERR_400001);
return resultResponse(HaoBanErrCode.ERR_10009);
}
ClerkDTO clerk = clerkService.getClerkByCodeNoDel(store.getEnterpriseId(), clerkCode);
logger.info("【新增店员】clerk={}",JSON.toJSONString(clerk));
if(clerk != null){
DepartmentDTO department = departmentApiService.selectByRelatedId(storeId);
if(department == null){
return resultResponse(HaoBanErrCode.ERR_400001);
}
//StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndCode(department.getDepartmentId(), clerkCode);
if(null != clerk && StringUtils.isNotBlank(clerk.getPhoneNumber()) && !"--".equals(clerk.getPhoneNumber())){
return resultResponse(HaoBanErrCode.ERR_10013);
}
return resultResponse(HaoBanErrCode.ERR_10013);
}
if(version == 1){
boolean needAudit = true;
if(needAudit){
AuditSettingDTO dto = auditSettingApiService.findSettingByWxEnterpriseId(wxEnterpriseId);
if(dto.getClerkChangeFlag() == 1){
//需要审核
StaffDTO staff = staffApiService.selectById(staffDTO.getStaffId());
//是否需要审核
AuditDTO audit = new AuditDTO();
audit.setCommitName(clerk.getClerkName());
audit.setCommitName(staffName);
audit.setCommitStaffId(staffDTO.getStaffId());
audit.setCommitStaffImg(staff.getHeadImg());
audit.setCommitStoreId(clerk.getStoreId());
audit.setCommitStoreId(storeId);
audit.setCommitStoreName(store.getStoreName());
audit.setAuditStatus(0);
JSONObject json = new JSONObject();
json.put("clerkCode", clerkCode);
json.put("clerkName", clerk.getClerkName());
json.put("clerkName", staffName);
json.put("headPic", staff.getHeadImg());
json.put("sex", sex);
json.put("postion", postion);
audit.setOldValue(json.toJSONString());
audit.setCommitTime(new Date());
audit.setAuditType(3);
auditApiService.insert(audit);
......@@ -350,14 +346,10 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1);
}
}
// if(clerk != null && StringUtils.isNotBlank(clerk.getPhoneNumber())){
// syncHaobanToGicServiceApi.syncHaobanClerkPhoneNumberToGic(clerk.getClerkId(), phoneNumber);
// }else{
boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(storeId, clerkCode, sex, staffName, phoneNumber, nationcode, postion);
if(!flag){
return resultResponse(HaoBanErrCode.ERR_10010);
}
// }
return resultResponse(HaoBanErrCode.ERR_1);
}
......
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