修改OTA操作历史

This commit is contained in:
高嵩
2023-08-24 09:05:39 +08:00
parent fa01acf6e6
commit dd7539c666
6 changed files with 1391 additions and 1204 deletions
@@ -5,6 +5,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.ota.entity.OtaManageHistory; import com.jero.modules.ota.entity.OtaManageHistory;
import com.jero.modules.ota.service.IOtaManageHistoryService; import com.jero.modules.ota.service.IOtaManageHistoryService;
@@ -48,7 +49,7 @@ public class OtaManageHistoryController extends JeroController<OtaManageHistory,
@AutoLog(value = "OTA管理列表历史记录-分页列表查询") @AutoLog(value = "OTA管理列表历史记录-分页列表查询")
@ApiOperation(value="OTA管理列表历史记录-分页列表查询", notes="OTA管理列表历史记录-分页列表查询") @ApiOperation(value="OTA管理列表历史记录-分页列表查询", notes="OTA管理列表历史记录-分页列表查询")
@GetMapping(value = "/page") @GetMapping(value = "/page")
public Result<?> queryPageList(OtaManageHistory otaManageHistory, public Result<?> queryPageList(OtaManageHistory otaManageHistory,String cut,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
@@ -56,6 +57,14 @@ public class OtaManageHistoryController extends JeroController<OtaManageHistory,
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time");
Page<OtaManageHistory> page = new Page<OtaManageHistory>(pageNo, pageSize); Page<OtaManageHistory> page = new Page<OtaManageHistory>(pageNo, pageSize);
IPage<OtaManageHistory> pageList = otaManageHistoryService.page(page, queryWrapper); IPage<OtaManageHistory> pageList = otaManageHistoryService.page(page, queryWrapper);
List<OtaManageHistory> records = pageList.getRecords();
for (OtaManageHistory omh : records) {
if (CutEnum.CN.getValue().equals(cut)) {
omh.setContent(omh.getContentCn());
} else {
omh.setContent(omh.getContentEn());
}
}
return Result.OK(pageList); return Result.OK(pageList);
} }
@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@@ -66,8 +67,18 @@ public class OtaManageHistory implements Serializable {
@ApiModelProperty(value = "关联applyID") @ApiModelProperty(value = "关联applyID")
private String applyId; private String applyId;
/**操作记录*/ /**操作记录cn*/
@Excel(name = "操作记录", width = 15) @Excel(name = "操作记录cn", width = 15)
@ApiModelProperty(value = "操作记录cn")
private String contentCn;
/**操作记录en*/
@Excel(name = "操作记录en", width = 15)
@ApiModelProperty(value = "操作记录en")
private String contentEn;
@TableField(exist = false)
@ApiModelProperty(value = "操作记录") @ApiModelProperty(value = "操作记录")
private String content; private String content;
@@ -21,7 +21,7 @@ public interface IOtaManageHistoryService extends IService<OtaManageHistory> {
void add(OtaManageHistory otaManageHistory); void add(OtaManageHistory otaManageHistory);
void add(String appId,String content); void add(String appId,String contentCn, String contentEn);
/** /**
* 更新 * 更新
@@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class OtaManageHistoryServiceImpl extends ServiceImpl<OtaManageHistoryMapper, OtaManageHistory> implements IOtaManageHistoryService { public class OtaManageHistoryServiceImpl extends ServiceImpl<OtaManageHistoryMapper, OtaManageHistory> implements IOtaManageHistoryService {
/** /**
* 保存 * 保存
* *
@@ -32,10 +33,11 @@ public class OtaManageHistoryServiceImpl extends ServiceImpl<OtaManageHistoryMap
} }
@Override @Override
public void add(String appId,String content) { public void add(String appId, String contentCn, String contentEn) {
OtaManageHistory his = new OtaManageHistory(); OtaManageHistory his = new OtaManageHistory();
his.setApplyId(appId); his.setApplyId(appId);
his.setContent(content); his.setContentCn(contentCn);
his.setContentEn(contentEn);
this.add(his); this.add(his);
} }
@@ -15,6 +15,8 @@ public enum CertificationProgressEnum {
COMPONENT_REPORT_NOT_SUBMITTED("部件报告未提交","Component report not submitted","5"), COMPONENT_REPORT_NOT_SUBMITTED("部件报告未提交","Component report not submitted","5"),
COMPONENT_REPORT_SUBMITTED("部件报告已提交","Component report submitted","6"), COMPONENT_REPORT_SUBMITTED("部件报告已提交","Component report submitted","6"),
COMPONENT_REPORT_HAS_BEEN_STORED("部件报告已入库","Component report has been stored","7"), COMPONENT_REPORT_HAS_BEEN_STORED("部件报告已入库","Component report has been stored","7"),
NA("空","null","8"),
; ;
String name; String name;
@@ -74,4 +76,14 @@ public enum CertificationProgressEnum {
} }
return null; return null;
} }
public static CertificationProgressEnum getByValue(String value) {
CertificationProgressEnum[] values = values();
for (CertificationProgressEnum certificationProgressEnum : values) {
if (certificationProgressEnum.value.equals(value)) {
return certificationProgressEnum;
}
}
return NA;
}
} }