Commit 7f34f175 by fudahua

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

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