feat:预炸

This commit is contained in:
苏竹红
2025-06-23 21:41:41 +08:00
parent 52d9ef8214
commit 1dab792aad
9 changed files with 211 additions and 7 deletions

View File

@@ -2,6 +2,8 @@ package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.pre.fry.DailyFryCountDTO;
import com.cool.store.dto.pre.fry.PreFryRecordQueryDTO;
import com.cool.store.dto.pre.fry.PreFryRecordsDTO;
import com.cool.store.entity.PreFryRecordsDO;
import com.cool.store.mapper.PreFryRecordsMapper;
import org.apache.commons.collections4.CollectionUtils;
@@ -75,6 +77,9 @@ public class PreFryRecordsDAO {
}
public List<PreFryRecordsDTO> selectByQueryDTO(PreFryRecordQueryDTO dto) {
return preFryRecordsMapper.selectByQueryDTO(dto);
}

View File

@@ -1,6 +1,8 @@
package com.cool.store.mapper;
import com.cool.store.dto.pre.fry.DailyFryCountDTO;
import com.cool.store.dto.pre.fry.PreFryRecordQueryDTO;
import com.cool.store.dto.pre.fry.PreFryRecordsDTO;
import com.cool.store.entity.PreFryRecordsDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
@@ -22,6 +24,11 @@ public interface PreFryRecordsMapper extends Mapper<PreFryRecordsDO> {
@Param("queryDate") String queryDate);
List<DailyFryCountDTO> selectDailyFryCountInCurrentMonth(
@Param("storeCode") String storeCode,@Param("time") Long time);
List<DailyFryCountDTO> selectDailyFryCountInCurrentMonth(@Param("storeCode") String storeCode,@Param("time") Long time);
List<PreFryRecordsDTO> selectByQueryDTO(@Param("query") PreFryRecordQueryDTO dto);
}

View File

@@ -14,6 +14,8 @@
<result column="latest_sale_time" jdbcType="TIMESTAMP" property="latestSaleTime" />
<result column="current_stage" jdbcType="TINYINT" property="currentStage" />
<result column="current_apply_type" jdbcType="TINYINT" property="currentApplyType" />
<result column="violation_flag" jdbcType="TINYINT" property="violationFlag" />
<result column="violation_reason" jdbcType="TINYINT" property="violationReason" />
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
</resultMap>
@@ -67,6 +69,53 @@
ORDER BY fry_date
</select>
<select id="selectByQueryDTO" resultType="com.cool.store.dto.pre.fry.PreFryRecordsDTO">
SELECT
a.id as id,
a.record_code as recordCode,
a.current_stage as currentStage,
a.fry_date as fryDate,
a.violation_flag as violationFlag,
a.violation_reason as violationReason,
b.product_name as productName,
b.product_code as productCode,
c.store_name as storeName,
c.store_num as storeNum
FROM xfsg_pre_fry_records a
LEFT JOIN xfsg_pre_fried_products b ON a.product_id = b.id
LEFT JOIN store_5558ce7a3aa84e3590392fcaa8697ffb c ON a.store_code = c.store_num
<where>
<if test="query.recordCode != null and query.recordCode != ''">
AND a.record_code LIKE CONCAT('%', #{query.recordCode}, '%')
</if>
<if test="query.storeCode != null and query.storeCode != ''">
AND a.store_code LIKE CONCAT('%', #{query.storeCode}, '%')
</if>
<if test="query.storeName != null and query.storeName != ''">
AND c.store_name LIKE CONCAT('%', #{query.storeName}, '%')
</if>
<if test="query.productCode != null and query.productCode != ''">
AND b.product_code LIKE CONCAT('%', #{query.productCode}, '%')
</if>
<if test="query.productName != null and query.productName != ''">
AND b.product_name LIKE CONCAT('%', #{query.productName}, '%')
</if>
<if test="query.currentStage != null">
AND a.current_stage = #{query.currentStage}
</if>
<if test="query.fryStartDate != null and query.fryEndDate != null">
AND a.fry_date BETWEEN #{query.fryStartDate} AND #{query.fryEndDate}
</if>
<if test="query.violationFlag != null">
AND a.violation_flag = #{query.violationFlag}
</if>
<if test="query.violationReason != null">
AND a.violation_reason = #{query.violationReason}
</if>
</where>
ORDER BY a.fry_date DESC
</select>
</mapper>

View File

@@ -0,0 +1,39 @@
package com.cool.store.dto.pre.fry;
import com.cool.store.common.PageBasicInfo;
import com.github.pagehelper.PageHelper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2025/6/23 20:49
* @Version 1.0
*/
@Data
public class PreFryRecordQueryDTO extends PageBasicInfo {
@ApiModelProperty("预炸记录编码")
private String recordCode;
@ApiModelProperty("门店编码")
private String storeCode;
@ApiModelProperty("门店名称")
private String storeName;
@ApiModelProperty("产品名称")
private String productName;
@ApiModelProperty("产品编码")
private String productCode;
@ApiModelProperty("状态 当前产品阶段1-预炸完成2-存入展示柜3-放入冰箱4-次日拿出5-报废")
private Integer currentStage;
@ApiModelProperty("预炸开始时间")
private Date fryStartDate;
@ApiModelProperty("预炸结束时间")
private Date fryEndDate;
@ApiModelProperty("是否违规 0-未违规 1违规")
private Integer violationFlag;
@ApiModelProperty("违规原因")
private Integer violationReason;
}

View File

@@ -0,0 +1,37 @@
package com.cool.store.dto.pre.fry;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2025/6/23 21:10
* @Version 1.0
*/
@Data
public class PreFryRecordsDTO {
@ApiModelProperty("预炸记录ID")
private Long id;
@ApiModelProperty("预炸记录编码")
private String recordCode;
@ApiModelProperty("门店编码")
private String storeCode;
@ApiModelProperty("门店名称")
private String storeName;
@ApiModelProperty("产品编码")
private String productCode;
@ApiModelProperty("产品名称")
private String productName;
@ApiModelProperty("当前状态")
private Integer currentStage;
@ApiModelProperty("预炸完成时间")
private Date fryDate;
@ApiModelProperty("是否违规")
private Integer violationFlag;
@ApiModelProperty("违规原因")
private Integer violationReason;
}

View File

@@ -70,6 +70,27 @@ public class PreFryRecordsDO {
@Column(name = "updated_time")
private Date updatedTime;
@Column(name = "updated_flag")
private Integer violationFlag;
@Column(name = "violation_reason")
private Integer violationReason;
public Integer getViolationFlag() {
return violationFlag;
}
public void setViolationFlag(Integer violationFlag) {
this.violationFlag = violationFlag;
}
public Integer getViolationReason() {
return violationReason;
}
public void setViolationReason(Integer violationReason) {
this.violationReason = violationReason;
}
public Integer getCurrentApplyType() {
return currentApplyType;

View File

@@ -1,9 +1,6 @@
package com.cool.store.service;
import com.cool.store.dto.pre.fry.AddPreFryRecordsDTO;
import com.cool.store.dto.pre.fry.DailyFryCountDTO;
import com.cool.store.dto.pre.fry.FryRecordsQueryDTO;
import com.cool.store.dto.pre.fry.PreFryRecordsDetailDTO;
import com.cool.store.dto.pre.fry.*;
import com.cool.store.vo.PartnerUserInfoVO;
import com.github.pagehelper.PageInfo;
@@ -31,7 +28,7 @@ public interface PreFryRecordsService {
List<DailyFryCountDTO> queryByStoreCode(String storeCode, Long time);
PageInfo<PreFryRecordsDTO> queryByQueryDTO(PreFryRecordQueryDTO dto);

View File

@@ -174,6 +174,14 @@ public class PreFryRecordsServiceImpl implements PreFryRecordsService {
return preFryRecordsDAO.selectDailyFryCountInCurrentMonth(storeCode, time);
}
@Override
public PageInfo<PreFryRecordsDTO> queryByQueryDTO(PreFryRecordQueryDTO dto) {
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<PreFryRecordsDTO> preFryRecordQueryDTOS = preFryRecordsDAO.selectByQueryDTO(dto);
PageInfo<PreFryRecordsDTO> preFryRecordQueryDTOPageInfo = new PageInfo<>(preFryRecordQueryDTOS);
return preFryRecordQueryDTOPageInfo;
}
private Boolean addPreFryRecordsFlag(Integer applyType,Integer stage){
if (applyType== PreFryApplyTypeEnum.HAS_REFRIGERATED_DISPLAY.getCode() && stage== PRE_FRY_COMPLETED.getCode()){

View File

@@ -0,0 +1,41 @@
package com.cool.store.controller.webb;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.pre.fry.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.PreFryRecordsService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @Author suzhuhong
* @Date 2025/6/23 20:36
* @Version 1.0
*/
@Slf4j
@Api(tags = "预炸-预炸记录-PC")
@RestController
@RequestMapping("/pc/pre/record/")
public class PCPreFryRecordsController {
@Resource
PreFryRecordsService preFryRecordsService;
@ApiOperation("预炸品管理记录")
@PostMapping("/queryByQueryDTO")
public ResponseResult<PageInfo<PreFryRecordsDTO>> queryByQueryDTO(@RequestBody @Validated PreFryRecordQueryDTO dto) {
log.info("预炸品管理记录:{}", JSONObject.toJSONString(dto));
return ResponseResult.success(preFryRecordsService.queryByQueryDTO(dto));
}
}