Merge remote-tracking branch 'origin/master'

This commit is contained in:
mashuai 2025-07-30 10:45:21 +08:00
commit 76f1a1f7f9
6 changed files with 75 additions and 4 deletions

View File

@ -494,7 +494,13 @@ public class BackApplyInfoController extends BaseController {
}
@ApiOperation(value = "app退料退回")
@ApiOperation(value = "获取排号")
@PostMapping("/getSort")
public AjaxResult getSort(@RequestBody HandlingOrder bean) {
return backApplyInfoService.getSort(bean);
}
@ApiOperation(value = "上传排号")
@PreventRepeatSubmit
@PostMapping("/uploadSort")
public AjaxResult uploadSort(@RequestBody HandlingOrder bean) {

View File

@ -73,4 +73,10 @@ public class HandlingOrder implements Serializable {
*/
private String type;
private String timeType;
private String startTime;
private String endTime;
}

View File

@ -413,4 +413,11 @@ public interface BackApplyInfoMapper {
* @return
*/
int selectSort(HandlingOrder bean);
/**
* 查询排序号
* @param bean
* @return
*/
HandlingOrder getSort(HandlingOrder bean);
}

View File

@ -212,5 +212,11 @@ public interface IBackApplyInfoService {
*/
int confirmMaterial(BackApplyInfo backApplyInfo);
/**
* 获取排号
* @param bean
* @return
*/
AjaxResult getSort(HandlingOrder bean);
}

View File

@ -1688,9 +1688,10 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
public AjaxResult uploadSort(HandlingOrder bean) {
try {
//查询排号是否存在
bean.setReserveDate(DateUtils.getDate());
int re = backApplyInfoMapper.selectSort(bean);
if (re > 0) {
return AjaxResult.error("号已存在");
return AjaxResult.error("今日该号已存在");
}
int res = backApplyInfoMapper.uploadSort(bean);
if (res > 0) {
@ -1792,6 +1793,36 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
return backApplyInfoMapper.updateBackApplyInfo(backApplyInfo);
}
@Override
public AjaxResult getSort(HandlingOrder bean) {
HandlingOrder beans = new HandlingOrder();
String timeTypes = "";
try {
//判断现在是上午还是下午上午为A下午为B
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
String timeType = (hour < 12) ? "A" : "B";
timeTypes = timeType;
bean.setTimeType(timeType);
bean.setReserveDate(DateUtils.getDate());
//查询当前的排号
HandlingOrder bean1 = backApplyInfoMapper.getSort(bean);
if (bean1 != null && bean1.getSort() != null) {
Integer sort = bean1.getSort() + 1;
beans.setSort(sort);
beans.setTimeType(timeType);
} else {
beans.setTimeType(timeType);
beans.setSort(1);
}
return AjaxResult.success(beans);
} catch (Exception e) {
log.error("获取排号失败", e);
beans.setTimeType(timeTypes);
return AjaxResult.success(beans);
}
}
/**
* 关键字搜索

View File

@ -813,7 +813,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="uploadSort">
update bm_handling_order
set sort = #{sort}
set sort = #{sort},time_type = #{timeType},queue_date=#{reserveDate}
where id = #{id}
</update>
@ -1056,17 +1056,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bho.car_code as carCode,
bho.link_man as linkMan,
bho.phone,
bho.time_type as timeType,
bho.sort,
bho.type,
bho.reserve_date as reserveDate
FROM bm_handling_order bho
LEFT JOIN bm_project bp on bp.pro_id = bho.pro_id
WHERE bho.is_active = '1'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and bho.reserve_date BETWEEN #{startTime} AND #{endTime}
</if>
<if test="keyWord !=null and keyWord !=''">
and (
bho.car_code like concat('%',#{keyWord},'%') or
bho.link_man like concat('%',#{keyWord},'%') or
bp.pro_name like concat('%',#{keyWord},'%')
bp.pro_name like concat('%',#{keyWord},'%') or
bho.type like concat('%',#{keyWord},'%')
)
</if>
@ -1075,6 +1080,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT count(*)
FROM bm_handling_order
WHERE sort = #{sort}
and time_type=#{timeType}
and queue_date=#{reserveDate}
and is_active = '1'
</select>
@ -1112,4 +1119,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and mm.ma_code = #{maCode}
GROUP BY mm.ma_id
</select>
<select id="getSort" resultType="com.bonus.material.back.domain.HandlingOrder">
SELECT time_type as timeType,
sort
FROM bm_handling_order
WHERE queue_date = #{reserveDate}
and time_type = #{timeType}
ORDER BY sort desc LIMIT 1
</select>
</mapper>