Commit cb2c594e by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !10
parents b3a84565 b996a239
......@@ -34,6 +34,8 @@ public interface Constants {
String PROJECT_ITEM_STOREFIELD_APPLY = "relevanceStorefield";
String PROJECT_ITEM_SAVE_STATUS_TYPE_APPLY = "saveStoreStatusType";
/**
* 待办事项的redis key
*/
......
......@@ -30,12 +30,12 @@ public class WmStoreSyncLogDTO implements Serializable{
/**
*
*/
private String storeId;
private Integer storeId;
/**
* 1:总店 2:门店同步(实体)
*/
private Integer type;
private Integer storeType;
/**
* 门店名称
......@@ -89,21 +89,21 @@ public class WmStoreSyncLogDTO implements Serializable{
return this;
}
public String getStoreId() {
public Integer getStoreId() {
return storeId;
}
public WmStoreSyncLogDTO setStoreId(String storeId) {
public WmStoreSyncLogDTO setStoreId(Integer storeId) {
this.storeId = storeId;
return this;
}
public Integer getType() {
return type;
public Integer getStoreType() {
return storeType;
}
public WmStoreSyncLogDTO setType(Integer type) {
this.type = type;
public WmStoreSyncLogDTO setStoreType(Integer storeType) {
this.storeType = storeType;
return this;
}
......
......@@ -69,4 +69,6 @@ public interface WmStoreSyncLogApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.enterprise.dto.wm.WmStoreSyncLogDTO>>


*/
ServiceResponse<List<WmStoreSyncLogDTO>> listByStoreId(Integer storeId, Integer enterpriseId);
ServiceResponse<List<WmStoreSyncLogDTO>> listByStoreId(List<Integer> storeIdList, Integer wmMallStoreId);
}
......@@ -62,4 +62,6 @@ public interface TabWmStoreSyncLogMapper {
int deleteLogic(@Param("storeId") Integer storeId, @Param("wmMallStoreId") Integer wmMallStoreId);
List<TabWmStoreSyncLog> listByStoreId(@Param("storeId") Integer storeId, @Param("enterpriseId") Integer enterpriseId);
List<TabWmStoreSyncLog> listByStoreIdList(@Param("storeIdList") List<Integer> storeIdList,@Param("wmMallStoreId") Integer wmMallStoreId);
}
\ No newline at end of file
......@@ -19,4 +19,6 @@ public interface WmStoreSyncLogService {
int deleteLogic(Integer storeId, Integer wmMallStoreId);
List<TabWmStoreSyncLog> listByStoreId(Integer storeId, Integer enterpriseId);
List<TabWmStoreSyncLog> listByStoreId(List<Integer> storeIdList, Integer wmMallStoreId);
}
......@@ -32,7 +32,7 @@ public class AuditLogServiceImpl implements AuditLogService {
auditLogDTO.setEnterpriseId(enterpriseId);
auditLogDTO.setApplyUserId(applyUserId);
auditLogDTO.setProjectItemId(projectItemId);
auditLogDTO.setAuditExpireTime(new Date());
// auditLogDTO.setAuditExpireTime(new Date());
return tabAuditLogMapper.getLastWaitAuditByApplyUser(auditLogDTO);
}
......
......@@ -56,4 +56,9 @@ public class WmStoreSyncLogServiceImpl implements WmStoreSyncLogService {
public List<TabWmStoreSyncLog> listByStoreId(Integer storeId, Integer enterpriseId) {
return tabWmStoreSyncLogMapper.listByStoreId(storeId, enterpriseId);
}
@Override
public List<TabWmStoreSyncLog> listByStoreId(List<Integer> storeIdList, Integer wmMallStoreId) {
return tabWmStoreSyncLogMapper.listByStoreIdList(storeIdList, wmMallStoreId);
}
}
......@@ -114,6 +114,12 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
return EnterpriseServiceResponse.success();
}
if (Constants.NORMAL_STATUS.equals(projectItem.getIsPlatform())) {
// todo 如果是平台审批项, 同一个平台审批项 如果24小时内有审核成功的,就拒绝提交
// sendWxMessage();
}
// 判断有没有审核员, 没有审核员就返回错误
ServiceResponse<List<AuditorDTO>> auditorResponse = auditorApiService.listAuditorByProject(auditLogDTO.getProjectItemId(), auditLogDTO.getApplyUserId(), auditLogDTO.getEnterpriseId());
......
......@@ -80,4 +80,13 @@ public class WmStoreSyncLogApiServiceImpl implements WmStoreSyncLogApiService {
}
return ServiceResponse.success(EntityUtil.changeEntityListNew(WmStoreSyncLogDTO.class, list));
}
@Override
public ServiceResponse<List<WmStoreSyncLogDTO>> listByStoreId(List<Integer> storeIdList, Integer wmMallStoreId) {
List<TabWmStoreSyncLog> list = wmStoreSyncLogService.listByStoreId(storeIdList, wmMallStoreId);
if (CollectionUtils.isEmpty(list)) {
return ServiceResponse.success(Collections.emptyList());
}
return ServiceResponse.success(EntityUtil.changeEntityListNew(WmStoreSyncLogDTO.class, list));
}
}
......@@ -14,9 +14,12 @@ import com.gic.enterprise.dto.BillingPayInfoDTO;
import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.OutPayDTO;
import com.gic.enterprise.entity.TabBillingPayInfo;
import com.gic.enterprise.entity.TabBillingRechargeRecord;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.*;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.log.api.dto.SystemSetLogDTO;
import com.gic.log.api.service.LogApiService;
import com.gic.marketing.process.api.service.sms.SmsSendApiService;
import com.gic.thirdparty.api.dto.ScanPayReqDataDTO;
import com.gic.thirdparty.api.service.Pay4WXService;
......@@ -55,6 +58,9 @@ public class WxPayStrategy implements PayStrategy {
private EnterpriseApiService enterpriseApiService;
@Autowired
SmsSendApiService smsSendApiService;
@Autowired
private LogApiService logApiService;
@Override
public ServiceResponse<BillingPayInfoDTO> savePrePayInfo(OutPayDTO outPayDTO) {
......@@ -121,10 +127,16 @@ public class WxPayStrategy implements PayStrategy {
billingRechargeRecordService.updateBySerialNumber(resData.getEnterpriseId(), billingPayInfo.getOrderSerialNumber(), resData.getTotalFeePaid(), resData.getTotalFeePaid(), BillingAuditStatusEnum.PASS.getCode(), resData.getTimeEnd(), resData.getOnlineSerialNumber());
this.pushMessageApiService.pushMessage(resData.getEnterpriseId(), "系统通知", "余额充值", "您的商户成功充值"+resData.getTotalFeePaid()+"元!感谢您的支持和使用!");
sendRechargeSuccessSms(resData, billingPayInfo.getEnterpriseId());
TabBillingRechargeRecord rechargeRecord = billingRechargeRecordService.getRechargeRecordBySerialNumber(billingPayInfo.getOrderSerialNumber());
UserDTO userDTO = userApiService.getUserById(rechargeRecord.getInitiatorUser()).getResult();
createLog("充值", "账户余额", userDTO);
break;
case 2:
// 短信套餐包购买
this.billingOrderService.updateBySerialNumber(billingPayInfo.getOrderSerialNumber(), resData.getTotalFeePaid(), BillingAuditStatusEnum.PASS.getCode(), resData.getTimeEnd());
TabBillingRechargeRecord rechargeRecord2 = billingRechargeRecordService.getRechargeRecordBySerialNumber(billingPayInfo.getOrderSerialNumber());
UserDTO userDTO2 = userApiService.getUserById(rechargeRecord2.getInitiatorUser()).getResult();
createLog("支付", "订单内容", userDTO2);
break;
default:
break;
......@@ -198,4 +210,39 @@ public class WxPayStrategy implements PayStrategy {
}
}
public void createLog(String content, String operationObject, UserDTO userDTO) {
doLog(content, operationObject, userDTO);
}
private void doLog(String content, String operationObject, UserDTO userDTO) {
final SystemSetLogDTO logDTO = new SystemSetLogDTO();
//操作时间
logDTO.setLogTime(new Date());
logDTO.setCreateTime(new Date());
//操作人
logDTO.setUserId(Long.valueOf(userDTO.getUserId()));
logDTO.setUserName(userDTO.getUserName());
//操作内容
logDTO.setContent(content);
//为了search查询,暂时用这个字段存
logDTO.setInterfaceName(content);
////操作对象
logDTO.setBusinessName(operationObject);
//操作模块
// String moduleMenuName = (String) RequestContext.getContext().getRequest().getAttribute("moduleMenuName");
// Integer moduleMenuId = (Integer) RequestContext.getContext().getRequest().getAttribute("moduleMenuId");
// if (moduleMenuId != null) {
logDTO.setRelationId(45000L);
logDTO.setProject("企业-计费中心");
// }
//账号(手机号)
logDTO.setRemark1(userDTO.getPhoneAreaCode());
logDTO.setRemark2(userDTO.getPhoneNumber());
logDTO.setEnterpriseId(userDTO.getEnterpriseId().longValue());
EnterpriseDTO enterpriseDTO = enterpriseApiService.getEnterpriseById(userDTO.getEnterpriseId()).getResult();
logDTO.setEnterpriseName(enterpriseDTO.getEnterpriseName());
logApiService.saveSystemSetLog(logDTO);
}
}
......@@ -264,7 +264,8 @@
<include refid="Base_Column_List" />
from tab_audit_log
where status = 1
and audit_expire_time &lt; #{auditExpireTime}
and audit_result = 0
-- and audit_expire_time &lt; #{auditExpireTime}
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
......
......@@ -193,4 +193,15 @@
and enterprise_id = #{enterpriseId}
group by wm_mall_store_id
</select>
<select id="listByStoreIdList" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_wm_store_sync_log
where status = 1
and store_id in
<foreach collection="storeIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and wm_mall_store_id = #{wmMallStoreId}
</select>
</mapper>
\ No newline at end of file
......@@ -95,7 +95,7 @@ public class PackageController {
}
ServiceResponse<Integer> response = this.billingOrderApiService.saveSmsOrderBuyNow(orderDTO, itemDTO);
if(response.isSuccess()){
LogUtils.createLog("套餐包购买", qo.getSmsPackageName());
LogUtils.createLog("购买短信套餐包", "短信套餐包");
return RestResponse.success(response.getResult());
}
return EnterpriseRestResponse.failure(response);
......
......@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.dto.wm.WmStoreSyncLogDTO;
import com.gic.enterprise.web.vo.wm.WmBranchVO;
import com.gic.weimob.api.dto.WeimobGuiderSynDTO;
import com.gic.weimob.api.dto.WeimobStoreGicInfoDTO;
......@@ -205,7 +206,7 @@ public class WmStoreSyncController {
wmStoreSyncLogApiService.saveWmStoreSyncLog(Arrays.asList(headStoreId), wmMallStoreId, 1, enterpriseId);
//同步导购
List<Integer> storeIdList = new ArrayList<>();
if (isBranch) {
if (!isBranch) {
storeIdList.add(headStoreId);
}
storeIdList.addAll(getListByStr(storeIds));
......@@ -289,6 +290,40 @@ public class WmStoreSyncController {
}
/**
* 批量重新同步门店
* @param storeInfoIds
* @param wmMallStoreId
* @return
*/
@RequestMapping("/sync-store-to-wm-again")
public RestResponse syncStoreToWmAgain(String storeInfoIds, Integer wmMallStoreId) {
//区分是一对一还是总店
List<StoreDTO> storeList = getStoreList(storeInfoIds, true);
if (CollectionUtils.isNotEmpty(storeList)) {
List<Integer> storeIdList = storeList.stream().map(e -> e.getStoreId()).collect(Collectors.toList());
ServiceResponse<List<WmStoreSyncLogDTO>> wmStoreLogResult = wmStoreSyncLogApiService.listByStoreId(storeIdList, wmMallStoreId);
if (wmStoreLogResult.isSuccess()) {
List<WmStoreSyncLogDTO> wmStoreLogList = wmStoreLogResult.getResult();
List<Integer> headStoreIdList = wmStoreLogList
.stream()
.filter(e -> e.getStoreType().intValue() == 1)
.map(e -> e.getStoreId())
.collect(Collectors.toList());
//同步总店
headStoreIdList.forEach(head -> {
LOGGER.info("批量重新同步门店(总店):{}", JSON.toJSONString(syncHeadStore(wmMallStoreId, head, null, false)));
});
StringBuilder storeIds = new StringBuilder();
wmStoreLogList.stream().filter(e -> e.getStoreType().intValue() == 2)
.map(e -> e.getStoreId())
.forEach(storeId -> storeIds.append(storeId).append(","));
LOGGER.info("批量重新同步门店(一对一):{}", JSON.toJSONString(weimobInitStore(wmMallStoreId, storeIds.toString())));
}
}
return RestResponse.success();
}
/**
* 门店错误日志-不处理
* @Title: deleteStoreClerkErrorLog

* @Description:
......
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