优化批量代替标准号接口
This commit is contained in:
+4
@@ -4,6 +4,7 @@ import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@@ -45,5 +46,8 @@ public interface SarStandAttrInfoDao extends BaseMapper<SarStandAttrInfo> {
|
||||
void updateByIdInfo(@Param("id")String id,@Param("fbgbjbd") String fbgbuss,@Param("fbgywbd") String fbgywbd);
|
||||
|
||||
String selectInfoStandId(@Param("standId")String standId);
|
||||
|
||||
@Select("select * from SAR_STAND_ATTR_INFO where stand_id = #{id} and valid_flag=0")
|
||||
SarStandAttrInfo getSarStandAttrInfo(String id);
|
||||
}
|
||||
|
||||
|
||||
+2
-31
@@ -408,39 +408,10 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
if (ObjectUtils.isNotEmpty(sarStandardsInfoEOs) && sarStandardsInfoEOs != null) {
|
||||
for (SarStandardsInfo sarStandardsInfoEO : sarStandardsInfoEOs) {
|
||||
if (sarStandardsInfoEO != null && ObjectUtils.isNotEmpty(sarStandardsInfoEO)) {
|
||||
SarStandAttrInfo sarStandAttrInfo = sarStandAttrInfoEODao.getSarStandAttrInfo(sarStandardsInfoEO.getId());
|
||||
|
||||
//createStandAttrInfo(sarStandardsInfoEO,true);
|
||||
sarStandardsInfoEO.setReplacedStandNum(sarStandAttrInfo.getDtbjh());
|
||||
|
||||
String sarStandAttrEOStr = sarStandardsInfoEO.getSarStandAttrEOStr();
|
||||
// 将字符串转为map进行解析
|
||||
Map<String, String> sarStandAttrMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||
for (Map.Entry<String, String> entry : sarStandAttrMap.entrySet()) {
|
||||
String attrKey = entry.getKey();
|
||||
String attrValue = String.valueOf(entry.getValue());
|
||||
if (InitStandAttrUtil.queryFieldList != null && !InitStandAttrUtil.queryFieldList.isEmpty()) {
|
||||
if (InitStandAttrUtil.queryFieldList.contains(attrKey)) {
|
||||
if ("YYBJ".equals(attrKey)) {
|
||||
sarStandardsInfoEO.setCiteStand(attrValue);
|
||||
} else if ("CBBH".equals(attrKey)) {
|
||||
sarStandardsInfoEO.setRelateStand(attrValue);
|
||||
} else if ("DTBJH".equals(attrKey)) {
|
||||
sarStandardsInfoEO.setReplaceStandNum(attrValue);
|
||||
} else if ("BFDTBZ".equals(attrKey)) {
|
||||
sarStandardsInfoEO.setReplacePartStandNum(attrValue);
|
||||
}
|
||||
// 不同类型存储数据需单独处理值
|
||||
if (InitStandAttrUtil.numFieldList.contains(attrKey)) {
|
||||
if (StringUtils.isBlank(attrValue)) {
|
||||
attrValue = "null";
|
||||
}
|
||||
} else if (InitStandAttrUtil.timeFieldList.contains(attrKey)) {
|
||||
attrValue = FieldConvertUtil.changeTimeValue(attrValue);
|
||||
} else {
|
||||
attrValue = "'" + attrValue + "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(sarStandardsInfoEO.getReplaceStandNum())){
|
||||
dao.updateById(sarStandardsInfoEO);
|
||||
String id = sarStandardsInfoEO.getId();
|
||||
|
||||
Reference in New Issue
Block a user