提交 4d9aca55 authored 作者: 窦馨雨's avatar 窦馨雨

合并分支 'dxy' 到 'qa'

改造CP稽查功能 查看合并请求 !53
...@@ -275,6 +275,10 @@ ...@@ -275,6 +275,10 @@
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.11.4</version> <!-- 与SpringBoot版本兼容的版本 --> <version>2.11.4</version> <!-- 与SpringBoot版本兼容的版本 -->
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.wangxiaolu.promotion.controller.activity.examine; package com.wangxiaolu.promotion.controller.activity.examine;
import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto; import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto;
import com.wangxiaolu.promotion.pojo.activity.examine.vo.ExaPlanVo;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.vo.InspectionInfoVO;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.activity.examine.ExaPlanCoreService; import com.wangxiaolu.promotion.service.activity.examine.ExaPlanCoreService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -25,19 +28,33 @@ public class ExaPlanCoreController { ...@@ -25,19 +28,33 @@ public class ExaPlanCoreController {
@Autowired @Autowired
private ExaPlanCoreService exaPlanCoreService; private ExaPlanCoreService exaPlanCoreService;
// @PostMapping("/save")
// public R saveOne(@RequestBody ExaPlanVo exaPlanVo) {
// ActivityExamineDto examineDto = new ActivityExamineDto();
// BeanUtils.copyProperties(exaPlanVo, examineDto);
// ActivityExamineDto examineN = null;
// if (Objects.isNull(exaPlanVo.getId())) {
// examineDto.setCreateBy(exaPlanVo.getEmployeeName());
// examineN = saveOne(examineDto);
// } else {
// examineDto.setModifyBy(exaPlanVo.getEmployeeName());
// examineN = updateById(examineDto);
// }
// return R.success(examineN);
// }
@PostMapping("/save") @PostMapping("/save")
public R saveOne(@RequestBody ExaPlanVo exaPlanVo) { public R saveOne(@RequestBody InspectionInfoVO inspectionInfoVO) {
ActivityExamineDto examineDto = new ActivityExamineDto(); InspectionInfoDto inspectionInfoDto = new InspectionInfoDto();
BeanUtils.copyProperties(exaPlanVo, examineDto); BeanUtils.copyProperties(inspectionInfoVO, inspectionInfoDto);
ActivityExamineDto examineN = null; InspectionInfoDto inspection = null;
if (Objects.isNull(exaPlanVo.getId())) { if (Objects.isNull(inspectionInfoVO.getId())) {
examineDto.setCreateBy(exaPlanVo.getEmployeeName()); inspection = exaPlanCoreService.saveV2(inspectionInfoDto);
examineN = saveOne(examineDto);
} else { } else {
examineDto.setModifyBy(exaPlanVo.getEmployeeName()); inspection = exaPlanCoreService.updateByIdV2(inspectionInfoDto);
examineN = updateById(examineDto);
} }
return R.success(examineN); return R.success(inspection);
} }
private ActivityExamineDto saveOne(ActivityExamineDto examineDto) { private ActivityExamineDto saveOne(ActivityExamineDto examineDto) {
......
...@@ -3,7 +3,7 @@ package com.wangxiaolu.promotion.domain.examine.mapper; ...@@ -3,7 +3,7 @@ package com.wangxiaolu.promotion.domain.examine.mapper;
import com.wangxiaolu.promotion.domain.examine.mapper.entity.ActivityExamineDO; import com.wangxiaolu.promotion.domain.examine.mapper.entity.ActivityExamineDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/** /**
* @author a02200059 * @author a02200059
......
package com.wangxiaolu.promotion.domain.inspection.dao;
import com.wangxiaolu.promotion.domain.inspection.wrapper.InspectionInfoWrapper;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
/**
* @author DouXinYu
* @description 针对表【inspection_info(稽查信息表)】的数据库操作Service
* @createDate 2026-01-08 17:03:39
*/
public interface InspectionInfoDao {
InspectionInfoDto selectById(Long id);
InspectionInfoDto selectByPlanId(Long planId);
InspectionInfoDto save(InspectionInfoDto inspectionInfoDto);
InspectionInfoDto updateById(InspectionInfoDto inspectionInfoDto);
void page(PageInfo pageInfo, InspectionInfoWrapper wrapper);
}
\ No newline at end of file
package com.wangxiaolu.promotion.domain.inspection.dao.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wangxiaolu.promotion.common.util.BeanUtils;
import com.wangxiaolu.promotion.domain.inspection.dao.InspectionInfoDao;
import com.wangxiaolu.promotion.domain.inspection.mapper.InspectionInfoMapper;
import com.wangxiaolu.promotion.domain.inspection.mapper.entity.InspectionInfoDO;
import com.wangxiaolu.promotion.domain.inspection.wrapper.InspectionInfoWrapper;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.Objects;
/**
* @author DouXinYu
* @description 针对表【inspection_info(稽查信息表)】的数据库操作Service实现
* @createDate 2026-01-08 17:03:39
*/
@Service
public class InspectionInfoDaoImpl implements InspectionInfoDao {
@Autowired
private InspectionInfoMapper inspectionInfoMapper;
/**
* 根据ID查询稽查信息
* @param id 稽核ID
* @return 稽查信息DTO
*/
@Override
public InspectionInfoDto selectById(Long id) {
InspectionInfoDO inspectionInfoDO = inspectionInfoMapper.selectById(id);
return convertDoToDto(inspectionInfoDO);
}
/**
* 根据计划ID查询稽查信息
* @param planId 门店对应的计划ID
* @return 稽查信息DTO
*/
@Override
public InspectionInfoDto selectByPlanId(Long planId) {
InspectionInfoDO inspectionInfoDO = inspectionInfoMapper.selectByPlanId(planId);
return convertDoToDto(inspectionInfoDO);
}
/**
* 保存稽查信息
* @param inspectionDto 稽查信息DTO
* @return 保存后的稽查信息DTO
*/
@Override
public InspectionInfoDto save(InspectionInfoDto inspectionDto) {
try {
InspectionInfoDO inspectionDO = new InspectionInfoDO();
// 拷贝基础属性
BeanUtils.copyProperties(inspectionDto, inspectionDO);
// 处理JSON数组类型字段(照片链接)
convertArrayToString(inspectionDO, inspectionDto);
// 插入数据库
inspectionInfoMapper.insert(inspectionDO);
// 查询插入后的完整数据并返回
InspectionInfoDO savedDO = inspectionInfoMapper.selectById(inspectionDO.getId());
return convertDoToDto(savedDO);
} catch (Exception e) {
String eMsg = e.getCause() != null ? e.getCause().getMessage() : "";
// 处理plan_id唯一键冲突(对应数据库plan_id_unique索引)
if (eMsg.contains("for key 'plan_id_unique'")) {
throw new ParamException(RCode.DATA_HAVE_ERROR);
}
return null;
}
}
/**
* 根据ID更新稽查信息
* @param inspectionDto 稽查信息DTO
* @return 更新后的稽查信息DTO
*/
@Override
public InspectionInfoDto updateById(InspectionInfoDto inspectionDto) {
InspectionInfoDO inspectionDO = new InspectionInfoDO();
// 拷贝基础属性
BeanUtils.copyProperties(inspectionDto, inspectionDO);
// 处理JSON数组类型字段(照片链接)
convertArrayToString(inspectionDO, inspectionDto);
// 更新数据库
inspectionInfoMapper.updateById(inspectionDO);
// 查询更新后的完整数据并返回
InspectionInfoDO updatedDO = inspectionInfoMapper.selectById(inspectionDO.getId());
return convertDoToDto(updatedDO);
}
/**
* 分页查询稽查信息
* @param pageInfo 分页参数
* @param wrapper 查询条件封装
*/
@Override
public void page(PageInfo pageInfo, InspectionInfoWrapper wrapper) {
LambdaQueryWrapper<InspectionInfoDO> queryWrapper = buildQueryWrapper(wrapper);
// 构建MyBatis-Plus分页对象
Page<InspectionInfoDO> page = new Page<>(pageInfo.getPageNum(), pageInfo.getPageSize());
// 执行分页查询
Page<InspectionInfoDO> doPage = inspectionInfoMapper.selectPage(page, queryWrapper);
// 转换分页结果
pageInfo.pageCovert(doPage);
pageInfo.setRecords(doPage.getRecords());
}
/**
* 构建查询条件
* @param wrapper 查询条件封装类
* @return LambdaQueryWrapper
*/
private LambdaQueryWrapper<InspectionInfoDO> buildQueryWrapper(InspectionInfoWrapper wrapper) {
LambdaQueryWrapper<InspectionInfoDO> queryWrapper = new LambdaQueryWrapper<>();
// 根据经销商ID查询
if (Objects.nonNull(wrapper.getDealerId())) {
queryWrapper.eq(InspectionInfoDO::getDealerId, wrapper.getDealerId());
}
// 根据门店编码查询
if (Objects.nonNull(wrapper.getStoreCode())) {
queryWrapper.eq(InspectionInfoDO::getStoreCode, wrapper.getStoreCode());
}
// 根据计划ID查询
if (Objects.nonNull(wrapper.getPlanId())) {
queryWrapper.eq(InspectionInfoDO::getPlanId, wrapper.getPlanId());
}
// 根据ID查询
if (Objects.nonNull(wrapper.getId())){
queryWrapper.eq(InspectionInfoDO::getId, wrapper.getId());
}
// 根据门店名称模糊查询
if (!StringUtils.isEmpty(wrapper.getStoreName())){
queryWrapper.like(InspectionInfoDO::getStoreName,wrapper.getStoreName());
}
return queryWrapper;
}
/**
* 将DO转换为DTO(处理JSON字段)
* @param inspectionInfoDO 数据库实体
* @return 前端展示DTO
*/
private InspectionInfoDto convertDoToDto(InspectionInfoDO inspectionInfoDO) {
if (Objects.isNull(inspectionInfoDO)) {
return null;
}
// 基础属性转换
InspectionInfoDto dto = BeanUtils.transitionDto(inspectionInfoDO, InspectionInfoDto.class);
// 处理JSON数组类型的照片字段(促销员在岗/离岗佐证照)
dto.setTemWorkPhotos(Objects.isNull(inspectionInfoDO.getTemWorkPhotos())
? null : JSONArray.parseArray(inspectionInfoDO.getTemWorkPhotos()));
return dto;
}
/**
* 将DTO中的JSON数组转换为字符串(存入数据库)
* @param inspectionDO 数据库实体
* @param inspectionDto 前端传输DTO
*/
private void convertArrayToString(InspectionInfoDO inspectionDO, InspectionInfoDto inspectionDto) {
// 处理促销员在岗/离岗佐证照(JSONArray -> String)
inspectionDO.setTemWorkPhotos(Objects.isNull(inspectionDto.getTemWorkPhotos())
? null : JSONObject.toJSONString(inspectionDto.getTemWorkPhotos()));
}
}
package com.wangxiaolu.promotion.domain.inspection.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wangxiaolu.promotion.domain.inspection.mapper.entity.InspectionInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
* @author DouXinYu
* @description 针对表【inspection_info(稽查信息表)】的数据库操作Mapper
* @createDate 2026-01-08 17:03:39
*/
@Mapper
public interface InspectionInfoMapper extends BaseMapper<InspectionInfoDO> {
@Select("select * from inspection_info where plan_id = #{planId}")
InspectionInfoDO selectByPlanId(Long planId);
}
package com.wangxiaolu.promotion.domain.inspection.wrapper;
import lombok.Data;
/**
* @Author: DouXinYu
* @Date: 2026-01-08 17:17
* @Description:
*/
@Data
public class InspectionInfoWrapper {
/**
* 当前稽核ID
*/
Long id;
/**
* 当前门店对应的计划
*/
Long planId;
/**
* 经销商代码
*/
private String dealerId;
/**
* 经销商名称
*/
private String dealerName;
/**
* 门店编码
*/
private String storeCode;
/**
* 门店名称
*/
private String storeName;
}
package com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto;
import com.alibaba.fastjson2.JSONArray;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author: DouXinYu
* @Date: 2026-01-08 17:12
* @Description: 稽核信息表V2.0 数据模型
*/
@Data
public class InspectionInfoDto {
/**
* 当前稽核ID
*/
private Long id;
/**
* 当前门店对应的计划
*/
private Long planId;
/**
* 所属战区名称
*/
private String depQcOrgName;
/**
* 经销商代码
*/
private String dealerId;
/**
* 经销商名称
*/
private String dealerName;
/**
* 门店编码
*/
private String storeCode;
/**
* 门店名称
*/
private String storeName;
/**
* 门店地址
*/
private String addr;
/**
* 当前稽查的活动形式
*/
private String pattern;
/**
* 稽查店铺的日期
*/
private Date inspectionDate;
/**
* 开始稽查的具体时间
*/
private String inspectionTime;
/**
* 结束稽查离开店铺的时间
*/
private String leaveStoreTime;
/**
* 促销员是否在岗的状态(是/否)
*/
private String onDutyStatus;
/**
* 促销员的在岗率(百分比)
*/
private BigDecimal onDutyRate;
/**
* 实际在岗的促销人员数量
*/
private Integer onDutyCount;
/**
* 促销员当前是否在岗(是/否)
*/
private String isOnDuty;
/**
* 促销员未在岗时电话拨出的时间
*/
private String offDutyCallTime;
/**
* 电话是否接通(是/否)
*/
private String isCallConnected;
/**
* 5分钟后再次拨打电话是否接通(是/否)
*/
private String isReconnectedAfter5min;
/**
* 10分钟内是否返回岗位(是/否)
*/
private String isBackToWorkWithin10min;
/**
* 本次稽查的总得分
*/
private Integer totalScore;
/**
* 销售相关考核得分(满分50分)
*/
private Integer salesAssessmentScore;
/**
* 促销相关考核得分(满分50分)
*/
private Integer promotionAssessmentScore;
/**
* 是否有档期或特价活动得分(满分20分)
*/
private Integer hasSchedulePromotionScore;
/**
* 地堆上是否陈列主推产品得分(满分8分)
*/
private Integer groundStackHasMainProductScore;
/**
* 地堆上是否只陈列王小卤产品得分(满分8分)
*/
private Integer groundStackOnlyWangxiaoluScore;
/**
* 地堆铺货是否饱满得分(满分4分)
*/
private Integer groundStackStockFullScore;
/**
* 是否配备各类宣传物料得分(满分10分)
*/
private Integer hasPromotionMaterialsScore;
/**
* 是否穿着王小卤品牌围裙得分(满分3分)
*/
private Integer wearsWangxiaoluApronScore;
/**
* 是否准备试吃品得分(满分5分)
*/
private Integer hasTastingProductScore;
/**
* 是否设置试吃台得分(满分3分)
*/
private Integer hasTastingTableScore;
/**
* 是否准备试吃盘得分(满分3分)
*/
private Integer hasTastingPlateScore;
/**
* 是否准备试吃杯得分(满分3分)
*/
private Integer hasTastingCupScore;
/**
* 是否佩戴口罩和手套得分(满分3分)
*/
private Integer wearsMaskGlovesScore;
/**
* 是否提供牙签加分(满分2分)
*/
private Integer hasToothpickBonusScore;
/**
* 是否配备垃圾桶加分(满分2分)
*/
private Integer hasGarbageCanBonusScore;
/**
* 是否知晓远距离招揽话术得分(满分5分)
*/
private Integer knowsDistanceSolicitSkillScore;
/**
* 是否知晓黑鸭或卤香产品卖点得分(满分5分)
*/
private Integer knowsProductSellingPointsScore;
/**
* 人流经过时是否主动迎接得分(满分5分)
*/
private Integer greetsCustomersActivelyScore;
/**
* 是否讲解产品卖点推荐产品得分(满分3分)
*/
private Integer introducesProductScoresScore;
/**
* 是否有促进销售的动作得分(满分2分)
*/
private Integer promotesSalesActivelyScore;
/**
* 是否配置活动赠品得分(满分5分)
*/
private Integer hasPromotionGiftsScore;
/**
* 是否主动销售非王小卤产品得分(满分5分)
*/
private Integer sellsNonWangxiaoluProductsScore;
/**
* 促销活动的具体内容描述
*/
private String promotionActivityContent;
/**
* 是否设置了地堆陈列(是/否)
*/
private String hasGroundStack;
/**
* 是否有黑鸭产品陈列(是/否)
*/
private String hasBlackDuckDisplay;
/**
* 是否有黑鸭产品试吃品(是/否)
*/
private String hasBlackDuckTasting;
/**
* 其他品牌是否设置了试吃台(是/否)
*/
private String otherBrandHasTastingTable;
/**
* 10分钟内经过促销人员的人流数量
*/
private BigDecimal pedestrianCountWithin10min;
/**
* 试吃品的总数量
*/
private BigDecimal totalTastingProductCount;
/**
* 按口味统计的试吃品数量
*/
private String tastingProductCountByFlavor;
/**
* 其他品牌试吃台的佐证照片链接
*/
private String otherBrandTastingTableProofUrl;
/**
* 销售非王小卤产品的佐证照片链接
*/
private String nonWangxiaoluSalesProofUrl;
/**
* 门头照
*/
private String storePicture;
/**
* 促销员在岗/离岗佐证照
*/
private JSONArray temWorkPhotos;
/**
* 特殊陈列照片
*/
private String storeTcPhoto;
/**
* 主货架照片
*/
private String storeZhiPhoto;
}
package com.wangxiaolu.promotion.pojo.activity.inspectionInfo.vo;
import com.alibaba.fastjson2.JSONArray;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author: DouXinYu
* @Date: 2026-01-08 17:14
* @Description: 稽核信息 V2.0 临时接收信息表
*/
@Data
public class InspectionInfoVO {
/**
* 当前稽核ID
*/
private Long id;
/**
* 当前门店对应的计划
*/
private Long planId;
/**
* 稽查店铺的日期
*/
private Date inspectionDate;
/**
* 开始稽查的具体时间
*/
private String inspectionTime;
/**
* 结束稽查离开店铺的时间
*/
private String leaveStoreTime;
/**
* 促销员是否在岗的状态(是/否)
*/
private String onDutyStatus;
/**
* 促销员的在岗率(百分比)
*/
private BigDecimal onDutyRate;
/**
* 实际在岗的促销人员数量
*/
private Integer onDutyCount;
/**
* 促销员当前是否在岗(是/否)
*/
private String isOnDuty;
/**
* 促销员未在岗时电话拨出的时间
*/
private String offDutyCallTime;
/**
* 电话是否接通(是/否)
*/
private String isCallConnected;
/**
* 5分钟后再次拨打电话是否接通(是/否)
*/
private String isReconnectedAfter5min;
/**
* 10分钟内是否返回岗位(是/否)
*/
private String isBackToWorkWithin10min;
/**
* 本次稽查的总得分
*/
private Integer totalScore;
/**
* 销售相关考核得分(满分50分)
*/
private Integer salesAssessmentScore;
/**
* 促销相关考核得分(满分50分)
*/
private Integer promotionAssessmentScore;
/**
* 是否有档期或特价活动得分(满分20分)
*/
private Integer hasSchedulePromotionScore;
/**
* 地堆上是否陈列主推产品得分(满分8分)
*/
private Integer groundStackHasMainProductScore;
/**
* 地堆上是否只陈列王小卤产品得分(满分8分)
*/
private Integer groundStackOnlyWangxiaoluScore;
/**
* 地堆铺货是否饱满得分(满分4分)
*/
private Integer groundStackStockFullScore;
/**
* 是否配备各类宣传物料得分(满分10分)
*/
private Integer hasPromotionMaterialsScore;
/**
* 是否穿着王小卤品牌围裙得分(满分3分)
*/
private Integer wearsWangxiaoluApronScore;
/**
* 是否准备试吃品得分(满分5分)
*/
private Integer hasTastingProductScore;
/**
* 是否设置试吃台得分(满分3分)
*/
private Integer hasTastingTableScore;
/**
* 是否准备试吃盘得分(满分3分)
*/
private Integer hasTastingPlateScore;
/**
* 是否准备试吃杯得分(满分3分)
*/
private Integer hasTastingCupScore;
/**
* 是否佩戴口罩和手套得分(满分3分)
*/
private Integer wearsMaskGlovesScore;
/**
* 是否提供牙签加分(满分2分)
*/
private Integer hasToothpickBonusScore;
/**
* 是否配备垃圾桶加分(满分2分)
*/
private Integer hasGarbageCanBonusScore;
/**
* 是否知晓远距离招揽话术得分(满分5分)
*/
private Integer knowsDistanceSolicitSkillScore;
/**
* 是否知晓黑鸭或卤香产品卖点得分(满分5分)
*/
private Integer knowsProductSellingPointsScore;
/**
* 人流经过时是否主动迎接得分(满分5分)
*/
private Integer greetsCustomersActivelyScore;
/**
* 是否讲解产品卖点推荐产品得分(满分3分)
*/
private Integer introducesProductScoresScore;
/**
* 是否有促进销售的动作得分(满分2分)
*/
private Integer promotesSalesActivelyScore;
/**
* 是否配置活动赠品得分(满分5分)
*/
private Integer hasPromotionGiftsScore;
/**
* 是否主动销售非王小卤产品得分(满分5分)
*/
private Integer sellsNonWangxiaoluProductsScore;
/**
* 促销活动的具体内容描述
*/
private String promotionActivityContent;
/**
* 是否设置了地堆陈列(是/否)
*/
private String hasGroundStack;
/**
* 是否有黑鸭产品陈列(是/否)
*/
private String hasBlackDuckDisplay;
/**
* 是否有黑鸭产品试吃品(是/否)
*/
private String hasBlackDuckTasting;
/**
* 其他品牌是否设置了试吃台(是/否)
*/
private String otherBrandHasTastingTable;
/**
* 10分钟内经过促销人员的人流数量
*/
private BigDecimal pedestrianCountWithin10min;
/**
* 试吃品的总数量
*/
private BigDecimal totalTastingProductCount;
/**
* 按口味统计的试吃品数量
*/
private String tastingProductCountByFlavor;
/**
* 其他品牌试吃台的佐证照片链接
*/
private String otherBrandTastingTableProofUrl;
/**
* 销售非王小卤产品的佐证照片链接
*/
private String nonWangxiaoluSalesProofUrl;
/**
* 门头照
*/
private String storePicture;
/**
* 促销员在岗/离岗佐证照
*/
private JSONArray temWorkPhotos;
/**
* 特殊陈列照片
*/
private String storeTcPhoto;
/**
* 主货架照片
*/
private String storeZhiPhoto;
}
package com.wangxiaolu.promotion.service.activity.examine; package com.wangxiaolu.promotion.service.activity.examine;
import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto; import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
/** /**
* @author : liqiulin * @author : liqiulin
...@@ -11,4 +12,8 @@ public interface ExaPlanCoreService { ...@@ -11,4 +12,8 @@ public interface ExaPlanCoreService {
ActivityExamineDto save(ActivityExamineDto examineDto); ActivityExamineDto save(ActivityExamineDto examineDto);
ActivityExamineDto updateById(ActivityExamineDto examineDto); ActivityExamineDto updateById(ActivityExamineDto examineDto);
InspectionInfoDto saveV2(InspectionInfoDto inspectionInfoDto);
InspectionInfoDto updateByIdV2(InspectionInfoDto inspectionInfoDto);
} }
...@@ -2,8 +2,10 @@ package com.wangxiaolu.promotion.service.activity.examine.impl; ...@@ -2,8 +2,10 @@ package com.wangxiaolu.promotion.service.activity.examine.impl;
import com.wangxiaolu.promotion.domain.activityplanv2.dao.ActivityPlanInfoDao; import com.wangxiaolu.promotion.domain.activityplanv2.dao.ActivityPlanInfoDao;
import com.wangxiaolu.promotion.domain.examine.dao.ActivityExamineDao; import com.wangxiaolu.promotion.domain.examine.dao.ActivityExamineDao;
import com.wangxiaolu.promotion.domain.inspection.dao.InspectionInfoDao;
import com.wangxiaolu.promotion.exception.ParamException; import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto; import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto; import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode; import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.examine.ExaPlanCoreService; import com.wangxiaolu.promotion.service.activity.examine.ExaPlanCoreService;
...@@ -26,6 +28,9 @@ public class ExaPlanCoreServiceImpl implements ExaPlanCoreService { ...@@ -26,6 +28,9 @@ public class ExaPlanCoreServiceImpl implements ExaPlanCoreService {
@Autowired @Autowired
private ActivityPlanInfoDao activityPlanInfoDao; private ActivityPlanInfoDao activityPlanInfoDao;
@Autowired
private InspectionInfoDao inspectionInfoDao;
@Override @Override
public ActivityExamineDto save(ActivityExamineDto examineDto) { public ActivityExamineDto save(ActivityExamineDto examineDto) {
// 根据促销计划id得到详情并补充 // 根据促销计划id得到详情并补充
...@@ -50,8 +55,31 @@ public class ExaPlanCoreServiceImpl implements ExaPlanCoreService { ...@@ -50,8 +55,31 @@ public class ExaPlanCoreServiceImpl implements ExaPlanCoreService {
return activityExamineDao.save(examineDto); return activityExamineDao.save(examineDto);
} }
@Override
public InspectionInfoDto saveV2(InspectionInfoDto inspectionInfoDto) {
ActivityPlanInfoDto activityPlanInfoDto = activityPlanInfoDao.selectById(inspectionInfoDto.getPlanId());
if (Objects.isNull(activityPlanInfoDto)) {
throw new ParamException(RCode.ACTIVITY_PLAN_IS_NULL);
}
inspectionInfoDto.setDepQcOrgName(activityPlanInfoDto.getOrgName());
inspectionInfoDto.setDealerId(activityPlanInfoDto.getDealerId());
inspectionInfoDto.setDealerName(activityPlanInfoDto.getDealerName());
inspectionInfoDto.setStoreCode(activityPlanInfoDto.getStoreCode());
inspectionInfoDto.setStoreName(activityPlanInfoDto.getStoreName());
inspectionInfoDto.setPattern(activityPlanInfoDto.getPattern());
return inspectionInfoDao.save(inspectionInfoDto);
}
@Override
public InspectionInfoDto updateByIdV2(InspectionInfoDto inspectionInfoDto) {
return inspectionInfoDao.updateById(inspectionInfoDto);
}
@Override @Override
public ActivityExamineDto updateById(ActivityExamineDto examineDto) { public ActivityExamineDto updateById(ActivityExamineDto examineDto) {
return activityExamineDao.updateById(examineDto); return activityExamineDao.updateById(examineDto);
} }
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wangxiaolu.promotion.domain.inspection.mapper.InspectionInfoMapper">
<resultMap id="BaseResultMap" type="com.wangxiaolu.promotion.domain.inspection.mapper.entity.InspectionInfoDO">
<!-- 1. 主键 & 大整数类型(bigint(20)) -->
<id property="id" column="id" jdbcType="BIGINT" />
<result property="planId" column="plan_id" jdbcType="BIGINT" />
<!-- 2. 字符串类型(varchar,不同长度统一映射为VARCHAR) -->
<result property="depQcOrgName" column="dep_qc_org_name" jdbcType="VARCHAR" />
<result property="dealerId" column="dealer_id" jdbcType="VARCHAR" />
<result property="dealerName" column="dealer_name" jdbcType="VARCHAR" />
<result property="storeCode" column="store_code" jdbcType="VARCHAR" />
<result property="storeName" column="store_name" jdbcType="VARCHAR" />
<result property="addr" column="addr" jdbcType="VARCHAR" />
<result property="pattern" column="pattern" jdbcType="VARCHAR" />
<result property="inspectionTime" column="inspection_time" jdbcType="VARCHAR" />
<result property="leaveStoreTime" column="leave_store_time" jdbcType="VARCHAR" />
<result property="onDutyStatus" column="on_duty_status" jdbcType="VARCHAR" />
<result property="isOnDuty" column="is_on_duty" jdbcType="VARCHAR" />
<result property="offDutyCallTime" column="off_duty_call_time" jdbcType="VARCHAR" />
<result property="isCallConnected" column="is_call_connected" jdbcType="VARCHAR" />
<result property="isReconnectedAfter5min" column="is_reconnected_after_5min" jdbcType="VARCHAR" />
<result property="isBackToWorkWithin10min" column="is_back_to_work_within_10min" jdbcType="VARCHAR" />
<result property="promotionActivityContent" column="promotion_activity_content" jdbcType="VARCHAR" />
<result property="hasGroundStack" column="has_ground_stack" jdbcType="VARCHAR" />
<result property="hasBlackDuckDisplay" column="has_black_duck_display" jdbcType="VARCHAR" />
<result property="hasBlackDuckTasting" column="has_black_duck_tasting" jdbcType="VARCHAR" />
<result property="otherBrandHasTastingTable" column="other_brand_has_tasting_table" jdbcType="VARCHAR" />
<result property="tastingProductCountByFlavor" column="tasting_product_count_by_flavor" jdbcType="VARCHAR" />
<result property="otherBrandTastingTableProofUrl" column="other_brand_tasting_table_proof_url" jdbcType="VARCHAR" />
<result property="nonWangxiaoluSalesProofUrl" column="non_wangxiaolu_sales_proof_url" jdbcType="VARCHAR" />
<result property="storePicture" column="store_picture" jdbcType="VARCHAR" />
<result property="storeTcPhoto" column="store_tc_photo" jdbcType="VARCHAR" />
<result property="storeZhiPhoto" column="store_zhi_photo" jdbcType="VARCHAR" />
<!-- 3. 整数类型(int(11)) -->
<result property="onDutyCount" column="on_duty_count" jdbcType="INTEGER" />
<result property="totalScore" column="total_score" jdbcType="INTEGER" />
<result property="salesAssessmentScore" column="sales_assessment_score" jdbcType="INTEGER" />
<result property="promotionAssessmentScore" column="promotion_assessment_score" jdbcType="INTEGER" />
<result property="hasSchedulePromotionScore" column="has_schedule_promotion_score" jdbcType="INTEGER" />
<result property="groundStackHasMainProductScore" column="ground_stack_has_main_product_score" jdbcType="INTEGER" />
<result property="groundStackOnlyWangxiaoluScore" column="ground_stack_only_wangxiaolu_score" jdbcType="INTEGER" />
<result property="groundStackStockFullScore" column="ground_stack_stock_full_score" jdbcType="INTEGER" />
<result property="hasPromotionMaterialsScore" column="has_promotion_materials_score" jdbcType="INTEGER" />
<result property="wearsWangxiaoluApronScore" column="wears_wangxiaolu_apron_score" jdbcType="INTEGER" />
<result property="hasTastingProductScore" column="has_tasting_product_score" jdbcType="INTEGER" />
<result property="hasTastingTableScore" column="has_tasting_table_score" jdbcType="INTEGER" />
<result property="hasTastingPlateScore" column="has_tasting_plate_score" jdbcType="INTEGER" />
<result property="hasTastingCupScore" column="has_tasting_cup_score" jdbcType="INTEGER" />
<result property="wearsMaskGlovesScore" column="wears_mask_gloves_score" jdbcType="INTEGER" />
<result property="hasToothpickBonusScore" column="has_toothpick_bonus_score" jdbcType="INTEGER" />
<result property="hasGarbageCanBonusScore" column="has_garbage_can_bonus_score" jdbcType="INTEGER" />
<result property="knowsDistanceSolicitSkillScore" column="knows_distance_solicit_skill_score" jdbcType="INTEGER" />
<result property="knowsProductSellingPointsScore" column="knows_product_selling_points_score" jdbcType="INTEGER" />
<result property="greetsCustomersActivelyScore" column="greets_customers_actively_score" jdbcType="INTEGER" />
<result property="introducesProductScoresScore" column="introduces_product_scores_score" jdbcType="INTEGER" />
<result property="promotesSalesActivelyScore" column="promotes_sales_actively_score" jdbcType="INTEGER" />
<result property="hasPromotionGiftsScore" column="has_promotion_gifts_score" jdbcType="INTEGER" />
<result property="sellsNonWangxiaoluProductsScore" column="sells_non_wangxiaolu_products_score" jdbcType="INTEGER" />
<!-- 4. 小数类型(decimal,不同精度统一映射为DECIMAL) -->
<result property="onDutyRate" column="on_duty_rate" jdbcType="DECIMAL" />
<result property="pedestrianCountWithin10min" column="pedestrian_count_within_10_min" jdbcType="DECIMAL" />
<result property="totalTastingProductCount" column="total_tasting_product_count" jdbcType="DECIMAL" />
<!-- 5. 日期类型(date) -->
<result property="inspectionDate" column="inspection_date" jdbcType="DATE" />
<!-- 6. JSON类型 -->
<result property="temWorkPhotos" column="tem_work_photos" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
id,plan_id,dep_qc_org_name,dealer_id,dealer_name,store_code,
store_name,addr,pattern,inspection_date,inspection_time,
leave_store_time,on_duty_status,on_duty_rate,on_duty_count,is_on_duty,
off_duty_call_time,is_call_connected,is_reconnected_after_5min,is_back_to_work_within_10min,total_score,
sales_assessment_score,promotion_assessment_score,has_schedule_promotion_score,ground_stack_has_main_product_score,ground_stack_only_wangxiaolu_score,
ground_stack_stock_full_score,has_promotion_materials_score,wears_wangxiaolu_apron_score,has_tasting_product_score,has_tasting_table_score,
has_tasting_plate_score,has_tasting_cup_score,wears_mask_gloves_score,has_toothpick_bonus_score,has_garbage_can_bonus_score,
knows_distance_solicit_skill_score,knows_product_selling_points_score,greets_customers_actively_score,introduces_product_scores_score,promotes_sales_actively_score,
has_promotion_gifts_score,sells_non_wangxiaolu_products_score,promotion_activity_content,has_ground_stack,has_black_duck_display,
has_black_duck_tasting,other_brand_has_tasting_table,pedestrian_count_within_10_min,total_tasting_product_count,tasting_product_count_by_flavor,
other_brand_tasting_table_proof_url,non_wangxiaolu_sales_proof_url,store_picture,tem_work_photos,store_tc_photo,
store_zhi_photo
</sql>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论