现场维修
This commit is contained in:
parent
002f325cb1
commit
108d3c7d95
|
|
@ -46,46 +46,77 @@ public class MaterialConstants {
|
||||||
|
|
||||||
public final static String STRING_ADMIN = "admin";
|
public final static String STRING_ADMIN = "admin";
|
||||||
|
|
||||||
/** 新购号的开头字母 */
|
/**
|
||||||
|
* 新购号的开头字母
|
||||||
|
*/
|
||||||
public final static String PURCHASE_TASK_TYPE_LABEL = "XG";
|
public final static String PURCHASE_TASK_TYPE_LABEL = "XG";
|
||||||
|
|
||||||
/** 协议号的开头字母 */
|
/**
|
||||||
|
* 协议号的开头字母
|
||||||
|
*/
|
||||||
public static final String AGREEMENT_PREFIX = "H";
|
public static final String AGREEMENT_PREFIX = "H";
|
||||||
|
|
||||||
/** 领料单号的开头字母 */
|
/**
|
||||||
|
* 领料单号的开头字母
|
||||||
|
*/
|
||||||
public static final String LEASE_TASK_TYPE_LABEL = "L";
|
public static final String LEASE_TASK_TYPE_LABEL = "L";
|
||||||
|
|
||||||
/** 机具公司领料单号的开头字母 */
|
/**
|
||||||
|
* 机具公司领料单号的开头字母
|
||||||
|
*/
|
||||||
public static final String JJ_LEASE_TASK_TYPE_LABEL = "JJL";
|
public static final String JJ_LEASE_TASK_TYPE_LABEL = "JJL";
|
||||||
|
|
||||||
/** 安全工器具领料单号的开头字母 */
|
/**
|
||||||
|
* 安全工器具领料单号的开头字母
|
||||||
|
*/
|
||||||
public static final String AQ_LEASE_TASK_TYPE_LABEL = "AQL";
|
public static final String AQ_LEASE_TASK_TYPE_LABEL = "AQL";
|
||||||
|
|
||||||
/** 宏源领料单号的开头字母 */
|
/**
|
||||||
|
* 宏源领料单号的开头字母
|
||||||
|
*/
|
||||||
public static final String HY_LEASE_TASK_TYPE_LABEL = "HYL";
|
public static final String HY_LEASE_TASK_TYPE_LABEL = "HYL";
|
||||||
|
|
||||||
/** 退料单号的开头字母 */
|
/**
|
||||||
|
* 退料单号的开头字母
|
||||||
|
*/
|
||||||
public static final String BACK_TASK_TYPE_LABEL = "T";
|
public static final String BACK_TASK_TYPE_LABEL = "T";
|
||||||
|
|
||||||
/** 维修单号的开头字母 */
|
/**
|
||||||
|
* 维修单号的开头字母
|
||||||
|
*/
|
||||||
public static final String REPAIR_TASK_TYPE_LABEL = "WX";
|
public static final String REPAIR_TASK_TYPE_LABEL = "WX";
|
||||||
|
|
||||||
/** 维修审核单号的开头字母 */
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修审核单号的开头字母
|
||||||
|
*/
|
||||||
public static final String REPAIR_AUDIT_TYPE_LABEL = "WS";
|
public static final String REPAIR_AUDIT_TYPE_LABEL = "WS";
|
||||||
|
|
||||||
/** 报废单号的开头字母 */
|
/**
|
||||||
|
* 报废单号的开头字母
|
||||||
|
*/
|
||||||
public static final String SCRAP_TASK_TYPE_LABEL = "BF";
|
public static final String SCRAP_TASK_TYPE_LABEL = "BF";
|
||||||
|
|
||||||
/** 盘点报废单号的开头字母 */
|
/**
|
||||||
|
* 盘点报废单号的开头字母
|
||||||
|
*/
|
||||||
public static final String PD_SCRAP_TASK_TYPE_LABEL = "PDB";
|
public static final String PD_SCRAP_TASK_TYPE_LABEL = "PDB";
|
||||||
|
|
||||||
/** 修饰入库单号的开头字母 */
|
/**
|
||||||
|
* 修饰入库单号的开头字母
|
||||||
|
*/
|
||||||
public static final String REPAIR_INPUT_TASK_TYPE_LABEL = "R";
|
public static final String REPAIR_INPUT_TASK_TYPE_LABEL = "R";
|
||||||
|
|
||||||
/** 配件新购号的开头字母 */
|
/**
|
||||||
|
* 配件新购号的开头字母
|
||||||
|
*/
|
||||||
public final static String PART_TASK_TYPE_LABEL = "PJXG";
|
public final static String PART_TASK_TYPE_LABEL = "PJXG";
|
||||||
|
|
||||||
/** 配件领料单号的开头字母 */
|
/**
|
||||||
|
* 配件领料单号的开头字母
|
||||||
|
*/
|
||||||
public static final String PART_LEASE_TASK_TYPE_LEASE = "LP";
|
public static final String PART_LEASE_TASK_TYPE_LEASE = "LP";
|
||||||
|
|
||||||
/** 现场维修的开头字母 */
|
/** 现场维修的开头字母 */
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.codeCollection.domain.WsMaInfo;
|
import com.bonus.material.codeCollection.domain.WsMaInfo;
|
||||||
import com.bonus.material.codeCollection.service.WsMaInfoService;
|
import com.bonus.material.codeCollection.service.WsMaInfoService;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
|
@ -25,7 +26,6 @@ public class WsMaInfoController extends BaseController {
|
||||||
private WsMaInfoService service;
|
private WsMaInfoService service;
|
||||||
|
|
||||||
@ApiOperation(value = "根据ID获取机具信息")
|
@ApiOperation(value = "根据ID获取机具信息")
|
||||||
@PreventRepeatSubmit
|
|
||||||
@SysLog(title = "机具信息查询", businessType = OperaType.QUERY, logType = 1, module = "机具管理->查询")
|
@SysLog(title = "机具信息查询", businessType = OperaType.QUERY, logType = 1, module = "机具管理->查询")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public AjaxResult getById(@PathVariable Integer id) {
|
public AjaxResult getById(@PathVariable Integer id) {
|
||||||
|
|
@ -33,7 +33,6 @@ public class WsMaInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询所有机具信息列表")
|
@ApiOperation(value = "查询所有机具信息列表")
|
||||||
@PreventRepeatSubmit
|
|
||||||
@SysLog(title = "机具信息列表查询", businessType = OperaType.QUERY, logType = 1, module = "机具管理->查询")
|
@SysLog(title = "机具信息列表查询", businessType = OperaType.QUERY, logType = 1, module = "机具管理->查询")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult getAll() {
|
public AjaxResult getAll() {
|
||||||
|
|
@ -42,15 +41,15 @@ public class WsMaInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "新增机具信息")
|
@ApiOperation(value = "新增机具信息")
|
||||||
@PreventRepeatSubmit
|
|
||||||
@SysLog(title = "机具信息新增", businessType = OperaType.INSERT, logType = 1, module = "机具管理->新增")
|
@SysLog(title = "机具信息新增", businessType = OperaType.INSERT, logType = 1, module = "机具管理->新增")
|
||||||
@PostMapping("/addWsMaInfo")
|
@PostMapping("/addWsMaInfo")
|
||||||
public AjaxResult save(@RequestBody WsMaInfo info) {
|
public AjaxResult save(@RequestBody WsMaInfo info) {
|
||||||
|
info.setOptUser(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||||
|
|
||||||
return service.save(info);
|
return service.save(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "更新机具信息")
|
@ApiOperation(value = "更新机具信息")
|
||||||
@PreventRepeatSubmit
|
|
||||||
@SysLog(title = "机具信息更新", businessType = OperaType.UPDATE, logType = 1, module = "机具管理->更新")
|
@SysLog(title = "机具信息更新", businessType = OperaType.UPDATE, logType = 1, module = "机具管理->更新")
|
||||||
@PostMapping("/updateWsMaInfo")
|
@PostMapping("/updateWsMaInfo")
|
||||||
public AjaxResult update(@RequestBody WsMaInfo info) {
|
public AjaxResult update(@RequestBody WsMaInfo info) {
|
||||||
|
|
@ -58,7 +57,6 @@ public class WsMaInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除机具信息")
|
@ApiOperation(value = "删除机具信息")
|
||||||
@PreventRepeatSubmit
|
|
||||||
@SysLog(title = "机具信息删除", businessType = OperaType.DELETE, logType = 1, module = "机具管理->删除")
|
@SysLog(title = "机具信息删除", businessType = OperaType.DELETE, logType = 1, module = "机具管理->删除")
|
||||||
@PostMapping("/{id}")
|
@PostMapping("/{id}")
|
||||||
public AjaxResult delete(@PathVariable Integer id) {
|
public AjaxResult delete(@PathVariable Integer id) {
|
||||||
|
|
@ -66,7 +64,6 @@ public class WsMaInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "获取机具类型")
|
@ApiOperation(value = "获取机具类型")
|
||||||
@PreventRepeatSubmit
|
|
||||||
@SysLog(title = "获取机具类型", businessType = OperaType.DELETE, logType = 1, module = "获取机具类型")
|
@SysLog(title = "获取机具类型", businessType = OperaType.DELETE, logType = 1, module = "获取机具类型")
|
||||||
@PostMapping("/getMaTypeData")
|
@PostMapping("/getMaTypeData")
|
||||||
public AjaxResult getMaTypeData() {
|
public AjaxResult getMaTypeData() {
|
||||||
|
|
@ -74,11 +71,18 @@ public class WsMaInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "获取机具类型")
|
@ApiOperation(value = "获取机具规格")
|
||||||
@PreventRepeatSubmit
|
@SysLog(title = "获取机具规格", businessType = OperaType.DELETE, logType = 1, module = "获取机具规格")
|
||||||
@SysLog(title = "获取机具类型", businessType = OperaType.DELETE, logType = 1, module = "获取机具类型")
|
|
||||||
@PostMapping("/getMaModeData")
|
@PostMapping("/getMaModeData")
|
||||||
public AjaxResult getMaModeData(@RequestParam Integer parentId) {
|
public AjaxResult getMaModeData(@RequestBody WsMaInfo info) {
|
||||||
return service.getMaModeData(parentId);
|
return service.getMaModeData(info.getParentId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取出厂厂家")
|
||||||
|
@SysLog(title = "获取出厂厂家", businessType = OperaType.DELETE, logType = 1, module = "获取出厂厂家")
|
||||||
|
@PostMapping("/getSupplier")
|
||||||
|
public AjaxResult getSupplier() {
|
||||||
|
return service.getSupplier();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@ public class WsMaInfo {
|
||||||
* 主键,自增ID
|
* 主键,自增ID
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 父类id
|
||||||
|
*/
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机具名称,如“电焊机”、“搅拌机”
|
* 机具名称,如“电焊机”、“搅拌机”
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.codeCollection.mapper;
|
||||||
import com.bonus.material.codeCollection.domain.WsMaInfo;
|
import com.bonus.material.codeCollection.domain.WsMaInfo;
|
||||||
import org.apache.ibatis.annotations.MapKey;
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -71,4 +72,27 @@ public interface WsMaInfoMapper {
|
||||||
@MapKey("id")
|
@MapKey("id")
|
||||||
List<Map<String, Objects>> getMaModeData(Integer parentId);
|
List<Map<String, Objects>> getMaModeData(Integer parentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取出厂厂家
|
||||||
|
*
|
||||||
|
* @return 出厂厂家集合
|
||||||
|
*/
|
||||||
|
@MapKey("id")
|
||||||
|
List<Map<String, Objects>> getSupplier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断编码是否存在
|
||||||
|
*
|
||||||
|
* @param maModel 规格
|
||||||
|
* @param maCode 编码
|
||||||
|
* @return 条数
|
||||||
|
*/
|
||||||
|
int existsByModelAndCode(@Param("maModel") String maModel, @Param("maCode") String maCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*
|
||||||
|
* @return 条数
|
||||||
|
*/
|
||||||
|
int updateCheckTime(Integer id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,4 +69,12 @@ public interface WsMaInfoService {
|
||||||
* @return 机具规格集合
|
* @return 机具规格集合
|
||||||
*/
|
*/
|
||||||
AjaxResult getMaModeData(Integer parentId);
|
AjaxResult getMaModeData(Integer parentId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取出厂厂家
|
||||||
|
*
|
||||||
|
* @return 出厂厂家集合
|
||||||
|
*/
|
||||||
|
AjaxResult getSupplier();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,11 @@ public class WsMaInfoServiceImpl implements WsMaInfoService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult save(WsMaInfo info) {
|
public AjaxResult save(WsMaInfo info) {
|
||||||
try {
|
try {
|
||||||
|
int i = mapper.existsByModelAndCode(info.getMaModel(), info.getMaCode());
|
||||||
|
if (ObjectUtils.isNotEmpty(i)) {
|
||||||
|
mapper.updateCheckTime(i);
|
||||||
|
return AjaxResult.error("该机具规格与编码已存在,请勿重复添加!");
|
||||||
|
}
|
||||||
int result = mapper.insert(info);
|
int result = mapper.insert(info);
|
||||||
return result > 0 ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
|
return result > 0 ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -144,14 +149,30 @@ public class WsMaInfoServiceImpl implements WsMaInfoService {
|
||||||
/**
|
/**
|
||||||
* 获取机具规格下拉选
|
* 获取机具规格下拉选
|
||||||
*
|
*
|
||||||
* @param parentId
|
* @param parentId 父类id
|
||||||
* @return 机具规格集合
|
* @return 机具规格集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getMaModeData(Integer parentId) {
|
public AjaxResult getMaModeData(Integer parentId) {
|
||||||
try {
|
try {
|
||||||
List<Map<String, Objects>> maTypeData = mapper.getMaModeData(parentId);
|
List<Map<String, Objects>> maModeData = mapper.getMaModeData(parentId);
|
||||||
return ObjectUtils.isNotEmpty(maTypeData) ? AjaxResult.success(maTypeData) : AjaxResult.error("");
|
return ObjectUtils.isNotEmpty(maModeData) ? AjaxResult.success(maModeData) : AjaxResult.error("");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return AjaxResult.error("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取出厂厂家
|
||||||
|
*
|
||||||
|
* @return 出厂厂家集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getSupplier() {
|
||||||
|
try {
|
||||||
|
List<Map<String, Objects>> supplier = mapper.getSupplier();
|
||||||
|
return ObjectUtils.isNotEmpty(supplier) ? AjaxResult.success(supplier) : AjaxResult.error("");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
return AjaxResult.error("");
|
return AjaxResult.error("");
|
||||||
|
|
|
||||||
|
|
@ -106,4 +106,33 @@ public class FieldMaintenanceController extends BaseController {
|
||||||
return error();
|
return error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "提交任务")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@SysLog(title = "现场维修任务", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->删除任务")
|
||||||
|
@PostMapping("/deleteFieldApplyDetailsById")
|
||||||
|
public AjaxResult deleteFieldApplyDetailsById(@RequestBody FieldApplyDetails fieldApplyDetails) {
|
||||||
|
try {
|
||||||
|
return fieldMaintenanceService.deleteFieldApplyDetailsById(fieldApplyDetails.getParentId(), fieldApplyDetails.getTypeId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "提交任务")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@SysLog(title = "现场维修任务", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->删除任务")
|
||||||
|
@PostMapping("/insertDetails")
|
||||||
|
public AjaxResult insertDetails(@RequestBody List<FieldApplyDetails> fieldApplyDetailsList) {
|
||||||
|
// 示例逻辑:遍历每条记录
|
||||||
|
for (FieldApplyDetails detail : fieldApplyDetailsList) {
|
||||||
|
// TODO: 插入数据库,例如调用 service.insert(detail)
|
||||||
|
System.out.println("处理 detail: " + detail);
|
||||||
|
fieldMaintenanceService.insertDetails(detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success("插入成功,共 " + fieldApplyDetailsList.size() + " 条");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@ package com.bonus.material.fieldMaintenance.domain;
|
||||||
import com.bonus.common.biz.domain.BmFileInfo;
|
import com.bonus.common.biz.domain.BmFileInfo;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import com.bonus.material.back.domain.MaCodeDto;
|
import com.bonus.material.back.domain.MaCodeDto;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
|
|
@ -94,4 +96,24 @@ public class FieldApplyDetails {
|
||||||
private Integer isFinished;
|
private Integer isFinished;
|
||||||
|
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.fieldMaintenance.mapper;
|
||||||
|
|
||||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
||||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -41,5 +42,7 @@ public interface FieldMaintenanceMapper {
|
||||||
*/
|
*/
|
||||||
int deleteFieldApplyInfoById(Integer id);
|
int deleteFieldApplyInfoById(Integer id);
|
||||||
|
|
||||||
|
int deleteFieldApplyDetailsById(@Param("id") Long id, @Param("typeId") Long typeId);
|
||||||
|
|
||||||
|
int insertDetails(FieldApplyDetails fieldApplyDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
||||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -49,4 +50,11 @@ public interface FieldMaintenanceService {
|
||||||
* @return 条数
|
* @return 条数
|
||||||
*/
|
*/
|
||||||
AjaxResult submitTask(Long taskId);
|
AjaxResult submitTask(Long taskId);
|
||||||
|
|
||||||
|
|
||||||
|
AjaxResult deleteFieldApplyDetailsById(Long id,Long typeId);
|
||||||
|
|
||||||
|
|
||||||
|
AjaxResult insertDetails(FieldApplyDetails fieldApplyDetails);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,37 @@ public class FieldMaintenanceImpl implements FieldMaintenanceService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* @param typeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult deleteFieldApplyDetailsById(Long id, Long typeId) {
|
||||||
|
try {
|
||||||
|
int i = fieldMaintenanceMapper.deleteFieldApplyDetailsById(id, typeId);
|
||||||
|
return i > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param fieldApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult insertDetails(FieldApplyDetails fieldApplyDetails) {
|
||||||
|
try {
|
||||||
|
int i = fieldMaintenanceMapper.insertDetails(fieldApplyDetails);
|
||||||
|
return i > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成现场维修任务单号
|
* 生成现场维修任务单号
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,31 @@
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertDetails">
|
||||||
|
INSERT INTO field_apply_details
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="code != null">code,</if>
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="typeId != null">type_id,</if>
|
||||||
|
<if test="preNum != null">pre_num,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="maCode != null">ma_code,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="code != null">#{code},</if>
|
||||||
|
<if test="parentId != null">#{taskId},</if>
|
||||||
|
<if test="typeId != null">#{typeId},</if>
|
||||||
|
<if test="preNum != null">#{preNum},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="maCode != null">#{maCode},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="deleteFieldApplyInfoById" parameterType="java.lang.Integer">
|
<update id="deleteFieldApplyInfoById" parameterType="java.lang.Integer">
|
||||||
UPDATE field_apply_info
|
UPDATE field_apply_info
|
||||||
|
|
@ -33,6 +58,12 @@
|
||||||
update_time = NOW()
|
update_time = NOW()
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<delete id="deleteFieldApplyDetailsById">
|
||||||
|
DELETE
|
||||||
|
FROM field_apply_details
|
||||||
|
WHERE parent_id = #{id}
|
||||||
|
and type_id = #{typeId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="selectFieldApplyInfoList"
|
<select id="selectFieldApplyInfoList"
|
||||||
resultType="com.bonus.material.fieldMaintenance.domain.FieldApplyInfo">
|
resultType="com.bonus.material.fieldMaintenance.domain.FieldApplyInfo">
|
||||||
|
|
@ -127,7 +158,6 @@
|
||||||
resultType="com.bonus.material.fieldMaintenance.domain.FieldApplyDetails">
|
resultType="com.bonus.material.fieldMaintenance.domain.FieldApplyDetails">
|
||||||
SELECT
|
SELECT
|
||||||
fad.id AS id,
|
fad.id AS id,
|
||||||
fad.CODE AS CODE,
|
|
||||||
fad.parent_id AS parentId,
|
fad.parent_id AS parentId,
|
||||||
fad.type_id AS typeId,
|
fad.type_id AS typeId,
|
||||||
mt2.type_name AS materialType,
|
mt2.type_name AS materialType,
|
||||||
|
|
@ -137,16 +167,10 @@
|
||||||
mt.unit_value AS unitValue,
|
mt.unit_value AS unitValue,
|
||||||
mt.manage_type AS manageType,
|
mt.manage_type AS manageType,
|
||||||
SUM(fad.pre_num) AS preNum,
|
SUM(fad.pre_num) AS preNum,
|
||||||
fad.use_num AS num,
|
|
||||||
fad.STATUS AS STATUS,
|
|
||||||
fad.create_by AS createBy,
|
fad.create_by AS createBy,
|
||||||
fad.create_time AS createTime,
|
fad.create_time AS createTime,
|
||||||
fad.update_by AS updateBy,
|
fad.update_by AS updateBy,
|
||||||
fad.update_time AS updateTime,
|
fad.update_time AS updateTime,
|
||||||
fad.remark AS remark,
|
|
||||||
fad.ap_detection AS apDetection,
|
|
||||||
fad.bad_num AS badNum,
|
|
||||||
fad.good_num AS goodNum,
|
|
||||||
mt.manage_type AS manageType
|
mt.manage_type AS manageType
|
||||||
FROM
|
FROM
|
||||||
field_apply_details fad
|
field_apply_details fad
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,14 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectById" resultMap="BaseResultMap">
|
<select id="selectById" resultMap="BaseResultMap">
|
||||||
SELECT * FROM ws_ma_info WHERE id = #{id}
|
SELECT *
|
||||||
|
FROM ws_ma_info
|
||||||
|
WHERE id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAll" resultMap="BaseResultMap">
|
<select id="selectAll" resultMap="BaseResultMap">
|
||||||
SELECT * FROM ws_ma_info
|
SELECT *
|
||||||
|
FROM ws_ma_info
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMaTypeData" resultType="java.util.Map">
|
<select id="getMaTypeData" resultType="java.util.Map">
|
||||||
|
|
@ -47,20 +50,33 @@
|
||||||
WHERE parent_id = #{parentId}
|
WHERE parent_id = #{parentId}
|
||||||
AND del_flag = '0'
|
AND del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getSupplier" resultType="java.util.Map">
|
||||||
|
SELECT supplier_id AS id,
|
||||||
|
supplier AS `name`
|
||||||
|
FROM ma_supplier_info
|
||||||
|
WHERE del_flag = '0'
|
||||||
|
</select>
|
||||||
|
<select id="existsByModelAndCode" resultType="java.lang.Integer">
|
||||||
|
SELECT id
|
||||||
|
FROM ws_ma_info
|
||||||
|
WHERE ma_model = #{maModel}
|
||||||
|
AND ma_code = #{maCode}
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.bonus.material.codeCollection.domain.WsMaInfo" useGeneratedKeys="true" keyProperty="id">
|
|
||||||
INSERT INTO ws_ma_info (
|
<insert id="insert" parameterType="com.bonus.material.codeCollection.domain.WsMaInfo" useGeneratedKeys="true"
|
||||||
ma_name, ma_model, ma_code, supplier, this_check_time, next_check_time,
|
keyProperty="id">
|
||||||
repair_man, check_man, phone, result, type, model_id, is_active, opt_user, opt_time
|
INSERT INTO ws_ma_info (ma_name, ma_model, ma_code, supplier, this_check_time, next_check_time,
|
||||||
) VALUES (
|
repair_man, check_man, phone, result, type, model_id, is_active, opt_user, opt_time)
|
||||||
#{maName}, #{maModel}, #{maCode}, #{supplier}, #{thisCheckTime}, #{nextCheckTime},
|
VALUES (#{maName}, #{maModel}, #{maCode}, #{supplier}, DATE(now()),
|
||||||
#{repairMan}, #{checkMan}, #{phone}, #{result}, #{type}, #{modelId}, #{isActive}, #{optUser}, #{optTime}
|
DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)),
|
||||||
)
|
#{repairMan}, #{checkMan}, #{phone}, #{result}, #{type}, #{modelId}, #{isActive}, #{optUser}, now())
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="update" parameterType="com.bonus.material.codeCollection.domain.WsMaInfo">
|
<update id="update" parameterType="com.bonus.material.codeCollection.domain.WsMaInfo">
|
||||||
UPDATE ws_ma_info SET
|
UPDATE ws_ma_info
|
||||||
ma_name = #{maName},
|
SET ma_name = #{maName},
|
||||||
ma_model = #{maModel},
|
ma_model = #{maModel},
|
||||||
ma_code = #{maCode},
|
ma_code = #{maCode},
|
||||||
supplier = #{supplier},
|
supplier = #{supplier},
|
||||||
|
|
@ -77,12 +93,19 @@
|
||||||
opt_time = #{optTime}
|
opt_time = #{optTime}
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateCheckTime">
|
||||||
|
UPDATE ws_ma_info
|
||||||
|
SET this_check_time = DATE(now()),
|
||||||
|
next_check_time = DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)),
|
||||||
|
opt_time = DATE(now())
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteById" parameterType="int">
|
<delete id="deleteById" parameterType="int">
|
||||||
DELETE FROM ws_ma_info WHERE id = #{id}
|
DELETE
|
||||||
|
FROM ws_ma_info
|
||||||
|
WHERE id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue