代码提交

This commit is contained in:
liang.chao 2024-05-16 13:37:16 +08:00
parent 2c14888e0d
commit eafeddae64
6 changed files with 62 additions and 8 deletions

View File

@ -286,4 +286,17 @@ public class BackReceiveController extends BaseController {
throw new RuntimeException(e);
}
}
@Log(title = "退料接收记录(编码接收)-web", businessType = BusinessType.INSERT)
@PostMapping("backReceiveRecordWebPt")
public AjaxResult backReceiveRecordWebPt(@RequestBody BackApplyInfo record) {
try {
List<BackApplyInfo> list = backReceiveService.backReceiveRecordWebPt(record);
Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -202,4 +202,6 @@ public interface BackReceiveMapper {
BackApplyInfo backReceiveRecordWeb(BackApplyInfo record);
List<BackApplyInfo> getCtList(BackApplyInfo record);
List<BackApplyInfo> backReceiveRecordWebPt(BackApplyInfo record);
}

View File

@ -97,4 +97,6 @@ public interface BackReceiveService {
int revoke(BackApplyInfo record);
List<BackApplyInfo> backReceiveRecordWeb(BackApplyInfo record);
List<BackApplyInfo> backReceiveRecordWebPt(BackApplyInfo record);
}

View File

@ -348,6 +348,23 @@ public class BackReceiveServiceImpl implements BackReceiveService {
return backApplyInfoList;
}
@Override
public List<BackApplyInfo> backReceiveRecordWebPt(BackApplyInfo record) {
String typeId = record.getTypeId();
String[] split = typeId.split(",");
List<BackApplyInfo> backApplyInfoList = new ArrayList<>();
for (String s : split) {
record.setTypeId(s);
List<BackApplyInfo> backApplyInfo = backReceiveMapper.backReceiveRecordWebPt(record);
if (backApplyInfo != null) {
for (BackApplyInfo applyInfo : backApplyInfo) {
backApplyInfoList.add(applyInfo);
}
}
}
return backApplyInfoList;
}
private int insertRad(int taskId, List<BackApplyInfo> wxList) {
int result = 0;
if (wxList != null) {

View File

@ -963,6 +963,7 @@
SELECT
mt2.type_name AS typeName,
mt1.type_name AS typeCode,
ifnull(sum( bcd.back_num ), 0) AS backNum,
SUM( CASE WHEN bcd.back_status = 1 THEN bcd.back_num ELSE 0 END ) AS hgNum,
SUM( CASE WHEN bcd.back_status = 2 THEN bcd.back_num ELSE 0 END ) AS wxNum,
SUM( CASE WHEN bcd.back_status = 3 THEN bcd.back_num ELSE 0 END ) AS bfNum,
@ -997,5 +998,28 @@
WHERE
bad.parent_id = #{parentId}
</select>
<select id="backReceiveRecordWebPt" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
SELECT
mt2.type_name AS typeName,
mt1.type_name AS typeCode,
ifnull( bcd.back_num, 0 ) AS backNum,
mm.ma_code AS maCode,
bcd.create_time AS backTime,
bcd.type_id AS modelId,
bcd.back_status AS backStatus
FROM
back_check_details bcd
LEFT JOIN ma_type mt1 ON mt1.type_id = bcd.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
LEFT JOIN ma_machine mm ON mm.ma_id = bcd.ma_id
WHERE
bcd.parent_id = #{parentId}
AND bcd.type_id = #{typeId}
<if test="maCode != null and maCode != ''">
and mm.ma_code like concat('%', #{maCode}, '%')
</if>
ORDER BY
bcd.create_time DESC
</select>
</mapper>

View File

@ -88,14 +88,14 @@ public class BackApplyServiceImpl implements BackApplyService {
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
String taskNum = backApplyMapper.selectTaskNumByMonth(nowDate, 36);
if (StringHelper.isNotEmpty(taskNum)){
if (StringHelper.isNotEmpty(taskNum)) {
// 将字符串转换为整数
int num = Integer.parseInt(taskNum);
// 执行加一操作
num++;
// 将结果转换回字符串格式并确保结果是四位数不足四位则在前面补0
taskNum = String.format("%04d", num);
}else {
} else {
taskNum = "0001";
}
String code = "T" + format + "-" + taskNum;
@ -137,13 +137,9 @@ public class BackApplyServiceImpl implements BackApplyService {
}
if (companyId != null) {
bean.setCompanyId(companyId.toString());
List<BackApplyInfo> view = backApplyMapper.getView(bean);
return getMaTypeDetails(view);
} else {
List<BackApplyInfo> view = backApplyMapper.getView(bean);
return getMaTypeDetails(view);
}
List<BackApplyInfo> view = backApplyMapper.getView(bean);
return getMaTypeDetails(view);
}
private List<BackApplyInfo> getMaTypeDetails(List<BackApplyInfo> view) {