|
|
@@ -5,24 +5,35 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.muchinfo.mtp.proto.Common;
|
|
|
+import com.muchinfo.mtp.proto.NotifyMI1;
|
|
|
+import com.muchinfo.mtp.proto.PublicMI1;
|
|
|
import com.muchinfo.mtp3century.service.ICommonService;
|
|
|
+import com.muchinfo.mtp3century.service.ISendMsgService;
|
|
|
import com.muchinfo.mtp3century.service.ISystemSetUpService;
|
|
|
import com.muchinfo.mtp3century.utils.AjaxResult;
|
|
|
import com.muchinfo.mtp3century.utils.RedisServiceUtil;
|
|
|
import com.muchinfo.mtp3century.vo.TreeNode;
|
|
|
import com.muchinfo.mtp3common.enumtype.*;
|
|
|
+import com.muchinfo.mtp3common.utils.DateTimeUtils;
|
|
|
import com.muchinfo.mtp3common.vo.PageResult;
|
|
|
+import com.muchinfo.mtp3common.vo.ProtoHelper;
|
|
|
import com.muchinfo.mtp3interface.mapper.*;
|
|
|
import com.muchinfo.mtp3pojos.entity.*;
|
|
|
import com.muchinfo.mtp3pojos.vo.I18nconfig;
|
|
|
import com.muchinfo.mtp3pojos.vo.systemsetup.*;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.amqp.core.Message;
|
|
|
+import org.springframework.amqp.core.MessageProperties;
|
|
|
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
@@ -52,6 +63,22 @@ public class SystemSetUpServiceImpl implements ISystemSetUpService {
|
|
|
private IWskhOpenaccountconfigMapper iWskhOpenaccountconfigMapper;
|
|
|
@Resource
|
|
|
private IDivisionMapper iDivisionMapper;
|
|
|
+ @Resource
|
|
|
+ private IUserinfoMapper iUserinfoMapper;
|
|
|
+ @Resource
|
|
|
+ private ISendMsgService iSendMsgService;
|
|
|
+ @Resource
|
|
|
+ private RabbitTemplate rabbitTemplate;
|
|
|
+ @Resource
|
|
|
+ private IMarketrunstepdetailMapper iMarketrunstepdetailMapper;
|
|
|
+ @Resource
|
|
|
+ private IEnumdicMapper iEnumdicMapper;
|
|
|
+ @Resource
|
|
|
+ private IEnumgroupMapper iEnumgroupMapper;
|
|
|
+ @Resource
|
|
|
+ private IEnumdicitemMapper iEnumdicitemMapper;
|
|
|
+ @Resource
|
|
|
+ private ICertificatetypeconfigMapper iCertificatetypeconfigMapper;
|
|
|
|
|
|
@Override
|
|
|
public PageResult<Systemparam> queryByPage(Integer pageNum, Integer pageSize, HttpServletRequest request) {
|
|
|
@@ -378,22 +405,367 @@ public class SystemSetUpServiceImpl implements ISystemSetUpService {
|
|
|
|
|
|
@Override
|
|
|
public AjaxResult deleteDiv(HttpServletRequest request, Long areaid) {
|
|
|
- Division area = iDivisionMapper.selectOne(new QueryWrapper<Division>().eq("autoid",areaid));
|
|
|
+ Division area = iDivisionMapper.selectOne(new QueryWrapper<Division>().eq("autoid", areaid));
|
|
|
// 三级菜单,直接delete
|
|
|
- if(("district").equals(area.getDivisionlevel()))
|
|
|
- iDivisionMapper.delete(new QueryWrapper<Division>().eq("autoid",areaid));
|
|
|
+ if (("district").equals(area.getDivisionlevel()))
|
|
|
+ iDivisionMapper.delete(new QueryWrapper<Division>().eq("autoid", areaid));
|
|
|
// 二级菜单,删除时需先删掉三级菜单 一级菜单,删除时需先删掉二级菜单
|
|
|
- if(("province").equals(area.getDivisionlevel()) || ("city").equals(area.getDivisionlevel())){
|
|
|
+ if (("province").equals(area.getDivisionlevel()) || ("city").equals(area.getDivisionlevel())) {
|
|
|
List<Division> aList = iDivisionMapper.selectList(new QueryWrapper<Division>().eq("parentcode", area.getDivisioncode()));
|
|
|
if (!aList.isEmpty()) {
|
|
|
return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM025.getCode(), request.getHeader("Accept-Language"));
|
|
|
- }else {
|
|
|
- iDivisionMapper.delete(new QueryWrapper<Division>().eq("autoid",areaid));
|
|
|
+ } else {
|
|
|
+ iDivisionMapper.delete(new QueryWrapper<Division>().eq("autoid", areaid));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult syncTaToCenter(HttpServletRequest request) {
|
|
|
+ List<Userinfo> taList = iUserinfoMapper.queryUserinfoTa();
|
|
|
+
|
|
|
+ //发送银行服务同步信息
|
|
|
+ for (Userinfo ta : taList) {
|
|
|
+ if (ta == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ iSendMsgService.sendCustomerInfo(ta, ta.getAccountid(), "1", 0);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("同步信息发送失败,失败原因:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult updateTransaction(HttpServletRequest request) {
|
|
|
+ Systemmanager user = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
|
+ //发送通知
|
|
|
+ NotifyMI1.UpdateUserTradeRightNtf.Builder builder = NotifyMI1.UpdateUserTradeRightNtf.newBuilder();
|
|
|
+ Common.MessageHead.Builder hd = Common.MessageHead.newBuilder();
|
|
|
+ PublicMI1.NotifyHead.Builder nhd = PublicMI1.NotifyHead.newBuilder();
|
|
|
+ nhd.setNtfMode(0);
|
|
|
+ builder.setNtfHeader(nhd);
|
|
|
+ hd.setFunCode(FunCodeConstants.FuncCode_UpdateUserTradeRightNtf);
|
|
|
+ hd.setClientTime(System.currentTimeMillis());
|
|
|
+ builder.setHeader(hd);
|
|
|
+ builder.setNotifyTime(new SimpleDateFormat(DateTimeUtils.DATETIME_PATTERN).format(new Date()));
|
|
|
+ byte[] body = ProtoHelper.getNTAS(builder.build().toByteArray(), FunCodeConstants.FuncCode_UpdateUserTradeRightNtf);
|
|
|
+ rabbitTemplate.send(SysConstants.RabbitNtfKey, new Message(body, new MessageProperties()));
|
|
|
+ //记录操作日志
|
|
|
+ systemmanagerService.writeOperateLog(SysConstants.BUSINESS_SYSTEMSETTING, "更新交易权限", user, null, null, null);
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult<SystemSetUpDetail> initdetail(HttpServletRequest request) {
|
|
|
+ SystemSetUpDetail result = new SystemSetUpDetail();
|
|
|
+ List<Systemparam> sysparmList = iSystemparamMapper.selectList(new QueryWrapper<Systemparam>()
|
|
|
+ .in("paramcode", "009", "010", "011", "012", "013", "014"));
|
|
|
+ for (Systemparam sp : sysparmList) {
|
|
|
+ switch (sp.getParamcode()) {
|
|
|
+ case SysConstants.SYSPARAM_SETTING_OPEN_MARKET:
|
|
|
+ result.setOpenMarket(sp.getParamvalue());
|
|
|
+ break;
|
|
|
+ case SysConstants.SYSPARAM_SETTING_SETTLEMENT:
|
|
|
+ result.setSettlement(sp.getParamvalue());
|
|
|
+ break;
|
|
|
+ case SysConstants.SYSPARAM_SETTING_SIGN_IN:
|
|
|
+ result.setSignIn(sp.getParamvalue());
|
|
|
+ break;
|
|
|
+ case SysConstants.SYSPARAM_SETTING_SIGN_OUT:
|
|
|
+ result.setSignOut(sp.getParamvalue());
|
|
|
+ break;
|
|
|
+ case SysConstants.SYSPARAM_SETTING_SETTLE_TRADEDAY:
|
|
|
+ result.setOpenMarketDayType(sp.getParamvalue());
|
|
|
+ break;
|
|
|
+ case SysConstants.SYSPARAM_SETTING_SYS_CLEAN:
|
|
|
+ result.setSysclean(sp.getParamvalue());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Systemparam ss = iSystemparamMapper.selectOne(new QueryWrapper<Systemparam>().eq("PARAMCODE", "980"));
|
|
|
+ if (ss != null) {
|
|
|
+ result.setSysparmParaValue(ss.getParamvalue());
|
|
|
+ } else {
|
|
|
+ result.setSysparmParaValue("0");
|
|
|
+ }
|
|
|
+ Systemparam s = iSystemparamMapper.selectOne(new QueryWrapper<Systemparam>().eq("PARAMCODE", "974"));
|
|
|
+ if (s != null && StringUtils.isNotBlank(s.getParamvalue()) && "1.5".equals(s.getParamvalue())) {
|
|
|
+ result.setClearFlag(1);
|
|
|
+ } else {
|
|
|
+ result.setClearFlag(0);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult update(HttpServletRequest request, SystemSetUpDetail param) {
|
|
|
+ Systemmanager user = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
|
+ //更新待开市时间
|
|
|
+ updateSystem(SysConstants.SYSPARAM_SETTING_OPEN_MARKET, param.getOpenMarket(), user.getLogincode(), user.getAutoid());
|
|
|
+ //更新归属交易日
|
|
|
+ updateSystem(SysConstants.SYSPARAM_SETTING_SETTLE_TRADEDAY, param.getOpenMarketDayType(), user.getLogincode(), user.getAutoid());
|
|
|
+ //更新系统结算时间
|
|
|
+ updateSystem(SysConstants.SYSPARAM_SETTING_SETTLEMENT, param.getSettlement(), user.getLogincode(), user.getAutoid());
|
|
|
+ //更新银行签到时间
|
|
|
+ updateSystem(SysConstants.SYSPARAM_SETTING_SIGN_IN, param.getSignIn(), user.getLogincode(), user.getAutoid());
|
|
|
+ //银行签退时间
|
|
|
+ updateSystem(SysConstants.SYSPARAM_SETTING_SIGN_OUT, param.getSignOut(), user.getLogincode(), user.getAutoid());
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(param.getSysclean())) {
|
|
|
+ //系统清算时间
|
|
|
+ updateSystem(SysConstants.SYSPARAM_SETTING_SYS_CLEAN, param.getSysclean(), user.getLogincode(), user.getAutoid());
|
|
|
+ }
|
|
|
+
|
|
|
+ Systemparam p = iSystemparamMapper.selectOne(new QueryWrapper<Systemparam>().eq("PARAMCODE", Constants.SYSPARAM_ID_CONFIG));
|
|
|
+ if (p != null) {
|
|
|
+ p.setParamvalue(String.valueOf(System.currentTimeMillis()));
|
|
|
+ p.setUpdatetime(new Date());
|
|
|
+ iSystemparamMapper.update(p, new QueryWrapper<Systemparam>().eq("PARAMCODE", Constants.SYSPARAM_ID_CONFIG));
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新签退时间通知
|
|
|
+ NotifyMI1.UpdateCheckoutTimeNtf.Builder builder = NotifyMI1.UpdateCheckoutTimeNtf.newBuilder();
|
|
|
+ Common.MessageHead.Builder hd = Common.MessageHead.newBuilder();
|
|
|
+ PublicMI1.NotifyHead.Builder nhd = PublicMI1.NotifyHead.newBuilder();
|
|
|
+ nhd.setNtfMode(0);
|
|
|
+ hd.setFunCode(FunCodeConstants.FuncCode_UpdateCheckoutTimeNtf);
|
|
|
+ hd.setClientTime(System.currentTimeMillis());
|
|
|
+ builder.setNtfHeader(nhd);
|
|
|
+ builder.setNotifyTime(new SimpleDateFormat(DateTimeUtils.DATETIME_PATTERN).format(new Date()));
|
|
|
+ builder.setHeader(hd);
|
|
|
+
|
|
|
+ iSendMsgService.sendMsg(builder.build().toByteArray(), SysConstants.RabbitNtfKey,
|
|
|
+ FunCodeConstants.FuncCode_UpdateCheckoutTimeNtf);
|
|
|
+
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult clearMarketRunPlan(HttpServletRequest request) {
|
|
|
+ Systemmanager user = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
|
+ iMarketrunstepdetailMapper.delete(new QueryWrapper<>());
|
|
|
+ systemmanagerService.writeOperateLog(SysConstants.BUSINESS_SYSTEMSETTING, "清空运行时段", user, null, null, null);
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult<EnumDicsResult> getEnumDics(HttpServletRequest request) {
|
|
|
+ EnumDicsResult enumDicsResult = new EnumDicsResult();
|
|
|
+ List<Enumgroup> enumGroups = new ArrayList<>();
|
|
|
+ List<Enumdic> enumDics = iEnumdicMapper.selectList(new QueryWrapper<Enumdic>()
|
|
|
+ .eq("showflag", 1));
|
|
|
+ for (Enumdic enumDic : enumDics) {
|
|
|
+ Enumgroup eg = iEnumgroupMapper.selectOne(new QueryWrapper<Enumgroup>()
|
|
|
+ .eq("enumgroupid", enumDic.getEnumgroupid()));
|
|
|
+ if (!enumGroups.contains(eg)) {
|
|
|
+ enumGroups.add(eg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ enumDicsResult.setEnumdics(enumDics);
|
|
|
+ enumDicsResult.setEnumgroups(enumGroups);
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), enumDicsResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageResult<EnumDicsPageResult> queryEnumDicItemByPage(EnumDicsPageParam param, HttpServletRequest request) {
|
|
|
+ IPage<EnumDicsPageResult> queryResultIPage;
|
|
|
+ IPage<EnumDicsPageResult> page = new Page<>(param.getPageNum(), param.getPageSize());
|
|
|
+ if(param.getEnumdiccode() == null || param.getIsmappingtobank() == null){
|
|
|
+ param.setModifyflag(1);
|
|
|
+ param.setShowflag(1);
|
|
|
+ queryResultIPage = iEnumdicMapper.queryEnumDicByPage(page,param);
|
|
|
+ }else{
|
|
|
+ param.setEnumitemstatus(1);
|
|
|
+ queryResultIPage = iEnumdicMapper.queryEnumDicItemByPage(page,param);
|
|
|
+ }
|
|
|
+ PageResult<EnumDicsPageResult> result = new PageResult<>();
|
|
|
+ result.setCode(Constants.Success_Code_Design);
|
|
|
+ result.setMessage(AjaxResult.dealMsg(MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language")));
|
|
|
+ result.setPages(queryResultIPage.getPages());
|
|
|
+ result.setCurrent(queryResultIPage.getCurrent());
|
|
|
+ result.setTotal(queryResultIPage.getTotal());
|
|
|
+ result.setPageSize(queryResultIPage.getSize());
|
|
|
+ result.setData(queryResultIPage.getRecords());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult<Enumdic> editEnumDic(Long autoid, Long enumgroupid, HttpServletRequest request) {
|
|
|
+ if (autoid != null && autoid > 0) {
|
|
|
+ Enumdic enumDic = iEnumdicMapper.selectOne(new QueryWrapper<Enumdic>().eq("AUTOID",autoid));
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), enumDic);
|
|
|
+ } else {
|
|
|
+ Enumdic enumDic = new Enumdic();
|
|
|
+ enumDic.setEnumgroupid(enumgroupid);
|
|
|
+ enumDic.setIsmappingtobank(0);
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), enumDic);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult<EnumdicitemVoResult> editEnumDicItem(Long autoid, Long enumdiccode, Integer ismappingtobank, HttpServletRequest request) {
|
|
|
+ EnumdicitemVoResult result = new EnumdicitemVoResult();
|
|
|
+ if (autoid != null) {
|
|
|
+ Enumdicitem enumdicitem = iEnumdicitemMapper.selectOne(new QueryWrapper<Enumdicitem>().eq("autoid",autoid));
|
|
|
+ result.setEnumdicitem(enumdicitem);
|
|
|
+ }
|
|
|
+ if (("certificatetype".equals(enumdiccode)) && autoid != null) {
|
|
|
+ Certificatetypeconfig certificateTypeConfig = iCertificatetypeconfigMapper.selectOne(new QueryWrapper<Certificatetypeconfig>()
|
|
|
+ .eq("enumdicitemid",autoid));
|
|
|
+ result.setConfig(certificateTypeConfig);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult saveEnumDic(Enumdic enumdic, HttpServletRequest request) {
|
|
|
+ Enumdic current = iEnumdicMapper.selectOne(new QueryWrapper<Enumdic>().eq("enumdiccode",enumdic.getEnumdiccode()));
|
|
|
+ if (current != null) {
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM026.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+ enumdic.setItemstatus(SysEnums.CommonStatus.WORK.getCode());
|
|
|
+ enumdic.setShowflag(1);
|
|
|
+ enumdic.setModifyflag(1);
|
|
|
+ if (enumdic.getAutoid() == null || enumdic.getAutoid() <= 0) {
|
|
|
+ iEnumdicMapper.insert(enumdic);
|
|
|
+ } else {
|
|
|
+ iEnumdicMapper.updateById(enumdic);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult updateOrSave(EnumDicItemSave param, HttpServletRequest request) {
|
|
|
+ if (param.getAutoid() != null) {
|
|
|
+ Enumdicitem enumDicItem = iEnumdicitemMapper.selectOne(new QueryWrapper<Enumdicitem>().eq("autoid",param.getAutoid()));
|
|
|
+ Enumdicitem enumDicItemExit = iEnumdicitemMapper.selectOne(new QueryWrapper<Enumdicitem>()
|
|
|
+ .eq("enumdicname", param.getEnumdicname())
|
|
|
+ .eq("enumdiccode",param.getEnumdiccode()));
|
|
|
+ if (enumDicItemExit != null && !param.getEnumdicname().equals(enumDicItem.getEnumdicname())) {
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM027.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+ Enumdicitem enumDicItemExit2 = iEnumdicitemMapper.selectOne(new QueryWrapper<Enumdicitem>()
|
|
|
+ .eq("enumitemname", param.getEnumitemname())
|
|
|
+ .eq("enumdiccode",param.getEnumdiccode()));
|
|
|
+ if (enumDicItemExit2 != null && !param.getEnumitemname().equals(enumDicItem.getEnumitemname())) {
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM028.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+ enumDicItem.setEnumdiccode(param.getEnumdiccode());
|
|
|
+ enumDicItem.setEnumdicname(param.getEnumdicname());
|
|
|
+ enumDicItem.setEnumitemname(param.getEnumitemname());
|
|
|
+ enumDicItem.setBankmappedvalue(param.getBankmappedvalue());
|
|
|
+ enumDicItem.setRemark(param.getRemark());
|
|
|
+ iEnumdicitemMapper.updateById(enumDicItem);
|
|
|
+ if (("certificatetype".equals(param.getEnumdiccode()))) {
|
|
|
+ Certificatetypeconfig certificateTypeConfig = iCertificatetypeconfigMapper.selectOne(new QueryWrapper<Certificatetypeconfig>()
|
|
|
+ .eq("enumdicitemid",param.getAutoid()));
|
|
|
+ if (certificateTypeConfig == null) {
|
|
|
+ certificateTypeConfig = new Certificatetypeconfig();
|
|
|
+ certificateTypeConfig.setEnumdicitemid(param.getAutoid());
|
|
|
+ }
|
|
|
+ certificateTypeConfig.setCardlength(param.getCardlength());
|
|
|
+ certificateTypeConfig.setIsperson(param.getIsperson());
|
|
|
+ certificateTypeConfig.setRegexpress(param.getRegexpress());
|
|
|
+ iCertificatetypeconfigMapper.update(certificateTypeConfig,new QueryWrapper<Certificatetypeconfig>()
|
|
|
+ .eq("enumdicitemid",param.getAutoid()));
|
|
|
+ }
|
|
|
+ redisServiceUtil.updateHash(Constants.REDIS_HEADER_DICT + enumDicItem.getEnumdiccode(),
|
|
|
+ enumDicItem.getEnumitemname().toString(), enumDicItem.getEnumdicname());
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ } else {
|
|
|
+ Enumdicitem enumDicItem = new Enumdicitem();
|
|
|
+ Enumdic enumDic = iEnumdicMapper.selectOne(new QueryWrapper<Enumdic>().eq("enumdiccode",param.getEnumdiccode()));
|
|
|
+ if (param.getEnumitemname() == null) {
|
|
|
+ List<Enumdicitem> enumDicItems = iEnumdicitemMapper.selectList(new QueryWrapper<Enumdicitem>().eq("enumdiccode",param.getEnumdiccode()));
|
|
|
+ enumDicItem.setEnumitemname(enumDicItems.size() + 1);
|
|
|
+ } else {
|
|
|
+ Enumdicitem enumDicItemExit = iEnumdicitemMapper.selectOne(new QueryWrapper<Enumdicitem>()
|
|
|
+ .eq("enumdicname", param.getEnumdicname())
|
|
|
+ .eq("enumdiccode",param.getEnumdiccode()));
|
|
|
+ if (enumDicItemExit != null) {
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM027.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+ Enumdicitem enumDicItemExit2 = iEnumdicitemMapper.selectOne(new QueryWrapper<Enumdicitem>()
|
|
|
+ .eq("enumitemname", param.getEnumitemname())
|
|
|
+ .eq("enumdiccode",param.getEnumdiccode()));
|
|
|
+ if (enumDicItemExit2 != null) {
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM028.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+ enumDicItem.setEnumitemname(param.getEnumitemname());
|
|
|
+ }
|
|
|
+
|
|
|
+ enumDicItem.setEnumdiccode(param.getEnumdiccode());
|
|
|
+ enumDicItem.setEnumdicid(enumDic.getAutoid());
|
|
|
+ enumDicItem.setEnumdicname(param.getEnumdicname());
|
|
|
+ enumDicItem.setBankmappedvalue(param.getBankmappedvalue());
|
|
|
+ enumDicItem.setRemark(param.getRemark());
|
|
|
+ enumDicItem.setEnumitemstatus(1);
|
|
|
+ iEnumdicitemMapper.insert(enumDicItem);
|
|
|
+ if (("certificatetype".equals(param.getEnumdiccode()))) {
|
|
|
+ Certificatetypeconfig certificateTypeConfig = new Certificatetypeconfig();
|
|
|
+ certificateTypeConfig.setEnumdicitemid(enumDicItem.getAutoid());
|
|
|
+ certificateTypeConfig.setCardlength(param.getCardlength());
|
|
|
+ certificateTypeConfig.setIsperson(param.getIsperson());
|
|
|
+ certificateTypeConfig.setRegexpress(param.getRegexpress());
|
|
|
+ iCertificatetypeconfigMapper.insert(certificateTypeConfig);
|
|
|
+ }
|
|
|
+ redisServiceUtil.updateHash(Constants.REDIS_HEADER_DICT + enumDicItem.getEnumdiccode(),
|
|
|
+ enumDicItem.getEnumitemname().toString(), enumDicItem.getEnumdicname());
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult delEnumdicItem(Long autoid, Integer flag, HttpServletRequest request) {
|
|
|
+ if (flag == 1) {
|
|
|
+ Enumdicitem enumDicItem = iEnumdicitemMapper.selectOne(new QueryWrapper<Enumdicitem>().eq("AUTOID",autoid));
|
|
|
+ String enumdiccode = enumDicItem.getEnumdiccode();
|
|
|
+ if (("certificatetype".equals(enumdiccode))) {
|
|
|
+ iCertificatetypeconfigMapper.delete(new QueryWrapper<Certificatetypeconfig>()
|
|
|
+ .eq("enumdicitemid",autoid));
|
|
|
+ }
|
|
|
+ redisServiceUtil.delHash(Constants.REDIS_HEADER_DICT + enumDicItem.getEnumdiccode(), enumDicItem.getEnumitemname().toString());
|
|
|
+ iEnumdicitemMapper.deleteById(enumDicItem);
|
|
|
+ }
|
|
|
+ if (flag == 0) {
|
|
|
+ Enumdic enumDic = iEnumdicMapper.selectOne(new QueryWrapper<Enumdic>().eq("AUTOID",autoid));
|
|
|
+ String enumdiccode = enumDic.getEnumdiccode();
|
|
|
+ if (("certificatetype".equals(enumdiccode))) {
|
|
|
+ iCertificatetypeconfigMapper.delete(new QueryWrapper<Certificatetypeconfig>()
|
|
|
+ .eq("enumdicitemid",autoid));
|
|
|
+ }
|
|
|
+ redisServiceUtil.delHash(Constants.REDIS_HEADER_DICT + enumDic.getEnumdiccode(), enumDic.getEnumdicname());
|
|
|
+ iEnumdicMapper.deleteById(enumDic);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void updateSystem(String code, String openMarket, String logincode, Long value) {
|
|
|
+ try {
|
|
|
+ Systemparam systemparam = iSystemparamMapper.selectOne(new QueryWrapper<Systemparam>().eq("PARAMCODE", code));
|
|
|
+ systemparam.setParamvalue(code.equals(SysConstants.SYSPARAM_SETTING_SETTLE_TRADEDAY) ? openMarket : formatHHMM(openMarket));
|
|
|
+ systemparam.setLoginid(logincode);
|
|
|
+ systemparam.setUserid(value);
|
|
|
+ systemparam.setUpdatetime(new Date());
|
|
|
+ iSystemparamMapper.update(systemparam, new QueryWrapper<Systemparam>().eq("PARAMCODE", code));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("时间格式错误!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String formatHHMM(String time) throws ParseException {
|
|
|
+ time = DateTimeUtils.format(DateTimeUtils.parseDate(time, "HH:mm"), "HH:mm");
|
|
|
+ return time;
|
|
|
+ }
|
|
|
+
|
|
|
private void update(DivisionAddParam param, Systemmanager user, Division div) {
|
|
|
String oldDivisionCode = div.getDivisioncode();
|
|
|
div.setDivisioncode(param.getDivisioncode());
|