物资类型导出优化

This commit is contained in:
syruan 2024-11-29 18:05:50 +08:00
parent c10daa8e83
commit ef0fa628e7
7 changed files with 70 additions and 45 deletions

View File

@ -39,7 +39,7 @@ import javax.annotation.Resource;
@Service
public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
@Autowired
@Resource
private ILeaseOutDetailsService leaseOutDetailsService;
@Resource
@ -157,7 +157,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
if (leaseApplyInfo.getTaskId() == null) {
return AjaxResult.error("任务ID为空,请完善后重新发布!");
}
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
try {
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
if (result > 0) {

View File

@ -52,6 +52,31 @@ public class TypeController extends BaseController {
return getDataTable(list);
}
/**
* 导出物资类型管理列表
*/
@ApiOperation(value = "导出物资类型列表")
@PreventRepeatSubmit
@RequiresPermissions("ma:type:export")
@SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型")
@PostMapping("/export")
public void export(HttpServletResponse response, MaTypeVo maTypeVo) {
List<Integer> parentIds = typeService.selectParentId(maTypeVo);
List<MaTypeVo> maTypeVos = new ArrayList<>();
ExcelUtil<MaTypeVo> util = new ExcelUtil<>(MaTypeVo.class);
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
for (Integer parentId : parentIds) {
maTypeVos.addAll(typeService.getListByParentId(parentId.longValue(), maTypeVo));
}
if (BooleanUtils.isTrue(maTypeVo.getDisplayBindRelationship())) {
List<MaTypeVo> finalMaTypeVos = typeService.getMyTypeAndBindUsers(maTypeVos);
util.exportExcel(response, finalMaTypeVos, "物资类型管理数据");
} else {
util.exportExcel(response, maTypeVos, "物资类型管理数据");
}
}
// @ApiOperation(value = "查询物资类型管理列表(无分页)")
// @RequiresPermissions("ma:type:list")
// @GetMapping("/listNoPage")
@ -60,6 +85,8 @@ public class TypeController extends BaseController {
// return typeService.getMyTypeAndBindUsers(list);
// }
/**
* 根据左列表类型id查询右表格
*
@ -134,19 +161,7 @@ public class TypeController extends BaseController {
return typeService.getMaTypeTreeSelect(typeName, parentId);
}
/**
* 导出物资类型管理列表
*/
@ApiOperation(value = "导出物资类型列表")
@PreventRepeatSubmit
@RequiresPermissions("ma:type:export")
@SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型")
@PostMapping("/export")
public void export(HttpServletResponse response, Type type) {
List<Type> list = typeService.selectTypeList(type);
ExcelUtil<Type> util = new ExcelUtil<Type>(Type.class);
util.exportExcel(response, list, "物资类型管理数据");
}
/**
* 导出物资类型管理列表(库管员)

View File

@ -57,7 +57,7 @@ public class TypeRepairController extends BaseController
@ApiOperation(value = "导出维修班机具配置列表")
@PreventRepeatSubmit
@RequiresPermissions("ma:repair:export")
@SysLog(title = "维修班机具配置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修班机具配置")
@SysLog(title = "维修班机具配置", businessType = OperaType.EXPORT, module = "仓储管理->导出维修班机具配置")
@PostMapping("/export")
public void export(HttpServletResponse response, TypeRepair typeRepair)
{
@ -83,7 +83,7 @@ public class TypeRepairController extends BaseController
@ApiOperation(value = "新增维修班机具配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:repair:add")
@SysLog(title = "维修班机具配置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增维修班机具配置")
@SysLog(title = "维修班机具配置", businessType = OperaType.INSERT, module = "仓储管理->新增维修班机具配置")
@PostMapping
public AjaxResult add(@RequestBody List<TypeRepair> typeRepairs)
{
@ -96,7 +96,7 @@ public class TypeRepairController extends BaseController
@ApiOperation(value = "修改维修班机具配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:repair:edit")
@SysLog(title = "维修班机具配置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改维修班机具配置")
@SysLog(title = "维修班机具配置", businessType = OperaType.UPDATE, module = "仓储管理->修改维修班机具配置")
@PutMapping
public AjaxResult edit(@RequestBody TypeRepair typeRepair)
{
@ -109,7 +109,7 @@ public class TypeRepairController extends BaseController
@ApiOperation(value = "批量删除维修班机具配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:repair:remove")
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->批量删除维修班机具配置")
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, module = "仓储管理->批量删除维修班机具配置")
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable Long[] IDs)
{
@ -122,7 +122,7 @@ public class TypeRepairController extends BaseController
@ApiOperation(value = "删除单个维修班机具配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:repair:remove")
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除单个维修班机具配置")
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, module = "仓储管理->删除单个维修班机具配置")
@DeleteMapping
public AjaxResult remove(@RequestBody List<TypeRepair> typeRepairs)
{

View File

@ -26,25 +26,27 @@ public class Type extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 类型ID */
@Excel(name = "类型ID")
@ApiModelProperty(value = "类型ID")
private Long typeId;
/** 类型名称 */
@Excel(name = "规格型号")
@Excel(name = "规格型号", sort = 5)
@ApiModelProperty(value = "类型名称")
private String typeName;
/** 库管员昵称 */
@ApiModelProperty(value = "库管员昵称")
@Excel(name = "库管员昵称")
private String keeperNickName;
/** 维修员昵称 */
@ApiModelProperty(value = "维修员昵称")
@Excel(name = "维修员昵称")
private String repairNickName;
/** 仓库名称 */
@ApiModelProperty(value = "物资仓库名称")
@Excel(name = "物资仓库名称", sort = 6)
private String houseName;
/** 仓库Id */
@ -52,7 +54,6 @@ public class Type extends BaseEntity {
private Long houseId;
/** 上级ID */
@Excel(name = "上级ID")
@ApiModelProperty(value = "上级ID")
private Long parentId;
@ -70,26 +71,24 @@ public class Type extends BaseEntity {
private Integer testCycle = 0;
/** 类型编号 */
@Excel(name = "类型编号")
@ApiModelProperty(value = "类型编号")
private String typeCode;
/** 规格编号 */
@Excel(name = "规格编号")
@ApiModelProperty(value = "规格编号")
private String modelCode;
/** 计量单位ID */
@Excel(name = "计量单位ID")
@ApiModelProperty(value = "计量单位ID")
private Long unitId;
/** 计量单位名称 */
@ApiModelProperty(value = "计量单位名称")
@Excel(name = "计量单位")
private String unitName;
/** 管理方式(0编号 1计数) */
@Excel(name = "管理方式(0编号 1计数)")
@Excel(name = "管理方式(0编号 1计数)", readConverterExp = "0=编号,1=计数")
@ApiModelProperty(value = "管理方式(0编号 1计数)")
private String manageType;
@ -131,7 +130,6 @@ public class Type extends BaseEntity {
private BigDecimal taxRatio;
/** 层级 */
@Excel(name = "层级")
@ApiModelProperty(value = "层级")
private String level;

View File

@ -17,15 +17,15 @@ import lombok.Setter;
@Setter
public class MaTypeVo extends Type {
@Excel(name = "施工类型")
@Excel(name = "施工类型", sort = 1)
@ApiModelProperty(value = "施工类型")
private String itemType;
@Excel(name = "物资类型")
@Excel(name = "物资类型", sort = 2)
@ApiModelProperty(value = "物资类型")
private String materialType;
@Excel(name = "物资名称")
@Excel(name = "物资名称", sort = 3)
@ApiModelProperty(value = "物资名称")
private String materialName;

View File

@ -168,7 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskId != null">task_id = #{taskId},</if>
<if test="leasePerson != null">lease_person = #{leasePerson},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="type != null">type = #{type},</if>
<if test="type != null">`type` = #{type},</if>
<if test="companyAuditBy != null">company_audit_by = #{companyAuditBy},</if>
<if test="companyAuditTime != null">company_audit_time = #{companyAuditTime},</if>
<if test="companyAuditRemark != null">company_audit_remark = #{companyAuditRemark},</if>
@ -178,10 +178,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="directAuditBy != null">direct_audit_by = #{directAuditBy},</if>
<if test="directAuditTime != null">direct_audit_time = #{directAuditTime},</if>
<if test="directAuditRemark != null">direct_audit_remark = #{directAuditRemark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
update_time = now(),
<if test="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="directId != null">direct_id = #{directId},</if>

View File

@ -154,8 +154,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectTypeByTypeId" parameterType="Long" resultMap="TypeResult">
<include refid="selectTypeVo"/>
where type_id = #{typeId}
SELECT
t.type_id,t.type_name,t.parent_id,t.storage_num,t.type_code,
t.model_code,t.unit_id,t.unit_name,t.manage_type,t.lease_price,t.eff_time,
t.rent_price,t.buy_price,t.pay_ratio,t.pay_price,t.tax_ratio,t.level,t.rated_load,t.test_load,
t.holding_time,t.warn_num,t.create_by,t.create_time,t.update_by,t.update_time,t.is_plan,
t.is_ancuo,t.remark,t.fac_model,t.intelligent_code,
su.user_name as keeper_nick_name,
su2.user_name as repair_nick_name
FROM ma_type AS t
left join ma_type_keeper mtk on t.type_id = mtk.type_id
left join ma_type_repair mtr on t.type_id = mtr.type_id
left join sys_user su on mtk.user_id = su.user_id
left join sys_user su2 on mtr.user_id = su2.user_id
WHERE t.type_id = #{typeId}
</select>
<select id="selectParentId" resultType="java.lang.Integer">
@ -503,16 +515,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.rated_load as ratedLoad,
m.test_load as testLoad,
m.holding_time as holdingTime,
m.remark as remark,
m.fac_model AS facModel
m.remark as remark,whi.house_name as houseName,
m.fac_model AS facModel,su.user_name as keeperNickName,su2.user_name as repairNickName
FROM
ma_type m
LEFT JOIN ma_type m1 ON m.parent_id = m1.type_id
and m1.del_flag = '0'
LEFT JOIN ma_type m2 ON m1.parent_id = m2.type_id
and m2.del_flag = '0'
LEFT JOIN ma_type m3 ON m2.parent_id = m3.type_id
and m3.del_flag = '0'
LEFT JOIN ma_type m1 ON m.parent_id = m1.type_id and m1.del_flag = '0'
LEFT JOIN ma_type m2 ON m1.parent_id = m2.type_id and m2.del_flag = '0'
LEFT JOIN ma_type m3 ON m2.parent_id = m3.type_id and m3.del_flag = '0'
left join ma_type_keeper mtk on m.type_id = mtk.type_id
left join ma_type_repair mtr on m.type_id = mtr.type_id
left join sys_user su on mtk.user_id = su.user_id
left join sys_user su2 on mtr.user_id = su2.user_id
left join wh_house_set whs on m.type_id = whs.type_id
left join wh_house_info whi on whs.house_id = whi.house_id
WHERE m.parent_id = #{typeId} and m.del_flag = '0'
<if test="type.keyword != null and type.keyword !=''">
AND (m.type_name like concat('%',#{type.keyword},'%')