Commit 7f34f175 by fudahua

Merge remote-tracking branch 'origin/developer' into developer

parents 9e85ab98 7af6c7a4
......@@ -141,10 +141,8 @@ public class AuditApiServiceImpl implements AuditApiService{
}
int auditType = tab.getAuditType();
tab.setAuditId(auditId);
tab.setAuditStatus(1);
tab.setUpdateTime(new Date());
tab.setAuditName(auditName);
auditMapper.updateByPrimaryKeySelective(tab);
if(auditType == AuditType.STORE_CHANGE.getCode()){
//门店信息变更
String storeId = tab.getCommitStoreId();
......@@ -170,6 +168,8 @@ public class AuditApiServiceImpl implements AuditApiService{
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(),tab.getEnterpriseId());
if(staffClerkRelation != null){
logger.info("code已存在");
tab.setAuditStatus(5);
auditMapper.updateByPrimaryKeySelective(tab);
return "0";
}else{
staffClerkRelation = new StaffClerkRelationDTO();
......@@ -193,6 +193,8 @@ public class AuditApiServiceImpl implements AuditApiService{
boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getStaffName(), obj.getPhoneNumber(), obj.getNationCode(), null);
if(!flag){
//失败
tab.setAuditStatus(5);
auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.fail.getCode(), tab);
return "0";
......@@ -217,6 +219,8 @@ public class AuditApiServiceImpl implements AuditApiService{
}else if(auditType == AuditType.CLERK_UNBIND.getCode()){
//解绑申请,无需审核,直接通过
}
tab.setAuditStatus(1);
auditMapper.updateByPrimaryKeySelective(tab);
return "";
}
@Override
......
......@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
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.haoban.base.api.common.BasePageInfo;
......@@ -25,7 +24,6 @@ import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.enums.AuditType;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
......@@ -141,47 +139,6 @@ public class AuditController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1,pageResult2);
}
//导购绑定,,审核记录,,消息发送
public void sendClerkBind(String clerkId,String clerkCode,int auditStatus,String auditReason){
//TODO huang 发送申请人,我的记录页
ClerkDTO clerk = clerkService.getclerkById(clerkId);
String messageTitle = "门店账号申请";
String messageContent = clerk.getClerkName()+"申请关联导购code("+clerkCode+")";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", clerk.getStoreId());
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MY_RELATED_RECORD.getCode(), data);
staffDepartmentRelatedApiService.sendAuditMessage(clerkId, messageTitle, messageContent, pageUrl, auditStatus, auditReason);
}
//导购新增,,审核记录,,消息发送
public void sendClerkAdd (String clerkId,String clerkCode,int auditStatus,String auditReason){
//TODO huang 发送店长,门店关联记录列表
ClerkDTO clerk = clerkService.getclerkById(clerkId);
String messageTitle = "门店导购变更";
String messageContent ="新增导购:"+ clerk.getClerkName()+"("+clerkCode+")";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", clerk.getStoreId());
String data = jsonObject.toJSONString();
ClerkDTO gicClerk = clerkService.getClerkLeaderByStoreId(clerk.getStoreId());
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.STORE_RELATED_RECORD.getCode(), data);
staffDepartmentRelatedApiService.sendAuditMessage(gicClerk.getClerkId(), messageTitle, messageContent, pageUrl,auditStatus,"");
}
//导购删除,,审核记录,,消息发送
public void sendClerkDel (String clerkId,String clerkCode,int auditStatus,String auditReason){
//TODO huang 发送店长,门店关联记录列表
ClerkDTO clerk = clerkService.getclerkById(clerkId);
String messageTitle = "门店导购变更";
String messageContent ="删除导购:"+ clerk.getClerkName()+"("+clerkCode+")";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", clerk.getStoreId());
String data = jsonObject.toJSONString();
ClerkDTO gicClerk = clerkService.getClerkLeaderByStoreId(clerk.getStoreId());
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.STORE_RELATED_RECORD.getCode(), data);
staffDepartmentRelatedApiService.sendAuditMessage(gicClerk.getClerkId(), messageTitle, messageContent, pageUrl,auditStatus,"");
}
//查单个
@RequestMapping("get-store-record")
public HaobanResponse getStoreRecord(String auditId){
......@@ -263,7 +220,7 @@ public class AuditController extends WebBaseController{
audit.setAuditStatus(1);
}
//发送消息
this.sendClerkBind(clerkId, clerkCode, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendClerkBind(clerkId, clerkCode, auditStatus, auditReason);
}
if(audit.getAuditType() == AuditType.CLERK_ADD.getCode()){
//导购新增
......@@ -272,26 +229,25 @@ public class AuditController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_10010);
}
audit.setAuditStatus(1);
this.sendClerkAdd(clerkId, clerkCode, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendClerkAdd(clerkId, clerkCode, auditStatus, auditReason);
}
if(audit.getAuditType() == AuditType.CLERK_DEL.getCode()){
//导购删除
syncHaobanToGicServiceApi.delGicClerk(clerkId);
audit.setAuditStatus(1);
this.sendClerkDel(clerkId, clerkCode, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendClerkDel(clerkId, clerkCode, auditStatus, auditReason);
}
}else if(auditStatus == 2){
//审核拒绝
audit.setAuditReason(auditReason);
audit.setAuditStatus(2);
if(audit.getAuditType() == AuditType.CLERK_BIND.getCode()){
//发送消息
this.sendClerkBind(clerkId, clerkCode, auditStatus, auditReason);
if(audit.getAuditType() == AuditType.CLERK_BIND.getCode()){
staffDepartmentRelatedApiService.sendClerkBind(clerkId, clerkCode, auditStatus, auditReason);
}else if (audit.getAuditType() == AuditType.CLERK_ADD.getCode()){
this.sendClerkAdd(clerkId, clerkCode, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendClerkAdd(clerkId, clerkCode, auditStatus, auditReason);
}else if (audit.getAuditType() == AuditType.CLERK_DEL.getCode()){
this.sendClerkDel(clerkId, clerkCode, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendClerkDel(clerkId, clerkCode, auditStatus, auditReason);
}
}else if(auditStatus == 3){
......
......@@ -439,7 +439,7 @@ public class ClerkController extends WebBaseController{
//设置主导购
@HttpLimit
@RequestMapping("/set-main-store")
public HaobanResponse setMainStore(String staffId,String storeId,String wxEnterpriseId,String staffDepartmentRelatedId) {
public HaobanResponse setMainStore(String staffId,String storeId,String wxEnterpriseId ) {
StaffDTO staff = staffApiService.selectById(staffId);
String yyyyMM = DateUtil.dateToStr(new Date(), "yyyyMM");
if(staff == null){
......
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