设备基础信息 设备是否启用+设备状态

highway
A0010407 1 year ago
parent 8ce0210acb
commit 91c919ea81

@ -7,7 +7,10 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.op.common.core.domain.ExcelCol; import com.op.common.core.domain.ExcelCol;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysUser;
import com.op.wms.domain.EquSpareEquipment; import com.op.wms.domain.EquSpareEquipment;
import com.op.wms.domain.WmsSparePartsLedger; import com.op.wms.domain.WmsSparePartsLedger;
import com.op.wms.service.IBaseEquipmentService; import com.op.wms.service.IBaseEquipmentService;
@ -114,7 +117,6 @@ public class BaseEquipmentController extends BaseController {
/** /**
* *
*/ */
// @RequiresPermissions("wms:equipment:getEquipmentTypeList")
@GetMapping("/getEquipmentTypeList") @GetMapping("/getEquipmentTypeList")
public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) { public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) {
List<BaseEquipment> list = baseEquipmentService.getEquipmentTypeList(baseEquipment); List<BaseEquipment> list = baseEquipmentService.getEquipmentTypeList(baseEquipment);
@ -125,8 +127,8 @@ public class BaseEquipmentController extends BaseController {
* *
*/ */
@GetMapping("/getSparePartsList") @GetMapping("/getSparePartsList")
public TableDataInfo getSparePartsList(BaseEquipment baseEquipment) { public TableDataInfo getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(baseEquipment); List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(wmsSparePartsLedger);
return getDataTable(list); return getDataTable(list);
} }
@ -218,4 +220,14 @@ public class BaseEquipmentController extends BaseController {
return baseEquipmentService.importFile(orderList); return baseEquipmentService.importFile(orderList);
} }
/**
*
*/
@RequiresPermissions("wms:equipment:edit")
@Log(title = "修改设备状态", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody BaseEquipment baseEquipment) {
return toAjax(baseEquipmentService.updateBaseEquipmentStatus(baseEquipment));
}
} }

@ -61,7 +61,7 @@ public class BaseEquipment extends BaseEntity {
private String workshopName; private String workshopName;
/** 设备状态 */ /** 设备状态 */
@Excel(name = "设备状态") @Excel(name = "设备是否启用")
private String status; private String status;
/** 预留字段1 */ /** 预留字段1 */
@ -207,6 +207,10 @@ public class BaseEquipment extends BaseEntity {
@Excel(name = "工厂号") @Excel(name = "工厂号")
private String factoryCode; private String factoryCode;
/** 设备状态 */
@Excel(name = "设备状态")
private String equipmentStatus;
private String imageFileList; private String imageFileList;
private String barCodeFileList; private String barCodeFileList;
@ -619,6 +623,14 @@ public class BaseEquipment extends BaseEntity {
return factoryCode; return factoryCode;
} }
//设备状态
public void setEquipmentStatus(String equipmentStatus) {
this.equipmentStatus = equipmentStatus;
}
public String getEquipmentStatus() {
return equipmentStatus;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -81,7 +81,7 @@ public interface BaseEquipmentMapper {
Long getEquipmentId(String equipmentCode); Long getEquipmentId(String equipmentCode);
//查询备件 //查询备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment); List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//绑定备品备件 //绑定备品备件
public int bindSpareParts(EquSpareEquipment equSpareEquipment); public int bindSpareParts(EquSpareEquipment equSpareEquipment);
@ -107,4 +107,7 @@ public interface BaseEquipmentMapper {
//设备 //设备
BaseEquipment selectExistByEquipmentCode(String equipmentCode); BaseEquipment selectExistByEquipmentCode(String equipmentCode);
//更新设备状态
Integer updateBaseEquipmentStatus(BaseEquipment baseEquipment);
} }

@ -69,11 +69,14 @@ public interface IBaseEquipmentService {
List<BaseEquipment> getEquipmentTypeList(BaseEquipment baseEquipment); List<BaseEquipment> getEquipmentTypeList(BaseEquipment baseEquipment);
//查询设备备品备件 //查询设备备品备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment); List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//查询设备备品备件右侧列表 //查询设备备品备件右侧列表
public List<EquSpareEquipment> getRightSparePartsList(BaseEquipment baseEquipment); public List<EquSpareEquipment> getRightSparePartsList(BaseEquipment baseEquipment);
//导入设备基础数据文件 //导入设备基础数据文件
AjaxResult importFile(List<BaseEquipment> equipmentList); AjaxResult importFile(List<BaseEquipment> equipmentList);
//更改设备状态
int updateBaseEquipmentStatus(BaseEquipment baseEquipment);
} }

@ -372,8 +372,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment) { public List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
return baseEquipmentMapper.getSparePartsList(baseEquipment); return baseEquipmentMapper.getSparePartsList(wmsSparePartsLedger);
} }
/** /**
@ -481,4 +481,19 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
return failEquipment; return failEquipment;
} }
/**
*
*
* @param baseEquipment
* @return
*/
@Override
@DS("#header.poolName")
public int updateBaseEquipmentStatus(BaseEquipment baseEquipment) {
baseEquipment.setUpdateBy(SecurityUtils.getUsername());
baseEquipment.setUpdateTime(DateUtils.getNowDate());
Integer list = baseEquipmentMapper.updateBaseEquipmentStatus(baseEquipment);
return list;
}
} }

@ -47,6 +47,7 @@
<result property="sapAsset" column="sap_asset" /> <result property="sapAsset" column="sap_asset" />
<result property="equipmentHead" column="equipment_head" /> <result property="equipmentHead" column="equipment_head" />
<result property="factoryCode" column="factory_code" /> <result property="factoryCode" column="factory_code" />
<result property="equipmentStatus" column="equipment_status" />
</resultMap> </resultMap>
<resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult"> <resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult">
@ -159,7 +160,9 @@
asset_head, asset_head,
fixed_asset_code, fixed_asset_code,
department, department,
equipment_head equipment_head,
factory_code,
equipment_status
from base_equipment from base_equipment
</sql> </sql>
@ -201,6 +204,7 @@
<if test="department != null and department != ''"> and department = #{department}</if> <if test="department != null and department != ''"> and department = #{department}</if>
<if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if> <if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="equipmentStatus != null and equipmentStatus != ''"> and equipment_status = #{equipmentStatus}</if>
and del_flag ='0' and del_flag ='0'
</where> </where>
</select> </select>
@ -254,6 +258,7 @@
<if test="sapAsset != null">sap_asset,</if> <if test="sapAsset != null">sap_asset,</if>
<if test="equipmentHead != null">equipment_head,</if> <if test="equipmentHead != null">equipment_head,</if>
<if test="factoryCode != null">factory_code,</if> <if test="factoryCode != null">factory_code,</if>
<if test="equipmentStatus != null">equipment_status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if> <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
@ -296,6 +301,7 @@
<if test="sapAsset != null">#{sapAsset},</if> <if test="sapAsset != null">#{sapAsset},</if>
<if test="equipmentHead != null">#{equipmentHead},</if> <if test="equipmentHead != null">#{equipmentHead},</if>
<if test="factoryCode != null">#{factoryCode},</if> <if test="factoryCode != null">#{factoryCode},</if>
<if test="equipmentStatus != null">equipmentStatus,</if>
</trim> </trim>
</insert> </insert>
@ -342,6 +348,7 @@
<if test="sapAsset != null">sap_asset = #{sapAsset},</if> <if test="sapAsset != null">sap_asset = #{sapAsset},</if>
<if test="equipmentHead != null">equipment_head = #{equipmentHead},</if> <if test="equipmentHead != null">equipment_head = #{equipmentHead},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if> <if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="equipmentStatus != null">equipment_status = #{equipmentStatus},</if>
</trim> </trim>
where equipment_id = #{equipmentId} where equipment_id = #{equipmentId}
</update> </update>
@ -514,4 +521,12 @@
and del_flag ='0' and del_flag ='0'
</select> </select>
<update id="updateBaseEquipmentStatus" parameterType="BaseEquipment">
update base_equipment
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
</trim>
where equipment_id = #{equipmentId}
</update>
</mapper> </mapper>
Loading…
Cancel
Save