移动端主界面
parent
d244e4be9b
commit
b5932fdeb0
@ -0,0 +1,42 @@
|
||||
package com.foreverwin.mesnac.common.controller;
|
||||
|
||||
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
||||
import com.foreverwin.mesnac.common.model.MobileWorkStationData;
|
||||
import com.foreverwin.mesnac.common.service.MobileWorkStationService;
|
||||
import com.foreverwin.modular.core.util.CommonMethods;
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Syngna
|
||||
* @since 2020-01-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobileWorkStations")
|
||||
public class MobileWorkStationController {
|
||||
|
||||
@Autowired
|
||||
public MobileWorkStationService mobileWorkStationService;
|
||||
|
||||
@GetMapping("listMobileWorkStationApplication")
|
||||
public R listMobileWorkStationApplication(String workStation) {
|
||||
|
||||
List<MobileWorkStationData> result;
|
||||
try {
|
||||
String site = CommonMethods.getSite();
|
||||
String user = CommonMethods.getUser();
|
||||
String userBo = HandleEnum.USER.getHandle(site, user);
|
||||
result = mobileWorkStationService.listMobileWorkStationApplication(site, userBo, workStation);
|
||||
}
|
||||
catch (Exception e) {
|
||||
return R.failed(e.getMessage());
|
||||
}
|
||||
return R.ok(result);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.foreverwin.mesnac.common.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.common.model.ActivityOption;
|
||||
import com.foreverwin.mesnac.common.model.MobileWorkStationData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface MobileWorkStationMapper {
|
||||
|
||||
List<ActivityOption> selectActivityOptionList(@Param("activityBoList") List<String> activityBoList);
|
||||
|
||||
List<MobileWorkStationData> selectMobileWorkStationList(@Param("site") String site, @Param("userBo") String userBo, @Param("workStation") String workStation);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.foreverwin.mesnac.common.model;
|
||||
|
||||
public class ActivityOption {
|
||||
|
||||
private String activity;
|
||||
|
||||
private String key;
|
||||
|
||||
private String value;
|
||||
|
||||
public String getActivity() {
|
||||
return activity;
|
||||
}
|
||||
|
||||
public void setActivity(String activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
package com.foreverwin.mesnac.common.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MobileWorkStationData {
|
||||
|
||||
private String workStationBo;
|
||||
|
||||
private String canChangeOperation;
|
||||
|
||||
private String canChangeResource;
|
||||
|
||||
private String defaultOperationBo;
|
||||
|
||||
private String defaultResourceBo;
|
||||
|
||||
private String mainInputPrompt;
|
||||
|
||||
private String sequence;
|
||||
|
||||
private String buttonId;
|
||||
|
||||
private String buttonSize;
|
||||
|
||||
private String label;
|
||||
|
||||
private String imageIcon;
|
||||
|
||||
private String activityBo;
|
||||
|
||||
private String activity;
|
||||
|
||||
private String classOrProgram;
|
||||
|
||||
private List<ActivityOption> activityOptionList;
|
||||
|
||||
public String getWorkStationBo() {
|
||||
return workStationBo;
|
||||
}
|
||||
|
||||
public void setWorkStationBo(String workStationBo) {
|
||||
this.workStationBo = workStationBo;
|
||||
}
|
||||
|
||||
public String getCanChangeOperation() {
|
||||
return canChangeOperation;
|
||||
}
|
||||
|
||||
public void setCanChangeOperation(String canChangeOperation) {
|
||||
this.canChangeOperation = canChangeOperation;
|
||||
}
|
||||
|
||||
public String getCanChangeResource() {
|
||||
return canChangeResource;
|
||||
}
|
||||
|
||||
public void setCanChangeResource(String canChangeResource) {
|
||||
this.canChangeResource = canChangeResource;
|
||||
}
|
||||
|
||||
public String getDefaultOperationBo() {
|
||||
return defaultOperationBo;
|
||||
}
|
||||
|
||||
public void setDefaultOperationBo(String defaultOperationBo) {
|
||||
this.defaultOperationBo = defaultOperationBo;
|
||||
}
|
||||
|
||||
public String getDefaultResourceBo() {
|
||||
return defaultResourceBo;
|
||||
}
|
||||
|
||||
public void setDefaultResourceBo(String defaultResourceBo) {
|
||||
this.defaultResourceBo = defaultResourceBo;
|
||||
}
|
||||
|
||||
public String getMainInputPrompt() {
|
||||
return mainInputPrompt;
|
||||
}
|
||||
|
||||
public void setMainInputPrompt(String mainInputPrompt) {
|
||||
this.mainInputPrompt = mainInputPrompt;
|
||||
}
|
||||
|
||||
public String getSequence() {
|
||||
return sequence;
|
||||
}
|
||||
|
||||
public void setSequence(String sequence) {
|
||||
this.sequence = sequence;
|
||||
}
|
||||
|
||||
public String getButtonId() {
|
||||
return buttonId;
|
||||
}
|
||||
|
||||
public void setButtonId(String buttonId) {
|
||||
this.buttonId = buttonId;
|
||||
}
|
||||
|
||||
public String getButtonSize() {
|
||||
return buttonSize;
|
||||
}
|
||||
|
||||
public void setButtonSize(String buttonSize) {
|
||||
this.buttonSize = buttonSize;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getImageIcon() {
|
||||
return imageIcon;
|
||||
}
|
||||
|
||||
public void setImageIcon(String imageIcon) {
|
||||
this.imageIcon = imageIcon;
|
||||
}
|
||||
|
||||
public String getActivityBo() {
|
||||
return activityBo;
|
||||
}
|
||||
|
||||
public void setActivityBo(String activityBo) {
|
||||
this.activityBo = activityBo;
|
||||
}
|
||||
|
||||
public String getActivity() {
|
||||
return activity;
|
||||
}
|
||||
|
||||
public void setActivity(String activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
public String getClassOrProgram() {
|
||||
return classOrProgram;
|
||||
}
|
||||
|
||||
public void setClassOrProgram(String classOrProgram) {
|
||||
this.classOrProgram = classOrProgram;
|
||||
}
|
||||
|
||||
public List<ActivityOption> getActivityOptionList() {
|
||||
return activityOptionList;
|
||||
}
|
||||
|
||||
public void setActivityOptionList(List<ActivityOption> activityOptionList) {
|
||||
this.activityOptionList = activityOptionList;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.foreverwin.mesnac.common.service;
|
||||
|
||||
|
||||
|
||||
import com.foreverwin.mesnac.common.model.MobileWorkStationData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Syngna
|
||||
* @since 2019-05-30
|
||||
*/
|
||||
public interface MobileWorkStationService {
|
||||
|
||||
List<MobileWorkStationData> listMobileWorkStationApplication(String site, String userBo, String workStation);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.foreverwin.mesnac.common.service.impl;
|
||||
|
||||
import com.foreverwin.mesnac.common.mapper.MobileWorkStationMapper;
|
||||
import com.foreverwin.mesnac.common.model.ActivityOption;
|
||||
import com.foreverwin.mesnac.common.model.MobileWorkStationData;
|
||||
import com.foreverwin.mesnac.common.service.MobileWorkStationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 移动维护服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Syngna
|
||||
* @since 2020-01-04
|
||||
*/
|
||||
@Service
|
||||
public class MobileWorkStationServiceImpl implements MobileWorkStationService {
|
||||
|
||||
@Autowired
|
||||
private MobileWorkStationMapper mobileWorkStationMapper;
|
||||
|
||||
@Override
|
||||
public List<MobileWorkStationData> listMobileWorkStationApplication(String site, String userBo, String workStation) {
|
||||
List<MobileWorkStationData> workStationDataList = mobileWorkStationMapper.selectMobileWorkStationList(site, userBo, workStation);
|
||||
if(workStationDataList == null || workStationDataList.size() == 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> activityList = workStationDataList.stream().map(MobileWorkStationData::getActivityBo).collect(Collectors.toList());
|
||||
List<ActivityOption> activityOptionList = mobileWorkStationMapper.selectActivityOptionList(activityList);
|
||||
for(MobileWorkStationData mobileWorkStationData : workStationDataList) {
|
||||
if(mobileWorkStationData.getActivityOptionList() == null) {
|
||||
mobileWorkStationData.setActivityOptionList(new ArrayList<>());
|
||||
}
|
||||
for(ActivityOption activityOption: activityOptionList) {
|
||||
if(activityOption.getActivity().equals(mobileWorkStationData.getActivity())) {
|
||||
mobileWorkStationData.getActivityOptionList().add(activityOption);
|
||||
}
|
||||
}
|
||||
}
|
||||
return workStationDataList;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.foreverwin.mesnac.common.mapper.MobileWorkStationMapper">
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.MobileWorkStationData">
|
||||
<result column="WORKSTATION_BO" property="workStationBo" />
|
||||
<result column="CAN_CHANGE_OPERATION" property="canChangeOperation" />
|
||||
<result column="CAN_CHANGE_RESOURCE" property="canChangeResource" />
|
||||
<result column="DEFAULT_OPERATION_BO" property="defaultOperationBo" />
|
||||
<result column="DEFAULT_RESOURCE_BO" property="defaultResourceBo" />
|
||||
<result column="MAIN_INPUT_PROMPT" property="mainInputPrompt" />
|
||||
<result column="SEQUENCE" property="sequence" />
|
||||
<result column="BUTTON_ID" property="buttonId" />
|
||||
<result column="BUTTON_SIZE" property="buttonSize" />
|
||||
<result column="LABEL" property="label" />
|
||||
<result column="IMAGE_ICON" property="imageIcon" />
|
||||
<result column="ACTIVITY_BO" property="activityBo" />
|
||||
<result column="ACTIVITY" property="activity" />
|
||||
<result column="CLASS_OR_PROGRAM" property="classOrProgram" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ActivityOptionMap" type="com.foreverwin.mesnac.common.model.ActivityOption">
|
||||
<result column="ACTIVITY" property="activity" />
|
||||
<result column="KEY" property="key" />
|
||||
<result column="VALUE" property="value" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectActivityOptionList" resultMap="ActivityOptionMap">
|
||||
SELECT AC.ACTIVITY, AO.EXEC_UNIT_OPTION AS KEY, SETTING AS VALUE
|
||||
FROM ACTIVITY_OPTION AO
|
||||
INNER JOIN ACTIVITY AC ON AC.HANDLE = AO.ACTIVITY_BO
|
||||
WHERE AC.HANDLE IN
|
||||
<foreach collection="activityBoList" item="item" separator="," close=")" open="(">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectMobileWorkStationList" resultMap="BaseResultMap">
|
||||
SELECT PC.WORKSTATION_BO, PC.CAN_CHANGE_OPERATION, PC.CAN_CHANGE_RESOURCE, PC.DEFAULT_OPERATION_BO, PC.DEFAULT_RESOURCE_BO, PC.MAIN_INPUT_PROMPT,
|
||||
PB.SEQUENCE, PB.BUTTON_ID, PB.BUTTON_SIZE, PB.LABEL, PB.IMAGE_ICON, PA.ACTIVITY_BO, AC.ACTIVITY, AC.CLASS_OR_PROGRAM
|
||||
FROM WORKSTATION WC
|
||||
INNER JOIN POD_CONFIG PC ON WC.HANDLE = PC.WORKSTATION_BO
|
||||
INNER JOIN POD_BUTTON PB ON PB.POD_CONFIG_BO = PC.HANDLE
|
||||
INNER JOIN POD_ACTIVITY PA ON PA.POD_BUTTON_BO = PB.HANDLE
|
||||
INNER JOIN ACTIVITY AC ON AC.HANDLE = PA.ACTIVITY_BO AND AC.ENABLED = 'true'
|
||||
INNER JOIN(
|
||||
SELECT AP.ACTIVITY_OR_GROUP_GBO AS ACTIVITY_BO
|
||||
FROM USER_GROUP_MEMBER UGM
|
||||
INNER JOIN ACTIVITY_PERM AP ON UGM.USER_GROUP_BO = AP.USER_OR_GROUP_GBO
|
||||
WHERE UGM.USER_OR_GROUP_GBO = #{userBo}
|
||||
GROUP BY AP.ACTIVITY_OR_GROUP_GBO
|
||||
)AP ON AP.ACTIVITY_BO = PA.ACTIVITY_BO
|
||||
WHERE WC.SITE = #{site}
|
||||
AND WC.WORKSTATION = #{workStation}
|
||||
AND WC.WORKSTATION_TYPE = 'C'
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.meapi.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.meapi.model.SfcData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-29
|
||||
*/
|
||||
@Repository
|
||||
public interface SfcDataMapper extends BaseMapper<SfcData> {
|
||||
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
package com.foreverwin.mesnac.meapi.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-29
|
||||
*/
|
||||
|
||||
@TableName("SFC_DATA")
|
||||
public class SfcData extends Model<SfcData> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("HANDLE")
|
||||
private String handle;
|
||||
@TableField("SFC_BO")
|
||||
private String sfcBo;
|
||||
@TableField("DATE_TIME")
|
||||
private LocalDateTime dateTime;
|
||||
@TableField("DATA_FIELD")
|
||||
private String dataField;
|
||||
@TableField("DATA_ATTR")
|
||||
private String dataAttr;
|
||||
@TableField("USER_BO")
|
||||
private String userBo;
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
@TableField("MODIFIED_DATE_TIME")
|
||||
private LocalDateTime modifiedDateTime;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getSfcBo() {
|
||||
return sfcBo;
|
||||
}
|
||||
|
||||
public void setSfcBo(String sfcBo) {
|
||||
this.sfcBo = sfcBo;
|
||||
}
|
||||
|
||||
public LocalDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public void setDateTime(LocalDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
public String getDataField() {
|
||||
return dataField;
|
||||
}
|
||||
|
||||
public void setDataField(String dataField) {
|
||||
this.dataField = dataField;
|
||||
}
|
||||
|
||||
public String getDataAttr() {
|
||||
return dataAttr;
|
||||
}
|
||||
|
||||
public void setDataAttr(String dataAttr) {
|
||||
this.dataAttr = dataAttr;
|
||||
}
|
||||
|
||||
public String getUserBo() {
|
||||
return userBo;
|
||||
}
|
||||
|
||||
public void setUserBo(String userBo) {
|
||||
this.userBo = userBo;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getModifiedDateTime() {
|
||||
return modifiedDateTime;
|
||||
}
|
||||
|
||||
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
|
||||
this.modifiedDateTime = modifiedDateTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SFC_BO = "SFC_BO";
|
||||
|
||||
public static final String DATE_TIME = "DATE_TIME";
|
||||
|
||||
public static final String DATA_FIELD = "DATA_FIELD";
|
||||
|
||||
public static final String DATA_ATTR = "DATA_ATTR";
|
||||
|
||||
public static final String USER_BO = "USER_BO";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SfcData{" +
|
||||
"handle = " + handle +
|
||||
", sfcBo = " + sfcBo +
|
||||
", dateTime = " + dateTime +
|
||||
", dataField = " + dataField +
|
||||
", dataAttr = " + dataAttr +
|
||||
", userBo = " + userBo +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
", modifiedDateTime = " + modifiedDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.foreverwin.mesnac.meapi.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.meapi.model.SfcData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-29
|
||||
*/
|
||||
public interface SfcDataService extends IService<SfcData> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<SfcData> selectPage(FrontPage<SfcData> frontPage, SfcData sfcData);
|
||||
|
||||
List<SfcData> selectList(SfcData sfcData);
|
||||
|
||||
/**
|
||||
* 保存SFC的跟追位置
|
||||
*
|
||||
* @param site
|
||||
* @param sfc
|
||||
* @param location
|
||||
*/
|
||||
void saveSfcLocation(String site, String sfc, String location);
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.foreverwin.mesnac.meapi.service.impl;
|
||||
|
||||
import com.foreverwin.mesnac.meapi.service.SfcService;
|
||||
import com.foreverwin.mesnac.meapi.service.WorkCenterService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.meapi.model.SfcData;
|
||||
import com.foreverwin.mesnac.meapi.mapper.SfcDataMapper;
|
||||
import com.foreverwin.mesnac.meapi.service.SfcDataService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Handler;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-29
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SfcDataServiceImpl extends ServiceImpl<SfcDataMapper, SfcData> implements SfcDataService {
|
||||
|
||||
@Autowired
|
||||
private SfcService sfcService;
|
||||
@Autowired
|
||||
private SfcDataMapper sfcDataMapper;
|
||||
@Autowired
|
||||
private WorkCenterService workCenterService;
|
||||
|
||||
@Override
|
||||
public IPage<SfcData> selectPage(FrontPage<SfcData> frontPage, SfcData sfcData) {
|
||||
QueryWrapper<SfcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(sfcData);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SfcData> selectList(SfcData sfcData) {
|
||||
QueryWrapper<SfcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(sfcData);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSfcLocation(String site, String sfc, String location) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,332 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.foreverwin.mesnac.meapi.mapper.SfcDataMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.SfcData">
|
||||
<result column="HANDLE" property="handle" />
|
||||
<result column="SFC_BO" property="sfcBo" />
|
||||
<result column="DATE_TIME" property="dateTime" />
|
||||
<result column="DATA_FIELD" property="dataField" />
|
||||
<result column="DATA_ATTR" property="dataAttr" />
|
||||
<result column="USER_BO" property="userBo" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SFC_BO, DATE_TIME, DATA_FIELD, DATA_ATTR, USER_BO, CREATED_DATE_TIME, MODIFIED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM SFC_DATA
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.SfcData">
|
||||
INSERT INTO SFC_DATA
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="sfcBo!=null">SFC_BO,</if>
|
||||
<if test="dateTime!=null">DATE_TIME,</if>
|
||||
<if test="dataField!=null">DATA_FIELD,</if>
|
||||
<if test="dataAttr!=null">DATA_ATTR,</if>
|
||||
<if test="userBo!=null">USER_BO,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="sfcBo!=null">#{sfcBo},</if>
|
||||
<if test="dateTime!=null">#{dateTime},</if>
|
||||
<if test="dataField!=null">#{dataField},</if>
|
||||
<if test="dataAttr!=null">#{dataAttr},</if>
|
||||
<if test="userBo!=null">#{userBo},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.SfcData">
|
||||
INSERT INTO SFC_DATA
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{sfcBo},
|
||||
#{dateTime},
|
||||
#{dataField},
|
||||
#{dataAttr},
|
||||
#{userBo},
|
||||
#{createdDateTime},
|
||||
#{modifiedDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE SFC_DATA <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
|
||||
<if test="et.sfcBo!=null">SFC_BO=#{et.sfcBo},</if>
|
||||
<if test="et.dateTime!=null">DATE_TIME=#{et.dateTime},</if>
|
||||
<if test="et.dataField!=null">DATA_FIELD=#{et.dataField},</if>
|
||||
<if test="et.dataAttr!=null">DATA_ATTR=#{et.dataAttr},</if>
|
||||
<if test="et.userBo!=null">USER_BO=#{et.userBo},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM SFC_DATA
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM SFC_DATA
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.dateTime!=null"> AND DATE_TIME=#{ew.entity.dateTime}</if>
|
||||
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
|
||||
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
|
||||
<if test="ew.entity.userBo!=null"> AND USER_BO=#{ew.entity.userBo}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,145 @@
|
||||
package com.foreverwin.mesnac.production.controller;
|
||||
|
||||
import com.foreverwin.mesnac.meapi.util.StringUtils;
|
||||
import com.foreverwin.modular.core.exception.BusinessException;
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.foreverwin.modular.core.util.CommonMethods;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.foreverwin.mesnac.meapi.service.SfcDataService;
|
||||
import com.foreverwin.mesnac.meapi.model.SfcData;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/SFC-DATA")
|
||||
public class SfcDataController {
|
||||
|
||||
@Autowired
|
||||
public SfcDataService sfcDataService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getSfcDataById(@PathVariable String id) {
|
||||
return R.ok( sfcDataService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getSfcDataList(SfcData sfcData){
|
||||
List<SfcData> result;
|
||||
QueryWrapper<SfcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(sfcData);
|
||||
result = sfcDataService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<SfcData> frontPage, SfcData sfcData){
|
||||
IPage result;
|
||||
QueryWrapper<SfcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(sfcData);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(SfcData::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(SfcData::getSfcBo, frontPage.getGlobalQuery())
|
||||
.or().like(SfcData::getDataField, frontPage.getGlobalQuery())
|
||||
.or().like(SfcData::getDataAttr, frontPage.getGlobalQuery())
|
||||
.or().like(SfcData::getUserBo, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = sfcDataService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param sfcData 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody SfcData sfcData) {
|
||||
return R.ok(sfcDataService.save(sfcData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param sfcData 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody SfcData sfcData) {
|
||||
return R.ok(sfcDataService.updateById(sfcData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(sfcDataService.removeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除对象
|
||||
* @param ids 实体集合ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
|
||||
public R removeByIds(List<String> ids){
|
||||
return R.ok(sfcDataService.removeByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/saveSfcLocation")
|
||||
public R saveSfcLocation(String sfc, String location) {
|
||||
try {
|
||||
if (StringUtils.isBlank(sfc)) {
|
||||
throw BusinessException.build("SFC不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(location)) {
|
||||
throw BusinessException.build("位置不能为空");
|
||||
}
|
||||
|
||||
String site = CommonMethods.getSite();
|
||||
sfcDataService.saveSfcLocation(site, sfc, location);
|
||||
} catch (Exception e) {
|
||||
return R.failed(e.getMessage());
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue