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