Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/mybatis/wisdom/RkInfoMapper.xml
This commit is contained in:
2025-11-04 14:38:52 +08:00
11 changed files with 273 additions and 2 deletions

View File

@@ -76,6 +76,12 @@ public class PhotoController {
return AjaxResult.success(photoService.listUrlsByBill(billNo, photoType));
}
@GetMapping("/listData")
public AjaxResult listData(@RequestParam("billNo") String billNo,
@RequestParam(value = "photoType", required = false) String photoType) {
return AjaxResult.success(photoService.listsByBill(billNo, photoType));
}
/**
* 【删除:按 URL 列表】
* @param dto
@@ -87,4 +93,8 @@ public class PhotoController {
Map<String, Object> result = photoService.deleteByUrls(dto.getUrls());
return AjaxResult.success("删除完成", result);
}
@GetMapping("/deleteById")
public AjaxResult deleteById(@RequestParam("id") Integer id){
return AjaxResult.success(photoService.deleteById(id));
}
}

View File

@@ -254,4 +254,34 @@ public class RkInfoController extends BaseController
}
@PostMapping("/pageStatistics")
public Map<String, Object> pageStatistics(@RequestBody(required = false) RkInfoQueryDTO dto) {
if (dto == null) {
dto = new RkInfoQueryDTO();
}
// 使用 PageHelper 分页
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<RkInfo> list = rkInfoService.selectAllRkInfo(dto);
// 统计金额
Long sumMoney = rkInfoService.selectStatistics(dto);
// 统计库位
Long pcdeCount = rkInfoService.selectPcde(dto);
Map<String,Object> dataInfo = new HashMap<>();
dataInfo.put("dataList",getDataTable(list));
dataInfo.put("sumMoney",sumMoney);
dataInfo.put("pcdeCount",pcdeCount);
return dataInfo;
}
// 根据玉田需求,新添加的接口
@PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
@PostMapping("/editBill")
public AjaxResult editBill(@RequestBody RkInfo rkInfo)
{
return toAjax(rkInfoService.updateBillInfo(rkInfo));
}
}

View File

@@ -2,6 +2,7 @@ package com.zg.project.wisdom.domain.dto;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
@@ -31,5 +32,8 @@ public class PcRkInfoBatchDTO {
/** 发起人签字图片 URL单张 */
private String signatureUrl;
// zhangjinbo 根据玉田需求 添加入库时间
private Date rkTime;
}

View File

@@ -234,4 +234,9 @@ public interface RkInfoMapper
* 查询 rk_info 全量明细(仅未删除)
*/
List<RkInfo> selectAllRkInfo(RkInfo query);
Long selectStatistics(RkInfo query);
Long selectPcde(RkInfo query);
int updateBillInfo(RkInfo query);
}

View File

@@ -33,4 +33,6 @@ public interface StockPhotoMapper {
* @return
*/
int softDeleteByUrls(@Param("urls") List<String> urls);
int DeleteById(Integer id);
}

View File

@@ -1,6 +1,7 @@
package com.zg.project.wisdom.service;
import java.util.List;
import java.util.Map;
import com.zg.project.Inventory.domain.dto.QueryDTO;
import com.zg.project.Inventory.domain.vo.ChartDataVO;
@@ -167,4 +168,9 @@ public interface IRkInfoService
*/
List<RkInfo> selectAllRkInfo(RkInfo query);
Long selectStatistics(RkInfo query);
Long selectPcde(RkInfo query);
public int updateBillInfo(RkInfo rkInfo);
}

View File

@@ -33,6 +33,7 @@ public interface PhotoService {
* 按 billNo可选 photoType查询照片 URL 列表
*/
List<String> listUrlsByBill(String billNo, String photoType);
List<Map<String, Object>> listsByBill(String billNo, String photoType);
/**
* 按 URL 批量删除(仅数据库软删,不删除磁盘文件)
@@ -41,4 +42,5 @@ public interface PhotoService {
*/
Map<String, Object> deleteByUrls(List<String> urls);
public int deleteById(Integer id);
}

View File

@@ -110,6 +110,33 @@ public class PhotoServiceImpl implements PhotoService {
.collect(Collectors.toList());
}
@Override
public List<Map<String, Object>> listsByBill(String billNo, String photoType) {
if (StringUtils.isBlank(billNo)) {
throw new IllegalArgumentException("billNo 不能为空");
}
// return stockPhotoMapper.selectByBillNo(billNo,
// StringUtils.isBlank(photoType) ? null : photoType)
// .stream()
// .map(product -> StockPhotoDTO.builder()
// .id(product.getId())
// .name(product.getName())
// .price(product.getPrice() * 1.1) // 价格增加10%
// .build())
// .collect(Collectors.toList());
List<Map<String, Object>> result = stockPhotoMapper.selectByBillNo(billNo,
StringUtils.isBlank(photoType) ? null : photoType).stream()
.map(photo -> {
Map<String, Object> map = new HashMap<>();
map.put("url", photo.getUrl());
map.put("id", photo.getId());
return map;
})
.collect(Collectors.toList());
return result;
}
/**
* 批量删除
* @param urls 待删URL列表
@@ -129,4 +156,9 @@ public class PhotoServiceImpl implements PhotoService {
ret.put("dbUpdated", dbUpdated);
return ret;
}
@Override
public int deleteById(Integer id){
return stockPhotoMapper.DeleteById(id);
}
}

View File

@@ -337,7 +337,8 @@ public class RkInfoServiceImpl implements IRkInfoService
rk.setRkType(dto.getRkType());
rk.setWlType(dto.getWlType());
rk.setLihuoY(dto.getLihuoY());
rk.setRkTime(now);
// rk.setRkTime(now);
rk.setRkTime(dto.getRkTime()); //zhangjinbo 2025-11-03根据玉田需求进行修改
rk.setCangku(dto.getCangku());
rk.setCreateBy(userId);
rk.setCreateTime(now);
@@ -1003,4 +1004,23 @@ public class RkInfoServiceImpl implements IRkInfoService
public List<RkInfo> selectAllRkInfo(RkInfo query) {
return rkInfoMapper.selectAllRkInfo(query);
}
@Override
public Long selectStatistics(RkInfo query) {
return rkInfoMapper.selectStatistics(query);
}
@Override
public Long selectPcde(RkInfo query) {
return rkInfoMapper.selectPcde(query);
}
@Override
public int updateBillInfo(RkInfo query) {
return rkInfoMapper.updateBillInfo(query);
}
}

View File

@@ -386,7 +386,8 @@
so.type_name AS ck_type_name,
a.ly_time,
a.ck_lihuo_y,
u.user_name AS ck_lihuo_y_name
u.user_name AS ck_lihuo_y_name,
ru.user_name AS lihuo_y_name
FROM (
SELECT
MIN(t.id) AS id,
@@ -507,6 +508,7 @@
LEFT JOIN stock_out_type so ON a.ck_type = so.type_code
LEFT JOIN sys_user u ON a.ck_lihuo_y = u.user_id
LEFT JOIN material_type mt ON a.wl_type = mt.type_code
LEFT JOIN sys_user ru ON a.lihuo_y = ru.user_id
ORDER BY a.rk_time DESC
</select>
<!-- ================== /按单据分组查询 ================== -->
@@ -1000,4 +1002,155 @@
ORDER BY ri.create_time DESC, ri.id DESC
</select>
<select id="selectStatistics" resultType="java.lang.Long" parameterType="java.lang.Object" >
SELECT sum(ri.ht_dj*ri.real_qty)
FROM rk_info ri
<where>
(ri.is_delete = '0' OR ri.is_delete = 0 OR ri.is_delete IS NULL)
<if test="isChuku != null and isChuku != ''">
AND ri.is_chuku = #{isChuku}
</if>
<if test="cangku != null and cangku != ''">
AND ri.cangku = #{cangku}
</if>
<if test="startTime != null">
AND ri.rk_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null">
AND ri.rk_time <![CDATA[ <= ]]> #{endTime}
</if>
<if test="lyStartTime != null">
AND ri.ly_time <![CDATA[ >= ]]> #{lyStartTime}
</if>
<if test="lyEndTime != null">
AND ri.ly_time <![CDATA[ <= ]]> #{lyEndTime}
</if>
<if test="xmNo != null and xmNo != ''">
AND ri.xm_no LIKE CONCAT('%', #{xmNo}, '%')
</if>
<if test="xmMs != null and xmMs != ''">
AND ri.xm_ms LIKE CONCAT('%', #{xmMs}, '%')
</if>
<if test="wlNo != null and wlNo != ''">
AND ri.wl_no LIKE CONCAT('%', #{wlNo}, '%')
</if>
<if test="wlMs != null and wlMs != ''">
AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%')
</if>
<if test="gysNo != null and gysNo != ''">
AND ri.gys_no LIKE CONCAT('%', #{gysNo}, '%')
</if>
<if test="gysMc != null and gysMc != ''">
AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%')
</if>
<if test="sapNo != null and sapNo != ''">
AND ri.sap_no LIKE CONCAT('%', #{sapNo}, '%')
</if>
<if test="billNo != null and billNo != ''">
AND ri.bill_no LIKE CONCAT('%', #{billNo}, '%')
</if>
<if test="billNoCk != null and billNoCk != ''">
AND ri.bill_no_ck LIKE CONCAT('%', #{billNoCk}, '%')
</if>
<if test="ckType != null and ckType != ''">
AND ri.ck_type LIKE CONCAT('%', #{ckType}, '%')
</if>
<if test="pcode != null and pcode != ''">
AND ri.pcode LIKE CONCAT('%', #{pcode}, '%')
</if>
<if test="fycde1 != null and fycde1 != ''">
AND ri.fycde_1 LIKE CONCAT('%', #{fycde1}, '%')
</if>
<if test="fycde2 != null and fycde2 != ''">
AND ri.fycde_2 LIKE CONCAT('%', #{fycde2}, '%')
</if>
</where>
</select>
<select id="selectPcde" resultType="java.lang.Long" parameterType="java.lang.Object" >
SELECT count(distinct pcode)
FROM rk_info ri
<where>
(ri.is_delete = '0' OR ri.is_delete = 0 OR ri.is_delete IS NULL)
<if test="isChuku != null and isChuku != ''">
AND ri.is_chuku = #{isChuku}
</if>
<if test="cangku != null and cangku != ''">
AND ri.cangku = #{cangku}
</if>
<if test="startTime != null">
AND ri.rk_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null">
AND ri.rk_time <![CDATA[ <= ]]> #{endTime}
</if>
<if test="lyStartTime != null">
AND ri.ly_time <![CDATA[ >= ]]> #{lyStartTime}
</if>
<if test="lyEndTime != null">
AND ri.ly_time <![CDATA[ <= ]]> #{lyEndTime}
</if>
<if test="xmNo != null and xmNo != ''">
AND ri.xm_no LIKE CONCAT('%', #{xmNo}, '%')
</if>
<if test="xmMs != null and xmMs != ''">
AND ri.xm_ms LIKE CONCAT('%', #{xmMs}, '%')
</if>
<if test="wlNo != null and wlNo != ''">
AND ri.wl_no LIKE CONCAT('%', #{wlNo}, '%')
</if>
<if test="wlMs != null and wlMs != ''">
AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%')
</if>
<if test="gysNo != null and gysNo != ''">
AND ri.gys_no LIKE CONCAT('%', #{gysNo}, '%')
</if>
<if test="gysMc != null and gysMc != ''">
AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%')
</if>
<if test="sapNo != null and sapNo != ''">
AND ri.sap_no LIKE CONCAT('%', #{sapNo}, '%')
</if>
<if test="billNo != null and billNo != ''">
AND ri.bill_no LIKE CONCAT('%', #{billNo}, '%')
</if>
<if test="billNoCk != null and billNoCk != ''">
AND ri.bill_no_ck LIKE CONCAT('%', #{billNoCk}, '%')
</if>
<if test="ckType != null and ckType != ''">
AND ri.ck_type LIKE CONCAT('%', #{ckType}, '%')
</if>
<if test="pcode != null and pcode != ''">
AND ri.pcode LIKE CONCAT('%', #{pcode}, '%')
</if>
<if test="fycde1 != null and fycde1 != ''">
AND ri.fycde_1 LIKE CONCAT('%', #{fycde1}, '%')
</if>
<if test="fycde2 != null and fycde2 != ''">
AND ri.fycde_2 LIKE CONCAT('%', #{fycde2}, '%')
</if>
</where>
</select>
<update id="updateBillInfo" parameterType="com.zg.project.wisdom.domain.RkInfo">
UPDATE rk_info
<set>
<if test="rkType != null">rk_type = #{rkType},</if>
<if test="wlType != null">wl_type = #{wlType},</if>
<if test="cangku != null">cangku = #{cangku},</if>
<if test="rkTime != null">rk_time = #{rkTime},</if>
</set>
WHERE bill_no = #{billNo}
</update>
</mapper>

View File

@@ -67,6 +67,13 @@
#{u}
</foreach>
</update>
<update id="DeleteById" >
UPDATE stock_photo
SET is_delete = '1',
update_time = NOW()
WHERE id = #{Id}
</update>
</mapper>