物资类型导出优化
This commit is contained in:
parent
c10daa8e83
commit
ef0fa628e7
|
|
@ -39,7 +39,7 @@ import javax.annotation.Resource;
|
||||||
@Service
|
@Service
|
||||||
public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ILeaseOutDetailsService leaseOutDetailsService;
|
private ILeaseOutDetailsService leaseOutDetailsService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -157,7 +157,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
if (leaseApplyInfo.getTaskId() == null) {
|
if (leaseApplyInfo.getTaskId() == null) {
|
||||||
return AjaxResult.error("任务ID为空,请完善后重新发布!");
|
return AjaxResult.error("任务ID为空,请完善后重新发布!");
|
||||||
}
|
}
|
||||||
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
try {
|
try {
|
||||||
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,31 @@ public class TypeController extends BaseController {
|
||||||
return getDataTable(list);
|
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 = "查询物资类型管理列表(无分页)")
|
// @ApiOperation(value = "查询物资类型管理列表(无分页)")
|
||||||
// @RequiresPermissions("ma:type:list")
|
// @RequiresPermissions("ma:type:list")
|
||||||
// @GetMapping("/listNoPage")
|
// @GetMapping("/listNoPage")
|
||||||
|
|
@ -60,6 +85,8 @@ public class TypeController extends BaseController {
|
||||||
// return typeService.getMyTypeAndBindUsers(list);
|
// return typeService.getMyTypeAndBindUsers(list);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据左列表类型id查询右表格
|
* 根据左列表类型id查询右表格
|
||||||
*
|
*
|
||||||
|
|
@ -134,19 +161,7 @@ public class TypeController extends BaseController {
|
||||||
return typeService.getMaTypeTreeSelect(typeName, parentId);
|
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, "物资类型管理数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出物资类型管理列表(库管员)
|
* 导出物资类型管理列表(库管员)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class TypeRepairController extends BaseController
|
||||||
@ApiOperation(value = "导出维修班机具配置列表")
|
@ApiOperation(value = "导出维修班机具配置列表")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:repair:export")
|
@RequiresPermissions("ma:repair:export")
|
||||||
@SysLog(title = "维修班机具配置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修班机具配置")
|
@SysLog(title = "维修班机具配置", businessType = OperaType.EXPORT, module = "仓储管理->导出维修班机具配置")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, TypeRepair typeRepair)
|
public void export(HttpServletResponse response, TypeRepair typeRepair)
|
||||||
{
|
{
|
||||||
|
|
@ -83,7 +83,7 @@ public class TypeRepairController extends BaseController
|
||||||
@ApiOperation(value = "新增维修班机具配置")
|
@ApiOperation(value = "新增维修班机具配置")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:repair:add")
|
@RequiresPermissions("ma:repair:add")
|
||||||
@SysLog(title = "维修班机具配置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增维修班机具配置")
|
@SysLog(title = "维修班机具配置", businessType = OperaType.INSERT, module = "仓储管理->新增维修班机具配置")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody List<TypeRepair> typeRepairs)
|
public AjaxResult add(@RequestBody List<TypeRepair> typeRepairs)
|
||||||
{
|
{
|
||||||
|
|
@ -96,7 +96,7 @@ public class TypeRepairController extends BaseController
|
||||||
@ApiOperation(value = "修改维修班机具配置")
|
@ApiOperation(value = "修改维修班机具配置")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:repair:edit")
|
@RequiresPermissions("ma:repair:edit")
|
||||||
@SysLog(title = "维修班机具配置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改维修班机具配置")
|
@SysLog(title = "维修班机具配置", businessType = OperaType.UPDATE, module = "仓储管理->修改维修班机具配置")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody TypeRepair typeRepair)
|
public AjaxResult edit(@RequestBody TypeRepair typeRepair)
|
||||||
{
|
{
|
||||||
|
|
@ -109,7 +109,7 @@ public class TypeRepairController extends BaseController
|
||||||
@ApiOperation(value = "批量删除维修班机具配置")
|
@ApiOperation(value = "批量删除维修班机具配置")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:repair:remove")
|
@RequiresPermissions("ma:repair:remove")
|
||||||
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->批量删除维修班机具配置")
|
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, module = "仓储管理->批量删除维修班机具配置")
|
||||||
@DeleteMapping("/{IDs}")
|
@DeleteMapping("/{IDs}")
|
||||||
public AjaxResult remove(@PathVariable Long[] IDs)
|
public AjaxResult remove(@PathVariable Long[] IDs)
|
||||||
{
|
{
|
||||||
|
|
@ -122,7 +122,7 @@ public class TypeRepairController extends BaseController
|
||||||
@ApiOperation(value = "删除单个维修班机具配置")
|
@ApiOperation(value = "删除单个维修班机具配置")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:repair:remove")
|
@RequiresPermissions("ma:repair:remove")
|
||||||
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除单个维修班机具配置")
|
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, module = "仓储管理->删除单个维修班机具配置")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public AjaxResult remove(@RequestBody List<TypeRepair> typeRepairs)
|
public AjaxResult remove(@RequestBody List<TypeRepair> typeRepairs)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,25 +26,27 @@ public class Type extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 类型ID */
|
/** 类型ID */
|
||||||
@Excel(name = "类型ID")
|
|
||||||
@ApiModelProperty(value = "类型ID")
|
@ApiModelProperty(value = "类型ID")
|
||||||
private Long typeId;
|
private Long typeId;
|
||||||
|
|
||||||
/** 类型名称 */
|
/** 类型名称 */
|
||||||
@Excel(name = "规格型号")
|
@Excel(name = "规格型号", sort = 5)
|
||||||
@ApiModelProperty(value = "类型名称")
|
@ApiModelProperty(value = "类型名称")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
/** 库管员昵称 */
|
/** 库管员昵称 */
|
||||||
@ApiModelProperty(value = "库管员昵称")
|
@ApiModelProperty(value = "库管员昵称")
|
||||||
|
@Excel(name = "库管员昵称")
|
||||||
private String keeperNickName;
|
private String keeperNickName;
|
||||||
|
|
||||||
/** 维修员昵称 */
|
/** 维修员昵称 */
|
||||||
@ApiModelProperty(value = "维修员昵称")
|
@ApiModelProperty(value = "维修员昵称")
|
||||||
|
@Excel(name = "维修员昵称")
|
||||||
private String repairNickName;
|
private String repairNickName;
|
||||||
|
|
||||||
/** 仓库名称 */
|
/** 仓库名称 */
|
||||||
@ApiModelProperty(value = "物资仓库名称")
|
@ApiModelProperty(value = "物资仓库名称")
|
||||||
|
@Excel(name = "物资仓库名称", sort = 6)
|
||||||
private String houseName;
|
private String houseName;
|
||||||
|
|
||||||
/** 仓库Id */
|
/** 仓库Id */
|
||||||
|
|
@ -52,7 +54,6 @@ public class Type extends BaseEntity {
|
||||||
private Long houseId;
|
private Long houseId;
|
||||||
|
|
||||||
/** 上级ID */
|
/** 上级ID */
|
||||||
@Excel(name = "上级ID")
|
|
||||||
@ApiModelProperty(value = "上级ID")
|
@ApiModelProperty(value = "上级ID")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
|
|
@ -70,26 +71,24 @@ public class Type extends BaseEntity {
|
||||||
private Integer testCycle = 0;
|
private Integer testCycle = 0;
|
||||||
|
|
||||||
/** 类型编号 */
|
/** 类型编号 */
|
||||||
@Excel(name = "类型编号")
|
|
||||||
@ApiModelProperty(value = "类型编号")
|
@ApiModelProperty(value = "类型编号")
|
||||||
private String typeCode;
|
private String typeCode;
|
||||||
|
|
||||||
/** 规格编号 */
|
/** 规格编号 */
|
||||||
@Excel(name = "规格编号")
|
|
||||||
@ApiModelProperty(value = "规格编号")
|
@ApiModelProperty(value = "规格编号")
|
||||||
private String modelCode;
|
private String modelCode;
|
||||||
|
|
||||||
/** 计量单位ID */
|
/** 计量单位ID */
|
||||||
@Excel(name = "计量单位ID")
|
|
||||||
@ApiModelProperty(value = "计量单位ID")
|
@ApiModelProperty(value = "计量单位ID")
|
||||||
private Long unitId;
|
private Long unitId;
|
||||||
|
|
||||||
/** 计量单位名称 */
|
/** 计量单位名称 */
|
||||||
@ApiModelProperty(value = "计量单位名称")
|
@ApiModelProperty(value = "计量单位名称")
|
||||||
|
@Excel(name = "计量单位")
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
/** 管理方式(0编号 1计数) */
|
/** 管理方式(0编号 1计数) */
|
||||||
@Excel(name = "管理方式(0编号 1计数)")
|
@Excel(name = "管理方式(0编号 1计数)", readConverterExp = "0=编号,1=计数")
|
||||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||||
private String manageType;
|
private String manageType;
|
||||||
|
|
||||||
|
|
@ -131,7 +130,6 @@ public class Type extends BaseEntity {
|
||||||
private BigDecimal taxRatio;
|
private BigDecimal taxRatio;
|
||||||
|
|
||||||
/** 层级 */
|
/** 层级 */
|
||||||
@Excel(name = "层级")
|
|
||||||
@ApiModelProperty(value = "层级")
|
@ApiModelProperty(value = "层级")
|
||||||
private String level;
|
private String level;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,15 +17,15 @@ import lombok.Setter;
|
||||||
@Setter
|
@Setter
|
||||||
public class MaTypeVo extends Type {
|
public class MaTypeVo extends Type {
|
||||||
|
|
||||||
@Excel(name = "施工类型")
|
@Excel(name = "施工类型", sort = 1)
|
||||||
@ApiModelProperty(value = "施工类型")
|
@ApiModelProperty(value = "施工类型")
|
||||||
private String itemType;
|
private String itemType;
|
||||||
|
|
||||||
@Excel(name = "物资类型")
|
@Excel(name = "物资类型", sort = 2)
|
||||||
@ApiModelProperty(value = "物资类型")
|
@ApiModelProperty(value = "物资类型")
|
||||||
private String materialType;
|
private String materialType;
|
||||||
|
|
||||||
@Excel(name = "物资名称")
|
@Excel(name = "物资名称", sort = 3)
|
||||||
@ApiModelProperty(value = "物资名称")
|
@ApiModelProperty(value = "物资名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="taskId != null">task_id = #{taskId},</if>
|
<if test="taskId != null">task_id = #{taskId},</if>
|
||||||
<if test="leasePerson != null">lease_person = #{leasePerson},</if>
|
<if test="leasePerson != null">lease_person = #{leasePerson},</if>
|
||||||
<if test="phone != null">phone = #{phone},</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="companyAuditBy != null">company_audit_by = #{companyAuditBy},</if>
|
||||||
<if test="companyAuditTime != null">company_audit_time = #{companyAuditTime},</if>
|
<if test="companyAuditTime != null">company_audit_time = #{companyAuditTime},</if>
|
||||||
<if test="companyAuditRemark != null">company_audit_remark = #{companyAuditRemark},</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="directAuditBy != null">direct_audit_by = #{directAuditBy},</if>
|
||||||
<if test="directAuditTime != null">direct_audit_time = #{directAuditTime},</if>
|
<if test="directAuditTime != null">direct_audit_time = #{directAuditTime},</if>
|
||||||
<if test="directAuditRemark != null">direct_audit_remark = #{directAuditRemark},</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="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="remark != null">remark = #{remark},</if>
|
||||||
<if test="companyId != null">company_id = #{companyId},</if>
|
<if test="companyId != null">company_id = #{companyId},</if>
|
||||||
<if test="directId != null">direct_id = #{directId},</if>
|
<if test="directId != null">direct_id = #{directId},</if>
|
||||||
|
|
|
||||||
|
|
@ -154,8 +154,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTypeByTypeId" parameterType="Long" resultMap="TypeResult">
|
<select id="selectTypeByTypeId" parameterType="Long" resultMap="TypeResult">
|
||||||
<include refid="selectTypeVo"/>
|
SELECT
|
||||||
where type_id = #{typeId}
|
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>
|
||||||
|
|
||||||
<select id="selectParentId" resultType="java.lang.Integer">
|
<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.rated_load as ratedLoad,
|
||||||
m.test_load as testLoad,
|
m.test_load as testLoad,
|
||||||
m.holding_time as holdingTime,
|
m.holding_time as holdingTime,
|
||||||
m.remark as remark,
|
m.remark as remark,whi.house_name as houseName,
|
||||||
m.fac_model AS facModel
|
m.fac_model AS facModel,su.user_name as keeperNickName,su2.user_name as repairNickName
|
||||||
FROM
|
FROM
|
||||||
ma_type m
|
ma_type m
|
||||||
LEFT JOIN ma_type m1 ON m.parent_id = m1.type_id
|
LEFT JOIN ma_type m1 ON m.parent_id = m1.type_id and m1.del_flag = '0'
|
||||||
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 m2 ON m1.parent_id = m2.type_id
|
LEFT JOIN ma_type m3 ON m2.parent_id = m3.type_id and m3.del_flag = '0'
|
||||||
and m2.del_flag = '0'
|
left join ma_type_keeper mtk on m.type_id = mtk.type_id
|
||||||
LEFT JOIN ma_type m3 ON m2.parent_id = m3.type_id
|
left join ma_type_repair mtr on m.type_id = mtr.type_id
|
||||||
and m3.del_flag = '0'
|
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'
|
WHERE m.parent_id = #{typeId} and m.del_flag = '0'
|
||||||
<if test="type.keyword != null and type.keyword !=''">
|
<if test="type.keyword != null and type.keyword !=''">
|
||||||
AND (m.type_name like concat('%',#{type.keyword},'%')
|
AND (m.type_name like concat('%',#{type.keyword},'%')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue