Commit 8a8fb30c authored by fangxinjiang's avatar fangxinjiang

附件信息调整

parent 68fd3939
......@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.io.Serializable;
......
......@@ -162,8 +162,6 @@ public class FileUploadController {
unitAtta.setAttaType(key.substring(key.lastIndexOf(point)));
}
unitAtta.setCreateTime(LocalDateTime.now());
YifuUser user = SecurityUtils.getUser();
unitAtta.setCreateUser(null == user ? "" : user.getId().toString());
return unitAtta;
}
......
......@@ -184,7 +184,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeLog.setEmpId(empId);
tEmployeeLog.setType(type);
tEmployeeLog.setProjectId(empProId);
tEmployeeLog.setContent(content);
tEmployeeLogService.save(tEmployeeLog);
}
......
......@@ -100,6 +100,8 @@ public class ChecksUtil {
checkBankNo.setMessage(message);
checkBankNo.setRemark(getJsonElementValue(resJson.getAsJsonObject().get(ChecksConstants.REMARK)));
checkBankNo.setType(CommonConstants.ONE_STRING);
checkBankNo.setName(name);
checkBankNo.setIdNum(idNum);
}
} else {
// 记录错误日志,正式项目中请换成log打印
......
......@@ -55,8 +55,8 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
**/
@Override
public R<Map<String,TCheckMobile>> checkMobiles(String mobiles){
R<Map<String,TCheckMobile>> mobileMapR;
Map<String,TCheckMobile> checkMobileMap;
R<Map<String,TCheckMobile>> mobileMapR = null;
Map<String,TCheckMobile> checkMobileMap = null;
Map<String,TCheckMobile> existMap = new HashMap<>();
if (Common.isNotNull(mobiles)){
List<String> mobileList = Common.initStrToList(mobiles,CommonConstants.COMMA_STRING);
......@@ -68,13 +68,15 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
.in(TCheckMobile::getMobile,mobileList)
.eq(TCheckMobile::getStatus,CommonConstants.ONE_STRING));
if (Common.isNotNull(checkMobiles)){
checkMobiles.stream().collect(Collectors.toMap(TCheckMobile::getMobile,TCheckMobile -> TCheckMobile));
existMap = checkMobiles.stream().collect(Collectors.toMap(TCheckMobile::getMobile,TCheckMobile -> TCheckMobile));
}
mobileList.removeAll(existMap.values());
mobileList.removeAll(existMap.keySet());
//2.从远处端获取数据
if (Common.isNotNull(mobileList)){
mobileMapR = ChecksUtil.checkMobile(Common.ListToStr(mobileList,CommonConstants.COMMA_STRING),canCheckService.getCanCheck());
if (Common.isEmpty(mobileMapR) && Common.isEmpty(mobileMapR.getData())){
return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR));
if (Common.isEmpty(mobileMapR) || Common.isEmpty(mobileMapR.getData())){
return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR)
+(Common.isNotNull(mobileMapR)?mobileMapR.getMsg():CommonConstants.EMPTY_STRING));
}
checkMobileMap = mobileMapR.getData();
if (Common.isNotNull(mobileList) && Common.isNotNull(checkMobileMap)){
......@@ -93,13 +95,19 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
}
}
}
}
}else {
return R.failed(MsgUtils.getMessage(ErrorCodes.PARAM_NOT_EMPTY));
}
if (Common.isNotNull(checkMobileMap)){
this.saveBatch(checkMobileMap.values());
}else {
checkMobileMap = new HashMap<>();
}
checkMobileMap.putAll(existMap);
if (Common.isEmpty(mobileMapR)){
mobileMapR = new R<>();
}
mobileMapR.setData(checkMobileMap);
return mobileMapR;
}
......
......@@ -16,6 +16,8 @@
package com.yifu.cloud.plus.v1.yifu.common.core.constant;
import java.util.List;
/**
* @author lengleng
* @date 2019/2/1
......@@ -215,4 +217,5 @@ public interface CommonConstants {
**/
public static final int EMPLOYEE_INIT_NO_START = 7;
String SAVE_FAILED = "保存失败!";
String RESULT_EMPTY = "获取结果为空";
}
......@@ -154,4 +154,8 @@ public class Common {
}
return result;
}
public static <T> boolean isNotNull(Collection<T> obj) {
return null != obj && obj.size() > 0;
}
}
......@@ -40,7 +40,10 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>
......@@ -170,6 +173,25 @@ public class DictController {
return R.ok(sysDictItemService.pageItem(page, sysDictItem));
}
/**
* 获取所有字典数据
* @return
*/
@GetMapping("/item/getAllDictItem")
public R<Map<String, Object>> getSysDictItemPage() {
return sysDictItemService.getSysDictItemPage();
}
/**
* 通过id查询父级字典的字典值
* @param itemTypes
* @return R
*/
@SysLog("通过id查询父级字典的字典值")
@GetMapping("/getParentDictItemByTypes")
public R<Map<String, Object>> getParentDictItemByTypes(String itemTypes) {
return sysDictItemService.getParentDictItemByTypes(itemTypes);
}
/**
* 通过id查询字典项
* @param id id
......
......@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
import java.util.Map;
/**
* 字典项
......@@ -57,4 +58,9 @@ public interface SysDictItemService extends IService<SysDictItem> {
IPage<SysDictItem> pageItem(Page page, SysDictItem sysDictItem);
R<Boolean> removeDictItemDiy(Long id);
R<Map<String, Object>> getParentDictItemByTypes(String itemTypes);
R<Map<String, Object>> getSysDictItemPage();
}
......@@ -146,6 +146,43 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return R.ok(baseMapper.deleteById(id) > 0);
}
@Override
public R<Map<String, Object>> getParentDictItemByTypes(String itemTypes) {
if (Common.isEmpty(itemTypes)){
return R.failed(CommonConstants.RESULT_EMPTY);
}
Map<String, Object> resultMap = new HashMap<>();
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.in(SysDictItem::getType,Common.initStrToList(itemTypes,CommonConstants.COMMA_STRING))
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
extracted(allList, resultMap);
return R.ok(resultMap);
}
@Override
public R<Map<String, Object>> getSysDictItemPage() {
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
Map<String, Object> resultMap = new HashMap<>();
extracted(allList, resultMap);
return R.ok(resultMap);
}
private void extracted(List<SysDictItem> allList, Map<String, Object> resultMap) {
if (Common.isNotNull(allList)){
for (SysDictItem item : allList) {
String dictCode = item.getType();
if (resultMap.get(dictCode) == null) {
Map<String, Object> dictMap = new HashMap<String, Object>();
dictMap.put(item.getValue(), item.getLabel());
resultMap.put(dictCode, dictMap);
} else {
Map dictMap = (Map) resultMap.get(dictCode);
dictMap.put(item.getValue(), item.getLabel());
}
}
}
}
/**
* 构建查询的 wrapper
* @param sysDictItem 查询条件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment