装备管理 youhua
This commit is contained in:
parent
ef087b8e4a
commit
9d0d798e1a
|
|
@ -174,4 +174,8 @@ public class DevInfoVo extends DevInfo {
|
|||
@ApiModelProperty(value = "订单金额")
|
||||
private BigDecimal cost;
|
||||
|
||||
private String devicenewName;
|
||||
|
||||
private String deviceTypeName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,25 @@
|
|||
package com.bonus.material.equipment.controller;
|
||||
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.basic.domain.BmCompanyAddress;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.equipment.domain.DeptConfigTypeSummary;
|
||||
import com.bonus.material.equipment.domain.DeptEquipmentConfig;
|
||||
import com.bonus.material.equipment.domain.EquipmentDetail;
|
||||
import com.bonus.material.equipment.service.IDeptEquipmentConfigService;
|
||||
import com.bonus.material.equipment.service.ISysDeptService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/equipmentConfig")
|
||||
|
|
@ -16,6 +29,8 @@ public class DeptEquipmentConfigController extends BaseController {
|
|||
@Autowired
|
||||
private IDeptEquipmentConfigService service;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService isyservice;
|
||||
@GetMapping("/{deptId}")
|
||||
public AjaxResult getConfigByDept(@PathVariable Long deptId) {
|
||||
return AjaxResult.success(service.selectByDeptId(deptId));
|
||||
|
|
@ -30,4 +45,36 @@ public class DeptEquipmentConfigController extends BaseController {
|
|||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 导出企业信息列表
|
||||
*/
|
||||
@ApiOperation(value = "导出机械化施工装备配置率")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "机械化施工装备配置率信息", businessType = OperaType.EXPORT, logType = 1,module = "出租方管理->机械化施工装备配置率信息")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, @RequestBody EquipmentDetail equipmentDetail) {
|
||||
try {
|
||||
List<EquipmentDetail> list = isyservice.detailsInfo(equipmentDetail);
|
||||
ExcelUtil<EquipmentDetail> util = new ExcelUtil<EquipmentDetail>(EquipmentDetail.class);
|
||||
util.exportExcel(response, list, "装备详情数据");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 查询机械化施工装备
|
||||
*
|
||||
* 自有装备数据的数量
|
||||
* @param devInfoVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getdeviceInfo")
|
||||
public AjaxResult getdeviceInfo( @RequestBody DevInfoVo devInfoVo) {
|
||||
List<DevInfoVo> list = service.selectDevInfoLists(devInfoVo);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public class EquipmentDetail {
|
|||
private String ifExist;
|
||||
private String orderCount;
|
||||
private String combinedName;
|
||||
private String labelVol;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.equipment.mapper;
|
||||
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.equipment.domain.DeptEquipmentConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -11,4 +12,5 @@ public interface DeptEquipmentConfigMapper {
|
|||
|
||||
int deleteByDeptIdAndTypeId(DeptEquipmentConfig team);
|
||||
|
||||
List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfoVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.equipment.service;
|
||||
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.equipment.domain.DeptEquipmentConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -7,4 +8,6 @@ import java.util.List;
|
|||
public interface IDeptEquipmentConfigService {
|
||||
List<DeptEquipmentConfig> selectByDeptId(Long deptId);
|
||||
int saveBatch( DeptEquipmentConfig configList);
|
||||
|
||||
List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfoVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.equipment.service.impl;
|
||||
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.equipment.domain.ConfigEntity;
|
||||
import com.bonus.material.equipment.domain.DeptEquipmentConfig;
|
||||
import com.bonus.material.equipment.mapper.DeptEquipmentConfigMapper;
|
||||
|
|
@ -7,10 +8,7 @@ import com.bonus.material.equipment.service.IDeptEquipmentConfigService;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class DeptEquipmentConfigServiceImpl implements IDeptEquipmentConfigService {
|
||||
|
|
@ -65,6 +63,13 @@ public class DeptEquipmentConfigServiceImpl implements IDeptEquipmentConfigServi
|
|||
configList.setConfigs(new ArrayList<>(mergedMap.values()));
|
||||
return mapper.insertOrUpdateBatch(configList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfoVo) {
|
||||
List<DevInfoVo> list = mapper.selectDevInfoLists(devInfoVo);
|
||||
return list;
|
||||
}
|
||||
|
||||
private double parseDoubleOrZero(String value) {
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
return 0.0;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,54 @@
|
|||
<select id="selectConfigByDept" resultType="com.bonus.material.equipment.domain.DeptEquipmentConfig">
|
||||
SELECT * FROM dept_equipment_config WHERE dept_id = #{deptId}
|
||||
</select>
|
||||
<select id="selectDevInfoLists" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
SELECT
|
||||
d.ma_id AS maId,
|
||||
d.CODE AS code,
|
||||
d.own_co,
|
||||
CONCAT_WS( '>', mt1.type_name, mt2.type_name, mt3.type_name ) AS deviceTypeName ,
|
||||
d.identify_code AS identifyCode,
|
||||
d.device_name AS deviceName,
|
||||
d.device_weight AS deviceWeight,
|
||||
d.device_count AS deviceCount,
|
||||
d.type_id AS typeId,
|
||||
mt4.type_name AS typeName,
|
||||
mt4.unit_name AS unitName,
|
||||
d.ma_status AS maStatus,
|
||||
d.brand AS brand,
|
||||
d.model_name AS modelName,
|
||||
d.production_date AS productionDate,
|
||||
d.working_hours AS workingHours,
|
||||
d.serial_number AS serialNumber,
|
||||
mt4.lease_price AS dayLeasePrice,
|
||||
d.person AS person,
|
||||
d.person_phone AS personPhone,
|
||||
d.create_time AS createTime,
|
||||
d.update_time AS updateTime,
|
||||
d.own_co AS companyId,
|
||||
sd.dept_name AS companyName,
|
||||
c.operate_address AS operateAddress,
|
||||
mt3.type_id AS thirdId,
|
||||
mt3.type_name AS thirdName,
|
||||
mt2.type_id AS secondId,
|
||||
mt2.type_name AS secondName,
|
||||
mt1.type_id AS firstId,
|
||||
mt1.type_name AS firstName
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id
|
||||
AND mt4.del_flag = '0'
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt4.parent_id
|
||||
AND mt3.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt3.parent_id
|
||||
AND mt2.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = mt2.parent_id
|
||||
AND mt1.del_flag = '0'
|
||||
WHERE
|
||||
d.is_active = '1' and d.device_name=#{devicenewName} AND d.own_co=#{companyName}
|
||||
</select>
|
||||
|
||||
<insert id="insertOrUpdateBatch" parameterType="com.bonus.material.equipment.domain.DeptEquipmentConfig">
|
||||
INSERT INTO ma_dept_config (
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@
|
|||
<select id="detailsInfo" resultType="com.bonus.material.equipment.domain.EquipmentDetail">
|
||||
SELECT
|
||||
d.dept_id AS companyId,
|
||||
d.vol as labelVol,
|
||||
mt3.type_name AS NAME,-- 使用层级表当前类型作为名称
|
||||
d.config_description AS `desc`,
|
||||
d.config_rate AS `value`,
|
||||
|
|
@ -193,9 +194,6 @@
|
|||
LEFT JOIN ( SELECT ma_name, SUM( ma_num ) AS rent_count FROM ma_own_manage WHERE type = '1' AND is_active = '0' AND company_id = #{companyId} GROUP BY ma_name ) rent ON CAST( d.type_id AS CHAR ) = rent.ma_name
|
||||
WHERE
|
||||
d.dept_id = #{companyId}
|
||||
<if test="companyId != null">
|
||||
AND d.dept_id = #{companyId}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="configType == 0">
|
||||
AND d.config_type IN (0, 3)
|
||||
|
|
|
|||
Loading…
Reference in New Issue