This commit is contained in:
parent
adf91681f5
commit
b276afc142
|
|
@ -80,7 +80,7 @@ public class BackApplyInfoController extends BaseController {
|
|||
@GetMapping("/getDetailsList")
|
||||
public AjaxResult getDetailsList(BackApplyInfo backApplyInfo) {
|
||||
startPage();
|
||||
List<LeaseApplyInfo> list = backApplyInfoService.getDetailsList(backApplyInfo);
|
||||
List<BackApplyInfo> list = backApplyInfoService.getDetailsList(backApplyInfo);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -372,5 +372,5 @@ public interface BackApplyInfoMapper {
|
|||
* @param backApplyInfo
|
||||
* @return
|
||||
*/
|
||||
List<LeaseApplyInfo> getDetailsList(BackApplyInfo backApplyInfo);
|
||||
List<BackApplyInfo> getDetailsList(BackApplyInfo backApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,6 +165,6 @@ public interface IBackApplyInfoService {
|
|||
* @param backApplyInfo
|
||||
* @return
|
||||
*/
|
||||
List<LeaseApplyInfo> getDetailsList(BackApplyInfo backApplyInfo);
|
||||
List<BackApplyInfo> getDetailsList(BackApplyInfo backApplyInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1438,7 +1438,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LeaseApplyInfo> getDetailsList(BackApplyInfo backApplyInfo) {
|
||||
public List<BackApplyInfo> getDetailsList(BackApplyInfo backApplyInfo) {
|
||||
return backApplyInfoMapper.getDetailsList(backApplyInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,19 @@ public class TypeController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据层级查询下拉数据
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询物资类型管理列表")
|
||||
@GetMapping("/getLevelList")
|
||||
public AjaxResult getLevelList(Type type) {
|
||||
startPage();
|
||||
List<Type> list = typeService.getLevelList(type);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询物资历史价格列表")
|
||||
@GetMapping("/getMaTypeHistoryList")
|
||||
public TableDataInfo getMaTypeHistoryList(MaTypeHistory maTypeHistory) {
|
||||
|
|
|
|||
|
|
@ -221,9 +221,9 @@ public class Machine extends BaseEntity
|
|||
@ApiModelProperty(value = "类型编号")
|
||||
private String typeCode;
|
||||
|
||||
/** 规格编号 */
|
||||
@ApiModelProperty(value = "规格编号")
|
||||
private String modelCode;
|
||||
/** 规格型号 */
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String maModel;
|
||||
|
||||
@ApiModelProperty(value = "推送时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
|
|
|||
|
|
@ -239,4 +239,7 @@ public class Type extends BaseEntity {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private String pushTime;
|
||||
|
||||
@ApiModelProperty(value = "机具编码")
|
||||
private String maCode;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,4 +213,13 @@ public interface TypeMapper {
|
|||
* @return
|
||||
*/
|
||||
List<Machine> getMaTypeDetails(Type dto);
|
||||
|
||||
/**
|
||||
* 查询物资类型管理列表
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
List<Type> getLevelList(Type type);
|
||||
|
||||
List<Type> getLevelThreeList(Type type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,4 +140,5 @@ public interface ITypeService {
|
|||
|
||||
AjaxResult getPushDetailsInfo();
|
||||
|
||||
List<Type> getLevelList(Type type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,6 +207,22 @@ public class TypeServiceImpl implements ITypeService {
|
|||
return AjaxResult.success(simplifiedGroupedData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物资类型管理列表
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Type> getLevelList(Type type) {
|
||||
List<Type> list = new ArrayList<>();
|
||||
if (type.getLevel() != null && "3".equals(type.getLevel())) {
|
||||
list = typeMapper.getLevelList(type);
|
||||
} else if (type.getLevel() != null && "4".equals(type.getLevel())) {
|
||||
list = typeMapper.getLevelThreeList(type);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class StatisticTask {
|
|||
Long level3Id = createOrGetCategory(keys[2], level2Id, "3", type);
|
||||
|
||||
// 处理四级分类和机具信息
|
||||
processLevel4Items(formDate, valueList, level3Id, keys, typeMapper, machineMapper);
|
||||
processLevel4Items(valueList, level3Id, typeMapper, machineMapper);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to process category: {}", key, e);
|
||||
|
|
@ -118,14 +118,12 @@ public class StatisticTask {
|
|||
|
||||
/**
|
||||
* 处理四级分类和机具信息
|
||||
* @param formDate
|
||||
* @param items
|
||||
* @param parentId
|
||||
* @param categoryKeys
|
||||
* @param typeMapper
|
||||
* @param machineMapper
|
||||
*/
|
||||
private void processLevel4Items(String formDate, List<Type> items, Long parentId, String[] categoryKeys,
|
||||
private void processLevel4Items(List<Type> items, Long parentId,
|
||||
TypeMapper typeMapper, MachineMapper machineMapper) {
|
||||
for (Type item : items) {
|
||||
item.setLevel("4");
|
||||
|
|
@ -145,29 +143,14 @@ public class StatisticTask {
|
|||
throw new RuntimeException("Failed to insert level 4 item: " + item.getModelCode());
|
||||
}
|
||||
}
|
||||
|
||||
// 查询并更新机具信息
|
||||
Type queryDto = new Type();
|
||||
queryDto.setMaterialName(categoryKeys[0]);
|
||||
queryDto.setTypeName(categoryKeys[1]);
|
||||
queryDto.setTypeCode(categoryKeys[2]);
|
||||
queryDto.setModelCode(item.getModelCode());
|
||||
queryDto.setPushTime(formDate);
|
||||
|
||||
List<Machine> machineList = typeMapper.getMaTypeDetails(queryDto);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(machineList)) {
|
||||
for (Machine machine : machineList) {
|
||||
machine.setTypeId(item.getTypeId());
|
||||
Machine existingMachine = machineMapper.getMachineById(machine);
|
||||
if (existingMachine == null) {
|
||||
// 推送过来的数据默认状态为 在库
|
||||
machine.setMaStatus("1");
|
||||
machineMapper.insertMachine(machine);
|
||||
} /*else {
|
||||
machineMapper.updateMachine(machine);
|
||||
}*/
|
||||
}
|
||||
Machine machine = new Machine();
|
||||
machine.setTypeId(item.getTypeId());
|
||||
machine.setMaCode(item.getMaCode());
|
||||
Machine existingMachine = machineMapper.getMachineById(machine);
|
||||
if (existingMachine == null) {
|
||||
// 推送过来的数据默认状态为 在库
|
||||
machine.setMaStatus("1");
|
||||
machineMapper.insertMachine(machine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -932,11 +932,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and bcd.type_id = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getTotalList" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
SELECT
|
||||
lease_name AS unitName,
|
||||
project_name AS proName,
|
||||
task_time AS leaseTime,
|
||||
task_time AS backTime,
|
||||
task_code AS code,
|
||||
out_person AS backPerson,
|
||||
GROUP_CONCAT( DISTINCT ma_name ) AS typeName
|
||||
|
|
@ -951,15 +952,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
task_code
|
||||
</select>
|
||||
|
||||
<select id="getDetailsList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
<select id="getDetailsList" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
SELECT
|
||||
ma_name AS typeCode,
|
||||
ma_model AS modelCode,
|
||||
ma_unit AS unitName,
|
||||
ma_unit AS unitNames,
|
||||
NUM AS backNum
|
||||
FROM
|
||||
ma_station_push
|
||||
WHERE
|
||||
task_code = #{code}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_type AS typeName,
|
||||
ma_name AS typeCode,
|
||||
ma_model AS maModel,
|
||||
ma_code AS modelCode,
|
||||
ma_code AS maCode,
|
||||
ma_qrcode AS qrCode,
|
||||
ma_status AS maStatus,
|
||||
this_check_time AS thisCheckTime,
|
||||
|
|
@ -512,9 +512,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and (
|
||||
ma_code like concat('%', #{keyWord}, '%') or
|
||||
ma_qrcode like concat('%', #{keyWord}, '%') or
|
||||
check_man like concat('%', #{keyWord}, '%') or
|
||||
check_man like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="typeCode != null and typeCode != ''">
|
||||
and ma_name like concat('%', #{typeCode}, '%')
|
||||
</if>
|
||||
<if test="maModel != null and maModel != ''">
|
||||
and ma_model like concat('%', #{maModel}, '%')
|
||||
</if>
|
||||
GROUP BY
|
||||
ma_code
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -956,7 +956,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
COALESCE(t1.sum_num_1, 0) - COALESCE(t2.sum_num_2, 0) AS storageNum,
|
||||
COALESCE(t1.lease_price, t2.lease_price) AS leasePrice,
|
||||
COALESCE(t1.push_time, t2.push_time) AS pushTime,
|
||||
COALESCE(t1.manage_type, t2.manage_type) AS manageType
|
||||
COALESCE(t1.manage_type, t2.manage_type) AS manageType,
|
||||
COALESCE(t1.ma_code, t2.ma_code) AS maCode
|
||||
FROM (
|
||||
SELECT
|
||||
ma_material,
|
||||
|
|
@ -964,16 +965,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_name,
|
||||
ma_model,
|
||||
ma_code,
|
||||
SUM(NUM) AS sum_num_1,
|
||||
SUM(num) AS sum_num_1,
|
||||
lease_price,
|
||||
push_time,
|
||||
manage_type
|
||||
FROM ma_station_push
|
||||
WHERE task_type = '1'
|
||||
<if test="pushTime != null">
|
||||
and push_time = #{pushTime}
|
||||
</if>
|
||||
GROUP BY ma_material, ma_type, ma_name, ma_model
|
||||
<if test="pushTime != null">
|
||||
and push_time = #{pushTime}
|
||||
</if>
|
||||
GROUP BY
|
||||
ma_material, ma_type, ma_name, ma_model, ma_code,
|
||||
lease_price, push_time, manage_type
|
||||
) t1
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
|
|
@ -982,22 +985,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_name,
|
||||
ma_model,
|
||||
ma_code,
|
||||
SUM(NUM) AS sum_num_2,
|
||||
SUM(num) AS sum_num_2,
|
||||
lease_price,
|
||||
push_time,
|
||||
manage_type
|
||||
FROM ma_station_push
|
||||
WHERE task_type = '2'
|
||||
<if test="pushTime != null">
|
||||
and push_time = #{pushTime}
|
||||
</if>
|
||||
GROUP BY ma_material, ma_type, ma_name, ma_model
|
||||
<if test="pushTime != null">
|
||||
and push_time = #{pushTime}
|
||||
</if>
|
||||
GROUP BY
|
||||
ma_material, ma_type, ma_name, ma_model, ma_code,
|
||||
lease_price, push_time, manage_type
|
||||
) t2
|
||||
ON t1.ma_material = t2.ma_material
|
||||
AND t1.ma_type = t2.ma_type
|
||||
AND t1.ma_name = t2.ma_name
|
||||
AND t1.ma_model = t2.ma_model
|
||||
AND t1.manage_type = t2.manage_type
|
||||
ON
|
||||
t1.ma_material = t2.ma_material AND
|
||||
t1.ma_type = t2.ma_type AND
|
||||
t1.ma_name = t2.ma_name AND
|
||||
t1.ma_model = t2.ma_model AND
|
||||
t1.manage_type = t2.manage_type AND
|
||||
(
|
||||
(t1.ma_code IS NOT NULL AND t2.ma_code IS NOT NULL AND t1.ma_code = t2.ma_code)
|
||||
OR (t1.ma_code IS NULL OR t2.ma_code IS NULL)
|
||||
)
|
||||
WHERE
|
||||
COALESCE(t1.sum_num_1, 0) - COALESCE(t2.sum_num_2, 0) > 0
|
||||
</select>
|
||||
|
||||
<select id="getMaTypeDetails" resultType="com.bonus.material.ma.domain.Machine">
|
||||
|
|
@ -1026,4 +1038,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and ma_model = #{modelCode}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLevelList" resultType="com.bonus.material.ma.domain.Type">
|
||||
select
|
||||
id as typeId,
|
||||
ma_name as typeName
|
||||
from ma_station_code
|
||||
GROUP BY ma_name
|
||||
</select>
|
||||
|
||||
<select id="getLevelThreeList" resultType="com.bonus.material.ma.domain.Type">
|
||||
select
|
||||
id as typeId,
|
||||
ma_model as typeName
|
||||
from ma_station_code
|
||||
GROUP BY ma_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue