Commit 15087501 by 张富康

Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0

2 parents 6330f6d0 56d07de6
......@@ -54,4 +54,7 @@ public class EffectiveReferralReviewCommonDTO extends EffectiveReferralReview {
@ApiModelProperty(value = "操作人id")
private String updatedById;
@ApiModelProperty(notes = "是否可编辑:0-不可编辑,1-可编辑")
private Integer updateFlag;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class PerformanceConfigApprovePermissionDTO implements Serializable {
......@@ -38,4 +39,7 @@ public class PerformanceConfigApprovePermissionDTO implements Serializable {
@ApiModelProperty(notes = "0:无权限 1:查阅人;2:审批人")
private String approvePermission;
@ApiModelProperty(notes = "审批详情")
private List<PerformanceConfigApproveOperationRecordDTO> performanceConfigApproveOperationRecordList;
}
......@@ -6,6 +6,7 @@ import cn.com.glsx.dj.staff.dto.salaryappealapply.StaffSalaryAppealSummaryDTO;
import cn.com.glsx.dj.staff.service.StaffSalaryAppealApplyRecordService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
......@@ -25,6 +26,9 @@ public class StaffSalaryAppealApplyRecordRemoteImpl implements StaffSalaryAppeal
log.info("createAppeal start, dto:{}", dto);
Boolean result = staffSalaryAppealApplyRecordService.createAppeal(dto);
return RpcResponse.success(result);
}catch (RpcServiceException e) {
log.error(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error(e.getMessage(),e);
return RpcResponse.error(e);
......@@ -95,6 +99,9 @@ public class StaffSalaryAppealApplyRecordRemoteImpl implements StaffSalaryAppeal
log.info("webReply start, dto:{}", dto);
Boolean result = staffSalaryAppealApplyRecordService.webReply(dto);
return RpcResponse.success(result);
} catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error(e.getMessage(),e);
return RpcResponse.error(e);
......
......@@ -19,6 +19,7 @@ import cn.com.glsx.scrm.proxy.enums.ProxyRequestSourceEnum;
import cn.com.glsx.scrm.proxy.model.CommonProxyRequest;
import cn.com.glsx.scrm.proxy.model.ProxyBaseResponse;
import cn.com.glsx.scrm.proxy.remote.CommonProxyRemote;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
......@@ -64,11 +65,12 @@ public class EffectiveReferralReviewMiniProgramService {
//不同业务场景`scene_type` '业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保 状态`status` '状态:0-未提交,1-草稿,2-已提交',全部为已提交时,总的提交状态submitStatus才是已提交。
//注意:要跟服务商户表dj_car_life_service_merchant根据`merchant_id`关联,用于筛选项门店搜索,sal_effective_referral_review作为主表
request.getMerchantIds().addAll(Lists.newArrayList(44211832,44209298,44209902,44209880));
log.info("门店有效引荐数列表MerchantIds:{}", JSON.toJSONString(request.getMerchantIds()));
List<EffectiveReferralReviewCommonDTO> list = effectiveReferralReviewMapper.selectStoreList(request);
if (CollectionUtils.isEmpty(list)) {
return list;
}
//赋值不同业务提交状态
//赋值不同业务提交状态、是否可编辑标识
fillSceneTypeSubmitStatus(list);
return list;
}
......@@ -79,6 +81,9 @@ public class EffectiveReferralReviewMiniProgramService {
* @param list
*/
private void fillSceneTypeSubmitStatus(List<EffectiveReferralReviewCommonDTO> list) {
//查询时间配置
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
list.forEach(item -> {
Example example = new Example(EffectiveReferralReview.class);
example.createCriteria()
......@@ -97,6 +102,19 @@ public class EffectiveReferralReviewMiniProgramService {
if (CollectionUtils.isNotEmpty(singleExtendedWarrantyList)) {
item.setSingleExtendedWarrantySubmitStatus(singleExtendedWarrantyList.get(0).getStatus());
}
//当前时间年月是否比核查时间晚并超过1个月,或者当前时间不在T1时间配置内,则不可编辑
long monthDiff = getMonthDiff(effectiveReferralReviews.get(0).getReviewMonth());
if ((Objects.nonNull(performanceTimeCycleDTO)
&& performanceTimeCycleDTO.getStartDate() != null
&& performanceTimeCycleDTO.getEndDate() != null
&& new Date().after(performanceTimeCycleDTO.getEndDate()))
|| monthDiff > 1) {
item.setUpdateFlag(0);
}
else {
item.setUpdateFlag(1);
}
});
}
......@@ -116,7 +134,7 @@ public class EffectiveReferralReviewMiniProgramService {
//3、封装各业务场景引荐数
List<SceneTypeEffectiveReferralDTO> sceneTypeEffectiveReferrals = getSceneTypeEffectiveReferralDTOS(referralReviewCommonDTOS, otherBrandName);
//4、获取是否可编辑标识
//4、查询时间配置
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
//5、当前时间年月是否比核查时间晚并超过1个月, 则不可编辑
......
......@@ -103,6 +103,9 @@ public class EffectiveReferralReviewService {
//1、查询需要复核的有效引荐数列表
Page<EffectiveReferralReviewCommonDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
List<EffectiveReferralReviewCommonDTO> list = effectiveReferralReviewMapper.selectStoreEffectiveReferralList(pagination.getCondition());
if(CollectionUtils.isEmpty(list)) {
return new RpcPagination<>();
}
//2、查询T1时间配置
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
......
......@@ -27,7 +27,6 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.oreframework.distribute.lock.annotation.GlsxDistributeLockable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
......@@ -38,7 +37,10 @@ import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Slf4j
......@@ -476,10 +478,11 @@ public class StaffMonthSalarySlipService {
StaffMonthBdmCount oldRecord = list.get(0);
oldRecord.setModifyFlag(1);
oldRecord.setShopCount(staffMonthBdmCount.getShopCount());
oldRecord.setRecordingCount(staffMonthBdmCount.getRecordingCount());
oldRecord.setBehaviorCount(Math.abs(staffMonthBdmCount.getRecordingCount() - oldRecord.getShopCount()));
oldRecord.setUpdatedDate(new Date());
oldRecord.setUpdatedBy(staffMonthBdmCount.getUpdatedBy());
return staffMonthBdmCountMapper.updateByPrimaryKeySelective(staffMonthBdmCount);
return staffMonthBdmCountMapper.updateByPrimaryKeySelective(oldRecord);
}
// 新增
......
......@@ -74,8 +74,16 @@ public class PerformanceConfigApproveService {
public PerformanceConfigApprovePermissionDTO getPerformanceConfigApproveDetailAndPermission(PerformanceConfigApproveDTO dto) {
// 1. 获取方案审批详情
PerformanceConfigApprovePermissionDTO performanceConfigApproveDetailAndPermission = performanceConfigApproveMapper.getPerformanceConfigApproveDetailAndPermission(dto);
if (performanceConfigApproveDetailAndPermission == null) {
log.info("获取不到提成方案详情 id: {}", dto.getId());
return null;
}
// 2. 如果手机号码是查询人,则将查询人状态更新为已查看
performanceConfigApproveOperationRecordService.updateReadStatusByMobile(dto.getMobile());
List<PerformanceConfigApproveOperationRecordDTO> recordDTOList = performanceConfigApproveOperationRecordService.listByPerformanceConfigApproveId(dto.getId());
if (recordDTOList != null) {
performanceConfigApproveDetailAndPermission.setPerformanceConfigApproveOperationRecordList(recordDTOList);
}
return performanceConfigApproveDetailAndPermission;
}
......
......@@ -107,8 +107,7 @@
FROM
dj_car_life_performance_config_approve a
LEFT JOIN dj_car_life_performance_approve_config ac
ON a.performance_config_id = ac.performance_config_id
AND ac.approver_mobile = #{mobile}
ON ac.approver_mobile = #{mobile}
AND ac.deleted_flag = 'N'
WHERE
a.deleted_flag = 'N'
......
......@@ -45,7 +45,7 @@
UPDATE dj_car_life_performance_config_approve_operation_record
SET
<if test="status != null">
approve_status = #{status},
status = #{status},
</if>
<if test="approveOpinion != null and approveOpinion != ''">
approve_opinion = #{approveOpinion},
......@@ -65,7 +65,7 @@
<update id="updateReadStatusByMobile" parameterType="string">
UPDATE dj_car_life_performance_config_approve_operation_record
SET
approve_status = 1
status = 1
WHERE
deleted_flag = 'N'
AND approver_mobile = #{mobile}
......
......@@ -58,6 +58,9 @@
<if test="appealType != null">
AND appeal_type = #{appealType}
</if>
<if test="dealStatus != null">
AND deal_status = #{dealStatus}
</if>
<if test="applyStartTime != null and applyStartTime != ''">
AND created_date &gt;= #{applyStartTime}
</if>
......@@ -129,17 +132,13 @@
</foreach>
)
</if>
<if test="sceneTypeList != null and sceneTypeList.size() > 0">
<if test="sceneType != null">
AND EXISTS (
SELECT 1
FROM dj_car_life_staff_info dclsi
WHERE dclsi.phone_number = dj_car_life_staff_salary_appeal_apply_record.staff_phone
AND dclsi.deleted_flag = 'N'
AND (
<foreach collection="sceneTypeList" item="sceneType" separator="OR">
FIND_IN_SET(#{sceneType}, dclsi.staff_scene_label) > 0
</foreach>
)
AND FIND_IN_SET(#{sceneType}, dclsi.staff_scene_label) > 0
)
</if>
ORDER BY created_date DESC
......
......@@ -40,11 +40,11 @@ public class StaffMonthSalaryServiceTest extends BaseServiceTest {
@Test
public void testSendMessage() {
Integer merchantId = env.getProperty("staff.month.salary.send.qw.notice.merchantId", Integer.class, 44202977);
Integer merchantId = 44210895;
// 发送自建应用消息对应(wechat-build-server)配置门店号
Integer sendConfigMerchantId = env.getProperty("staff.month.salary.send.qw.config.merchantId", Integer.class, 442029771);
String agentId = env.getProperty("staff.month.salary.send.qw.notice.agentId", String.class, "1000024");
String userId = qwManager.getUserId(merchantId, "17620387810");
Integer sendConfigMerchantId = 442108951;
String agentId = "1000004";
String userId = qwManager.getUserId(merchantId, "18126301457");
String titleEnv = env.getProperty("staff.month.salary.send.qw.notice.title", String.class, "%s工资条系统数据");
String descriptionEvn = env.getProperty("staff.month.salary.send.qw.notice.description", String.class, "您好!感谢您这一月的辛勤工作,以下是您%s月的系统数据工资条,请查收!如有疑问请联系您的管辖上级处理。");
String urlEvn = env.getProperty("staff.month.salary.send.qw.notice.url", String.class,"http://3.cn");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!