gongdecai 2 anni fa
parent
commit
4dac10ff42

+ 64 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/market/IKouzhaoInfoAppService.java

@@ -0,0 +1,64 @@
+package com.iotechn.unimall.app.api.market;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.KouzhaoInfo;
+import com.iotechn.unimall.data.model.Page;
+
+import java.util.Date;
+
+/**
+ * 口罩信息Service接口
+ * 
+ * @author jlb
+ * @date 2022-09-06
+ */
+@HttpOpenApi(group = "kouzhaoInfo", description = "口罩信息")
+public interface IKouzhaoInfoAppService {
+	@HttpMethod(description = "新增")
+	public Boolean add(@NotNull @HttpParam(name = "kouzhaoInfo", type = HttpParamType.COMMON, description = "口罩信息") KouzhaoInfo kouzhaoInfo,
+						   @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "列表", permission = "admin:kouzhao:kouzhaoInfo:list",permissionParentName = "宠物管理", permissionName = "口罩信息管理")
+	public Page<KouzhaoInfo> list(
+								@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "numberOrder", type = HttpParamType.COMMON, description = "编号") String numberOrder,
+							@HttpParam(name = "name", type = HttpParamType.COMMON, description = "昵称") String name,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "电话") String phone,
+							@HttpParam(name = "shejiUrl", type = HttpParamType.COMMON, description = "设计图地址") String shejiUrl,
+							@HttpParam(name = "lituUrl", type = HttpParamType.COMMON, description = "例图地址") String lituUrl,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:kouzhao:kouzhaoInfo:delete",permissionParentName = "宠物管理", permissionName = "口罩信息管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:kouzhao:kouzhaoInfo:update",permissionParentName = "宠物管理", permissionName = "口罩信息管理")
+	public Boolean update(@NotNull @HttpParam(name = "kouzhaoInfo", type = HttpParamType.COMMON, description = "口罩信息") KouzhaoInfo kouzhaoInfo,
+						  @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId)throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:kouzhao:kouzhaoInfo:get",permissionParentName = "宠物管理", permissionName = "口罩信息管理")
+	public KouzhaoInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:kouzhao:kouzhaoInfo:export",permissionParentName = "宠物管理", permissionName = "口罩信息管理")
+	public String export(
+								@HttpParam(name = "userId", type = HttpParamType.COMMON, description = "") Long userId,
+							@HttpParam(name = "numberOrder", type = HttpParamType.COMMON, description = "编号") String numberOrder,
+							@HttpParam(name = "name", type = HttpParamType.COMMON, description = "昵称") String name,
+							@HttpParam(name = "phone", type = HttpParamType.COMMON, description = "电话") String phone,
+							@HttpParam(name = "shejiUrl", type = HttpParamType.COMMON, description = "设计图地址") String shejiUrl,
+							@HttpParam(name = "lituUrl", type = HttpParamType.COMMON, description = "例图地址") String lituUrl,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 138 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/market/KouzhaoInfoServiceAppImpl.java

@@ -0,0 +1,138 @@
+package com.iotechn.unimall.app.api.market;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.market.KouzhaoInfo;
+import com.iotechn.unimall.data.mapper.market.KouzhaoInfoMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * 口罩信息Service业务层处理
+ *
+ * @author jlb
+ * @date 2022-09-06
+ */
+@Service
+public class KouzhaoInfoServiceAppImpl implements IKouzhaoInfoAppService {
+    @Autowired
+    private KouzhaoInfoMapper kouzhaoInfoMapper;
+
+    @Override
+    public Boolean add(KouzhaoInfo kouzhaoInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        kouzhaoInfo.setGmtCreate(now);
+        kouzhaoInfo.setGmtUpdate(now);
+        String billNo = "";
+        String year = new SimpleDateFormat("yy", Locale.CHINESE).format(new Date());
+        String month = new SimpleDateFormat("MM", Locale.CHINESE).format(new Date());
+        String day = new SimpleDateFormat("dd",Locale.CHINESE).format(new Date());
+        int count = kouzhaoInfoMapper.selectCount(new EntityWrapper<KouzhaoInfo>()
+                .and("date(gmt_create) = curdate()"));
+        int maxCount =  count + 1;
+        if (maxCount < 10) {
+            billNo = year + month + day + "00" + maxCount;
+        } else if (maxCount < 100) {
+            billNo = year + month + day + "0" + maxCount;
+        } else {
+            billNo = year + month + day + maxCount;
+        }
+        kouzhaoInfo.setNumberOrder(billNo);
+        return kouzhaoInfoMapper.insert(kouzhaoInfo) > 0;
+    }
+
+    @Override
+    public Page<KouzhaoInfo> list(Long userId, String numberOrder, String name, String phone, String shejiUrl, String lituUrl, Date gmtUpdate, Date gmtCreate, Integer page, Integer limit) throws ServiceException {
+        Wrapper<KouzhaoInfo> wrapper = new EntityWrapper<KouzhaoInfo>();
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(numberOrder)) {
+            wrapper.eq("number_order", numberOrder);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(shejiUrl)) {
+            wrapper.eq("sheji_url", shejiUrl);
+        }
+        if (!StringUtils.isEmpty(lituUrl)) {
+            wrapper.eq("litu_url", lituUrl);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<KouzhaoInfo> list = kouzhaoInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = kouzhaoInfoMapper.selectCount(wrapper);
+        return new Page<KouzhaoInfo>(list, page, limit, count);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(String id) {
+        kouzhaoInfoMapper.deleteById(id);
+        return true;
+    }
+
+    @Override
+    public Boolean update(KouzhaoInfo kouzhaoInfo, Long adminId) throws ServiceException {
+        Date now = new Date();
+        kouzhaoInfo.setGmtUpdate(now);
+        return kouzhaoInfoMapper.updateById(kouzhaoInfo) > 0;
+    }
+
+    @Override
+    public KouzhaoInfo get(Long id) throws ServiceException {
+        return kouzhaoInfoMapper.selectById(id);
+    }
+
+    @Override
+    public String export(Long userId, String numberOrder, String name, String phone, String shejiUrl, String lituUrl, Date gmtUpdate, Date gmtCreate, Integer page, Integer limit) throws ServiceException {
+        Wrapper<KouzhaoInfo> wrapper = new EntityWrapper<KouzhaoInfo>();
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(numberOrder)) {
+            wrapper.eq("number_order", numberOrder);
+        }
+        if (!StringUtils.isEmpty(name)) {
+            wrapper.eq("name", name);
+        }
+        if (!StringUtils.isEmpty(phone)) {
+            wrapper.eq("phone", phone);
+        }
+        if (!StringUtils.isEmpty(shejiUrl)) {
+            wrapper.eq("sheji_url", shejiUrl);
+        }
+        if (!StringUtils.isEmpty(lituUrl)) {
+            wrapper.eq("litu_url", lituUrl);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        List<KouzhaoInfo> list = kouzhaoInfoMapper.selectList(wrapper);
+        ExcelUtil<KouzhaoInfo> util = new ExcelUtil<KouzhaoInfo>(KouzhaoInfo.class);
+        return util.exportExcel(list, "操作日志");
+    }
+}

+ 1 - 1
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserService.java

@@ -23,7 +23,7 @@ public interface UserService {
     @HttpMethod(description = "用户注册")
     public String register(
             @NotNull @TextFormat(length = 11) @HttpParam(name = "phone", type = HttpParamType.COMMON, description = "用户手机号") String phone,
-            @NotNull @TextFormat(lengthMin = 8,lengthMax = 18,notChinese = true) @HttpParam(name = "password", type = HttpParamType.COMMON, description = "用户密码") String password,
+            @NotNull @HttpParam(name = "password", type = HttpParamType.COMMON, description = "用户密码") String password,
             @NotNull @HttpParam(name = "verifyCode", type = HttpParamType.COMMON, description = "注册验证码") String verifyCode,
             @HttpParam(name = "ip", type = HttpParamType.IP, description = "用户Ip") String ip) throws ServiceException;
 

+ 1 - 1
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserServiceImpl.java

@@ -101,7 +101,7 @@ public class UserServiceImpl implements UserService {
     @Transactional
     public String register(String phone, String password, String verifyCode, String ip) throws ServiceException {
         //1.校验验证码
-        checkVerifyCode(phone, verifyCode);
+//        checkVerifyCode(phone, verifyCode);
         //2.校验用户是否存在
         Integer count = userMapper.selectCount(
                 new EntityWrapper<UserDO>()

+ 0 - 38
unimall-core/src/main/java/com/iotechn/unimall/core/util/ConstantPropertiesUtils.java

@@ -1,38 +0,0 @@
-package com.iotechn.unimall.core.util;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ConstantPropertiesUtils implements InitializingBean {
-
-    //读取配置文件内容
-
-    @Value("${aliyun.oss.file.endpoint}")
-    private String endpoint;
-
-    @Value("${aliyun.oss.file.keyid}")
-    private String keyId;
-
-    @Value("${aliyun.oss.file.keysecret}")
-    private String keySecret;
-
-    @Value("${aliyun.oss.file.bucketname}")
-    private String bucketName;
-
-    //定义公开的静态的常量
-    public static String END_POINT;
-    public static String ACCESS_KEY_ID;
-    public static String ACCESS_KEY_SECRET;
-    public static String BUCKET_NAME;
-
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-        END_POINT = endpoint;
-        ACCESS_KEY_ID = keyId;
-        ACCESS_KEY_SECRET = keySecret;
-        BUCKET_NAME = bucketName;
-    }
-}

+ 1 - 1
unimall-launcher/src/main/java/com/iotechn/unimall/launcher/controller/ApiController.java

@@ -120,7 +120,7 @@ public class ApiController {
 				operLog.setErrorMsg(e.getMessage());
 				operLog.setOperIp(BrowserData.getIpAddr(req));
 				operLog.setOperatorType(1);
-				operLog.setOperName(SessionUtil.getAdmin().getRealname());
+//				operLog.setOperName(SessionUtil.getAdmin().getRealname());
 				operLog.setOperUrl(_gp+"."+_mt);
 				operLog.setOperLocation(BrowserData.getAddresses(operLog.getOperIp()));
 				operLog.setStatus(1);