feat:applyType
This commit is contained in:
@@ -70,13 +70,11 @@ public class PreFryRecordsDAO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<PreFryRecordsDO> selectByStoreAndDateStage(String storeCode,
|
public List<PreFryRecordsDO> selectByStoreAndDateStage(String storeCode,
|
||||||
Integer applyType,
|
Integer applyType, String queryDate){
|
||||||
List<Integer> yesterdayStageList,
|
if (StringUtils.isBlank(storeCode)) {
|
||||||
Integer todayStage, String queryDate){
|
|
||||||
if (StringUtils.isBlank(storeCode) || CollectionUtils.isEmpty(yesterdayStageList)) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return preFryRecordsMapper.selectByStoreAndDateStage(storeCode,applyType,yesterdayStageList,todayStage,queryDate);
|
return preFryRecordsMapper.selectByStoreAndDateStage(storeCode,applyType,queryDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DailyFryCountDTO> selectDailyFryCountInCurrentMonth(String storeCode,Long time) {
|
public List<DailyFryCountDTO> selectDailyFryCountInCurrentMonth(String storeCode,Long time) {
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ public interface PreFryRecordsMapper extends Mapper<PreFryRecordsDO> {
|
|||||||
List<PreFryRecordsDO> selectByStoreAndDateStage(
|
List<PreFryRecordsDO> selectByStoreAndDateStage(
|
||||||
@Param("storeCode") String storeCode,
|
@Param("storeCode") String storeCode,
|
||||||
@Param("applyType") Integer applyType,
|
@Param("applyType") Integer applyType,
|
||||||
@Param("yesterdayStageList") List<Integer> yesterdayStageList,
|
|
||||||
@Param("todayStage") Integer todayStage,
|
|
||||||
@Param("queryDate") String queryDate);
|
@Param("queryDate") String queryDate);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,18 +55,9 @@
|
|||||||
|
|
||||||
<select id="selectByStoreAndDateStage" resultMap="BaseResultMap">
|
<select id="selectByStoreAndDateStage" resultMap="BaseResultMap">
|
||||||
SELECT * FROM xfsg_pre_fry_records
|
SELECT * FROM xfsg_pre_fry_records
|
||||||
WHERE store_code = #{storeCode}
|
WHERE store_code = #{storeCode} and current_apply_type = #{applyType}
|
||||||
AND (
|
AND ( (fry_date = DATE_SUB(#{queryDate}, INTERVAL 1 DAY) AND current_stage IN (3,4,5)
|
||||||
(fry_date = DATE_SUB(#{queryDate}, INTERVAL 1 DAY)
|
OR (fry_date = #{queryDate} AND current_stage in (1, 2) )
|
||||||
AND current_stage IN
|
|
||||||
<foreach collection="yesterdayStageList" item="stage" open="(" separator="," close=")">
|
|
||||||
#{stage}
|
|
||||||
</foreach>)
|
|
||||||
OR (fry_date = #{queryDate} AND current_stage = #{todayStage})
|
|
||||||
<if test="applyType!=null and applyType==2">
|
|
||||||
or (fry_date = #{queryDate} AND current_stage = 2 and current_apply_type = 2)
|
|
||||||
</if>
|
|
||||||
)
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDailyFryCountInCurrentMonth" resultType="com.cool.store.dto.pre.fry.DailyFryCountDTO">
|
<select id="selectDailyFryCountInCurrentMonth" resultType="com.cool.store.dto.pre.fry.DailyFryCountDTO">
|
||||||
|
|||||||
@@ -177,8 +177,7 @@ public class PreFryRecordsServiceImpl implements PreFryRecordsService {
|
|||||||
if (dto.getCurrentDate()==null|| StringUtils.isBlank(dto.getStoreCode())){
|
if (dto.getCurrentDate()==null|| StringUtils.isBlank(dto.getStoreCode())){
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
}
|
}
|
||||||
List<PreFryRecordsDO> preFryRecordsDOS = preFryRecordsDAO.selectByStoreAndDateStage(dto.getStoreCode(),dto.getApplyType(), Arrays.asList(STORED_IN_FRIDGE.getCode(),
|
List<PreFryRecordsDO> preFryRecordsDOS = preFryRecordsDAO.selectByStoreAndDateStage(dto.getStoreCode(),dto.getApplyType(), DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,dto.getCurrentDate()));
|
||||||
TAKEN_OUT_NEXT_DAY.getCode(), DISCARDED.getCode()), PRE_FRY_COMPLETED.getCode(), DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,dto.getCurrentDate()));
|
|
||||||
PageInfo result = new PageInfo<>(preFryRecordsDOS);
|
PageInfo result = new PageInfo<>(preFryRecordsDOS);
|
||||||
if (CollectionUtils.isEmpty(preFryRecordsDOS)){
|
if (CollectionUtils.isEmpty(preFryRecordsDOS)){
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user