Browse Source

1、生产日报excel导入

2、微信小程序相关接口
develop
bobol 10 months ago
parent
commit
efb458a408
  1. 13
      lzbi-admin/src/main/resources/application-dev.yml
  2. 46
      lzbi-admin/src/main/resources/application-prod.yml
  3. 35
      lzbi-common/src/main/java/com/lzbi/common/config/WechatConfig.java
  4. 53
      lzbi-common/src/main/java/com/lzbi/common/constant/BizConstants.java
  5. 1
      lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java
  6. 4
      lzbi-module/pom.xml
  7. 18
      lzbi-module/src/main/java/com/lzbi/asset/domain/AssetParamsVO.java
  8. 111
      lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiParamSource.java
  9. 80
      lzbi-module/src/main/java/com/lzbi/asset/domain/ElementTreeVO.java
  10. 26
      lzbi-module/src/main/java/com/lzbi/asset/domain/ParamsPartitionVO.java
  11. 17
      lzbi-module/src/main/java/com/lzbi/asset/domain/TreeVO.java
  12. 2
      lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java
  13. 28
      lzbi-module/src/main/java/com/lzbi/asset/service/DcBusiParamSourceService.java
  14. 154
      lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiTargetInputMasterController.java
  15. 131
      lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiTargetInputSubController.java
  16. 110
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputMaster.java
  17. 111
      lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputSub.java
  18. 63
      lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputMasterMapper.java
  19. 63
      lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputSubMapper.java
  20. 255
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiTargetInputMasterService.java
  21. 91
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiTargetInputSubService.java
  22. 10
      lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java
  23. 10
      lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java
  24. 11
      lzbi-module/src/main/java/com/lzbi/draft/domain/req/ConfirmReq.java
  25. 44
      lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java
  26. 97
      lzbi-module/src/main/java/com/lzbi/wechat/controller/BizController.java
  27. 36
      lzbi-module/src/main/java/com/lzbi/wechat/controller/LoginController.java
  28. 54
      lzbi-module/src/main/java/com/lzbi/wechat/controller/WechatController.java
  29. 30
      lzbi-module/src/main/java/com/lzbi/wechat/domain/SysWechat.java
  30. 14
      lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatAccessTokenRep.java
  31. 19
      lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatBaseRep.java
  32. 23
      lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatCodeLoginRep.java
  33. 28
      lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatPhoneNumberRep.java
  34. 18
      lzbi-module/src/main/java/com/lzbi/wechat/domain/req/CodeLoginReq.java
  35. 19
      lzbi-module/src/main/java/com/lzbi/wechat/domain/req/PhoneNumberLoginReq.java
  36. 18
      lzbi-module/src/main/java/com/lzbi/wechat/domain/req/PhoneNumberReq.java
  37. 28
      lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/ChildDeptVO.java
  38. 14
      lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/CodeLoginVO.java
  39. 19
      lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/DeptVO.java
  40. 22
      lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/FinishingRateVO.java
  41. 31
      lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/TargetVO.java
  42. 45
      lzbi-module/src/main/java/com/lzbi/wechat/mapper/SysWechatMapper.java
  43. 92
      lzbi-module/src/main/java/com/lzbi/wechat/service/DeptService.java
  44. 62
      lzbi-module/src/main/java/com/lzbi/wechat/service/SysWechatService.java
  45. 157
      lzbi-module/src/main/java/com/lzbi/wechat/service/TargetService.java
  46. 163
      lzbi-module/src/main/java/com/lzbi/wechat/service/WechatService.java
  47. 26
      lzbi-module/src/main/resources/mapper/SysWechatMapper.xml
  48. 6
      lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml
  49. 80
      lzbi-module/src/main/resources/mapper/asset/DcBusiParamSourceMapper.xml
  50. 153
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputMasterMapper.xml
  51. 154
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputSubMapper.xml
  52. 1
      lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java
  53. 8
      lzbi-system/src/main/java/com/lzbi/system/mapper/SysUserMapper.java
  54. 7
      lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java
  55. 2
      lzbi-system/src/main/java/com/lzbi/system/service/ISysUserService.java
  56. 5
      lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java
  57. 5
      lzbi-system/src/main/java/com/lzbi/system/service/impl/SysUserServiceImpl.java
  58. 12
      lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml
  59. 11
      lzbi-system/src/main/resources/mapper/system/SysUserMapper.xml

13
lzbi-admin/src/main/resources/application-dev.yml

@ -129,3 +129,16 @@ target-model:
outputOfPlant: TM000FDL # 发电量
provideWaterAverageTemperature: TM000GSJW # 供水均温
answerWaterAverageTemperature: TM000HSJW # 回水均温
# 微信相关配置
wechat:
# 小程序ID
appId: wx4c96b81e6331fefa
# 小程序密钥
appSecret: b7258ba1e7db304d086cb83f034b3b60
# 小程序登录接口
code2Session: https://api.weixin.qq.com/sns/jscode2session?appid={appid}&secret={secret}&js_code={js_code}&grant_type={grant_type}
# 获取接口调用凭据
accessToken: https://api.weixin.qq.com/cgi-bin/token?appid={appid}&secret={secret}&grant_type={grant_type}
# 获取手机号
phoneNumber: https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token={access_token}

46
lzbi-admin/src/main/resources/application-prod.yml

@ -1,7 +1,7 @@
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 9001
port: 9012
# redis 配置
spring:
@ -86,19 +86,28 @@ spring:
# username: lmjt_sys
# password: lmjt_sys
# 从库数据源
slave:
# 从数据源开关/默认关闭
url: jdbc:mysql://10.10.10.56:13306/lzdc_bi_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: luenmei
password: 123456
workDB:
driverClassName: org.postgresql.Driver
#type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:postgresql://10.10.10.56:5432/dctestdb?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: postgres
password: 123456
# slave:
# # 从数据源开关/默认关闭
# url: jdbc:mysql://10.10.10.56:13306/lzdc_bi_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: luenmei
# password: 123456
# workDB:
# driverClassName: org.postgresql.Driver
# #type: com.alibaba.druid.pool.DruidDataSource
# url: jdbc:postgresql://10.10.10.59:5432/dcdatabase?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
# username: postgres
# password: 123456
primary: master
luenmeilz:
#视频设备监控地址
vedio-server:
url: http://10.10.10.40:18000
login: /api/v1/login?username={username}&password={password}
deviceList: /api/v1/devicesconfig?device={device}&start={start}&limit={limit}
channelList: /api/v1/channelsconfig?device={device}&start={start}&limit={limit}
channelStream: /api/v1/devices/channelstream?device={device}&channel={channel}&protocol={protocol}&Token={Token}&type={type}
# 日志配置
logging:
file:
@ -106,3 +115,16 @@ logging:
level:
com.lzbi: debug
org.springframework: warn
# 微信相关配置
wechat:
# 小程序ID
appId: wx4c96b81e6331fefa
# 小程序密钥
appSecret: b7258ba1e7db304d086cb83f034b3b60
# 小程序登录接口
code2Session: https://api.weixin.qq.com/sns/jscode2session?appid={appid}&secret={secret}&js_code={js_code}&grant_type={grant_type}
# 获取接口调用凭据
accessToken: https://api.weixin.qq.com/cgi-bin/token?appid={appid}&secret={secret}&grant_type={grant_type}
# 获取手机号
phoneNumber: https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token={access_token}

35
lzbi-common/src/main/java/com/lzbi/common/config/WechatConfig.java

@ -0,0 +1,35 @@
package com.lzbi.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* 微信配置
*/
@Data
@Component
@ConfigurationProperties(prefix = "wechat")
public class WechatConfig {
/**
* 小程序 appId
*/
private String appId;
/**
* 小程序 appSecret
*/
private String appSecret;
/**
* 小程序登录接口 url
*/
private String code2Session;
/**
* 获取接口调用凭据口 url
*/
private String accessToken;
/**
* 获取手机号接口 url
*/
private String phoneNumber;
}

53
lzbi-common/src/main/java/com/lzbi/common/constant/BizConstants.java

@ -0,0 +1,53 @@
package com.lzbi.common.constant;
/**
* 业务常量
*/
public interface BizConstants {
/**
* 指标类别
*/
interface TargetType {
/**
* 单日
*/
String DAY = "1";
/**
* 累计
*/
String ACCUMULATIVE = "2";
}
/**
* 部门类别
*/
interface DcDeptAttr {
/**
* 公司
*/
String COMANY = "1002";
/**
* 热源
*/
String HEAT_SOURCE = "1003";
}
/**
* 资产类别
*/
interface DcAssetAttr {
/**
* 换热站
*/
String HEAT_EXCHANGE_STATION = "1001";
/**
* 热源
*/
String HEAT_SOURCE = "1002";
}
}

1
lzbi-framework/src/main/java/com/lzbi/framework/config/SecurityConfig.java

@ -115,6 +115,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers( "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
.antMatchers("/wechat/biz/login/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()

4
lzbi-module/pom.xml

@ -27,6 +27,10 @@
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<dependency>
<groupId>com.lzbi</groupId>
<artifactId>lzbi-system</artifactId>
</dependency>
<!-- swagger3-->
<dependency>

18
lzbi-module/src/main/java/com/lzbi/asset/domain/AssetParamsVO.java

@ -0,0 +1,18 @@
package com.lzbi.asset.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AssetParamsVO {
private List<ElementTreeVO> treeData;
private Map<String, List<ParamsPartitionVO>> paramsPartitionMap;
}

111
lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiParamSource.java

@ -1,70 +1,85 @@
package com.lzbi.asset.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 采集参数来源信息表;
* @author : zhousq
* @date : 2023-12-5
* 采集参数来源信息对象 dc_busi_param_source
*
* @author win
* @date 2024-01-17
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "采集参数来源信息表",description = "")
@TableName("dc_busi_param_source")
public class DcBusiParamSource extends BaseModuleEntity{
public class DcBusiParamSource extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 参数编码 */
@ApiModelProperty(name = "参数编码",notes = "")
private String paramCode ;
@Excel(name = "参数编码")
@ApiModelProperty(name = "参数编码",notes = "paramCode")
private String paramCode;
/** 参数名称 */
@ApiModelProperty(name = "参数名称",notes = "")
private String paramName ;
@Excel(name = "参数名称")
@ApiModelProperty(name = "参数名称",notes = "paramName")
private String paramName;
/** 分组名称 */
@ApiModelProperty(name = "分组名称",notes = "")
private String groupName ;
@Excel(name = "分组名称")
@ApiModelProperty(name = "分组名称",notes = "groupName")
private String groupName;
/** 分组编码 */
@ApiModelProperty(name = "分组编码",notes = "")
private String groupCode ;
@Excel(name = "分组编码")
@ApiModelProperty(name = "分组编码",notes = "groupCode")
private String groupCode;
/** 资产编码(不是统计单元) */
@Excel(name = "资产编码", readConverterExp = "不=是统计单元")
@ApiModelProperty(name = "资产编码",notes = "")
private String assetCode;
/** 资产名称(不是统计单元) */
@Excel(name = "资产名称", readConverterExp = "不=是统计单元")
@ApiModelProperty(name = "资产名称",notes = "")
private String assetName;
/** 分区 */
@Excel(name = "分区")
@ApiModelProperty(name = "分区",notes = "partion")
private String partion;
/** 扩展属性 */
@ApiModelProperty(name = "扩展属性",notes = "")
private String extPro ;
@Excel(name = "扩展属性")
@ApiModelProperty(name = "扩展属性",notes = "extPro")
private String extPro;
/** 来源类型 */
@ApiModelProperty(name = "来源类型",notes = "")
private String sourceType ;
@Excel(name = "来源类型")
@ApiModelProperty(name = "来源类型",notes = "sourceType")
private String sourceType;
/** 是否有效 */
@ApiModelProperty(name = "是否有效",notes = "")
private String enabledFlag ;
@Excel(name = "是否有效")
@ApiModelProperty(name = "是否有效",notes = "enabledFlag")
private String enabledFlag;
/** 主键 */
@ApiModelProperty(name = "主键",notes = "")
@TableId(type= IdType.AUTO)
private Long id ;
/** 所属专业 */
@ApiModelProperty(name = "所属专业",notes = "")
private String fieldCode ;
/** 所属名称 */
@ApiModelProperty(name = "所属名称",notes = "")
private String fieldName ;
private String value;
private String label;
private Long id;
public String getValue() {
return this.paramCode;
}
/** 所属专业 */
@Excel(name = "所属专业")
@ApiModelProperty(name = "所属专业",notes = "fieldCode")
private String fieldCode;
/** 所属名称 */
@Excel(name = "所属名称")
@ApiModelProperty(name = "所属名称",notes = "fieldName")
private String fieldName;
public String getLabel() {
return this.paramCode;
}
}
}

80
lzbi-module/src/main/java/com/lzbi/asset/domain/ElementTreeVO.java

@ -0,0 +1,80 @@
package com.lzbi.asset.domain;
import java.util.List;
/**
* elementUI树形结构返回值
*/
public class ElementTreeVO {
/**
*
*/
private Object value;
/**
* 名称
*/
private String label;
/**
* 是否禁用
*/
private boolean disabled;
/**
* 是否有下级节点
*/
private boolean isLeaf;
/**
* 下级节点
*/
private List<ElementTreeVO> children;
private List<ElementTreeVO> data;
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public boolean getDisabled() {
return disabled;
}
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}
public boolean getIsLeaf() {
return isLeaf;
}
public void setIsLeaf(boolean leaf) {
isLeaf = leaf;
}
public List<ElementTreeVO> getChildren() {
return children;
}
public void setChildren(List<ElementTreeVO> children) {
this.children = children;
}
public List<ElementTreeVO> getData() {
return data;
}
public void setData(List<ElementTreeVO> data) {
this.data = data;
}
}

26
lzbi-module/src/main/java/com/lzbi/asset/domain/ParamsPartitionVO.java

@ -0,0 +1,26 @@
package com.lzbi.asset.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ParamsPartitionVO {
/**
*
*/
private String paramsCode;
/**
* 名称
*/
private String paramsName;
/**
* 分区
*/
private String partition;
}

17
lzbi-module/src/main/java/com/lzbi/asset/domain/TreeVO.java

@ -0,0 +1,17 @@
package com.lzbi.asset.domain;
import lombok.Data;
import java.util.List;
@Data
public class TreeVO {
private String value;
private String label;
private boolean disabled;
private List<TreeVO> options;
}

2
lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java

@ -3,6 +3,7 @@ package com.lzbi.asset.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.asset.domain.DcBaseAssetInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@ -25,6 +26,7 @@ public interface DcBaseAssetInfoMapper extends BaseMapper<DcBaseAssetInfo>
*/
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id);
public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetcode);
public DcBaseAssetInfo selectDcBaseAssetInfoByAliasName(@Param("assetNameAlias") String assetNameAlias);
public HashMap<String,String> selectDcBaseAssetInfoMap();
/**

28
lzbi-module/src/main/java/com/lzbi/asset/service/DcBusiParamSourceService.java

@ -1,11 +1,22 @@
package com.lzbi.asset.service;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzbi.asset.domain.ElementTreeVO;
import com.lzbi.asset.domain.TreeVO;
import com.lzbi.asset.mapper.DcBusiParamSourceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lzbi.asset.domain.DcBusiParamSource;
import org.springframework.util.CollectionUtils;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 采集参数来源信息表;(dc_busi_param_source)表服务接口
@ -15,6 +26,9 @@ import java.util.List;
@Service
public class DcBusiParamSourceService extends ServiceImpl<DcBusiParamSourceMapper, DcBusiParamSource> implements IService<DcBusiParamSource> {
@Autowired
private RestTemplate restTemplate;
public List<DcBusiParamSource> selectByVo( DcBusiParamSource dcBusiParamSource){
return baseMapper.selectByVo(dcBusiParamSource);
}
@ -22,4 +36,18 @@ public class DcBusiParamSourceService extends ServiceImpl<DcBusiParamSourceMapp
return baseMapper.insertByVo(dcBusiParamSource);
}
public List<ElementTreeVO> selectParamSourceTree(String paramsName){
List<ElementTreeVO> list = new ArrayList<>();
ElementTreeVO elementTreeVO = new ElementTreeVO();
elementTreeVO.setValue("IOT");
elementTreeVO.setLabel("IOT平台");
String result = restTemplate.getForObject("http://127.0.0.1:9010/biz/common/orgAssetParamsTree", String.class);
if (null != result) {
List<ElementTreeVO> elementTreeVOS = JSONArray.parseArray(result, ElementTreeVO.class);
elementTreeVO.setIsLeaf(Boolean.TRUE);
elementTreeVO.setChildren(elementTreeVOS);
}
list.add(elementTreeVO);
return list;
}
}

154
lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiTargetInputMasterController.java

@ -0,0 +1,154 @@
package com.lzbi.bill.controller;
import com.lzbi.draft.domain.req.ConfirmReq;
import com.lzbi.draft.domain.req.ProductionDailySheetReq;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.bill.domain. DcBusiTargetInputMaster;
import com.lzbi.bill.service.DcBusiTargetInputMasterService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 指标录入单Controller
*
* @author lienbo
* @date 2024-01-19
*/
@RestController
@RequestMapping("/bill/DcBusiTargetInputMaster")
public class DcBusiTargetInputMasterController extends BaseController
{
@Autowired
private DcBusiTargetInputMasterService dcBusiTargetInputMasterService;
/**
* 查询指标录入单列表
*/
@ApiOperation("查询指标录入单列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputMaster", value = "", dataType = "DcBusiTargetInputMaster", dataTypeClass = DcBusiTargetInputMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputMaster:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiTargetInputMaster DcBusiTargetInputMaster)
{
startPage();
List< DcBusiTargetInputMaster> list = dcBusiTargetInputMasterService.selectDcBusiTargetInputMasterList(DcBusiTargetInputMaster);
return getDataTable(list);
}
/**
* 导出指标录入单列表
*/
@ApiOperation("导出指标录入单列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputMaster", value = "", dataType = "DcBusiTargetInputMaster", dataTypeClass = DcBusiTargetInputMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputMaster:export')")
@Log(title = "指标录入单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,DcBusiTargetInputMaster DcBusiTargetInputMaster)
{
List<DcBusiTargetInputMaster> list = dcBusiTargetInputMasterService.selectDcBusiTargetInputMasterList(DcBusiTargetInputMaster);
ExcelUtil<DcBusiTargetInputMaster> util = new ExcelUtil<DcBusiTargetInputMaster>(DcBusiTargetInputMaster.class);
util.exportExcel(response, list, "指标录入单数据");
}
/**
* 获取指标录入单详细信息
*/
@ApiOperation("获取指标录入单详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputMaster:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiTargetInputMasterService.selectDcBusiTargetInputMasterById(id));
}
/**
* 新增指标录入单
*/
@ApiOperation("新增指标录入单")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputMaster", value = "", dataType = "DcBusiTargetInputMaster", dataTypeClass = DcBusiTargetInputMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputMaster:add')")
@Log(title = "指标录入单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiTargetInputMaster DcBusiTargetInputMaster)
{
return toAjax(dcBusiTargetInputMasterService.insertDcBusiTargetInputMaster(DcBusiTargetInputMaster));
}
/**
* 修改指标录入单
*/
@ApiOperation("修改指标录入单")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputMaster", value = "", dataType = "DcBusiTargetInputMaster", dataTypeClass = DcBusiTargetInputMaster.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputMaster:edit')")
@Log(title = "指标录入单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiTargetInputMaster DcBusiTargetInputMaster)
{
return toAjax(dcBusiTargetInputMasterService.updateDcBusiTargetInputMaster(DcBusiTargetInputMaster));
}
/**
* 删除指标录入单
*/
@ApiOperation("删除指标录入单")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputMaster:remove')")
@Log(title = "指标录入单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiTargetInputMasterService.deleteDcBusiTargetInputMasterByIds(ids));
}
/**
* 上传生产日报
* @param file
* @return
*/
@PostMapping("/upload/production/daily")
public AjaxResult uploadProductionDaily(MultipartFile file) {
return dcBusiTargetInputMasterService.uploadProductionDaily(file);
}
/**
* 确认日报数据
* @param list
* @return
*/
@PostMapping("/confirm")
public AjaxResult confirm(@RequestBody ConfirmReq confirmReq) {
return dcBusiTargetInputMasterService.confirm(confirmReq);
}
}

131
lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiTargetInputSubController.java

@ -0,0 +1,131 @@
package com.lzbi.bill.controller;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.bill.domain. DcBusiTargetInputSub;
import com.lzbi.bill.service.DcBusiTargetInputSubService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 指标录入单子Controller
*
* @author lienbo
* @date 2024-01-19
*/
@RestController
@RequestMapping("/bill/DcBusiTargetInputSub")
public class DcBusiTargetInputSubController extends BaseController
{
@Autowired
private DcBusiTargetInputSubService dcBusiTargetInputSubService;
/**
* 查询指标录入单子列表
*/
@ApiOperation("查询指标录入单子列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputSub", value = "", dataType = "DcBusiTargetInputSub", dataTypeClass = DcBusiTargetInputSub.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputSub:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiTargetInputSub DcBusiTargetInputSub)
{
startPage();
List< DcBusiTargetInputSub> list = dcBusiTargetInputSubService.selectDcBusiTargetInputSubList(DcBusiTargetInputSub);
return getDataTable(list);
}
/**
* 导出指标录入单子列表
*/
@ApiOperation("导出指标录入单子列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputSub", value = "", dataType = "DcBusiTargetInputSub", dataTypeClass = DcBusiTargetInputSub.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputSub:export')")
@Log(title = "指标录入单子", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,DcBusiTargetInputSub DcBusiTargetInputSub)
{
List<DcBusiTargetInputSub> list = dcBusiTargetInputSubService.selectDcBusiTargetInputSubList(DcBusiTargetInputSub);
ExcelUtil<DcBusiTargetInputSub> util = new ExcelUtil<DcBusiTargetInputSub>(DcBusiTargetInputSub.class);
util.exportExcel(response, list, "指标录入单子数据");
}
/**
* 获取指标录入单子详细信息
*/
@ApiOperation("获取指标录入单子详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputSub:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiTargetInputSubService.selectDcBusiTargetInputSubById(id));
}
/**
* 新增指标录入单子
*/
@ApiOperation("新增指标录入单子")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputSub", value = "", dataType = "DcBusiTargetInputSub", dataTypeClass = DcBusiTargetInputSub.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputSub:add')")
@Log(title = "指标录入单子", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiTargetInputSub DcBusiTargetInputSub)
{
return toAjax(dcBusiTargetInputSubService.insertDcBusiTargetInputSub(DcBusiTargetInputSub));
}
/**
* 修改指标录入单子
*/
@ApiOperation("修改指标录入单子")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiTargetInputSub", value = "", dataType = "DcBusiTargetInputSub", dataTypeClass = DcBusiTargetInputSub.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputSub:edit')")
@Log(title = "指标录入单子", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiTargetInputSub DcBusiTargetInputSub)
{
return toAjax(dcBusiTargetInputSubService.updateDcBusiTargetInputSub(DcBusiTargetInputSub));
}
/**
* 删除指标录入单子
*/
@ApiOperation("删除指标录入单子")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class),
})
@PreAuthorize("@ss.hasPermi('bill:DcBusiTargetInputSub:remove')")
@Log(title = "指标录入单子", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiTargetInputSubService.deleteDcBusiTargetInputSubByIds(ids));
}
}

110
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputMaster.java

@ -0,0 +1,110 @@
package com.lzbi.bill.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 指标录入单对象 dc_busi_target_input_master
*
* @author lienbo
* @date 2024-01-19
*/
@Data
@Accessors(chain = true)
public class DcBusiTargetInputMaster extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 单据号 */
@Excel(name = "单据号")
@ApiModelProperty(name = "单据号",notes = "billSerial")
private String billSerial;
/** 单据类别 */
@Excel(name = "单据类别")
@ApiModelProperty(name = "单据类别",notes = "biilType")
private String biilType;
/** 公司ID */
@Excel(name = "公司ID")
@ApiModelProperty(name = "公司ID",notes = "companyId")
private Long companyId;
/** 公司名称 */
@Excel(name = "公司名称")
@ApiModelProperty(name = "公司名称",notes = "companyName")
private String companyName;
/** 组织机构名称 */
@Excel(name = "组织机构名称")
@ApiModelProperty(name = "组织机构名称",notes = "organizeName")
private String organizeName;
/** 组织机构ID */
@Excel(name = "组织机构ID")
@ApiModelProperty(name = "组织机构ID",notes = "oragnizeId")
private Long oragnizeId;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
@ApiModelProperty(name = "统计单元编码",notes = "assetCode")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
@ApiModelProperty(name = "统计单元名称",notes = "assetName")
private String assetName;
/** 统计专业代码 */
@Excel(name = "统计专业代码")
@ApiModelProperty(name = "统计专业代码",notes = "fieldCode")
private String fieldCode;
/** 统计专业名称 */
@Excel(name = "统计专业名称")
@ApiModelProperty(name = "统计专业名称",notes = "fieldName")
private String fieldName;
/** 主键 */
private Long id;
/** 年 */
@Excel(name = "年")
@ApiModelProperty(name = "年",notes = "year")
private String year;
/** 月 */
@Excel(name = "月")
@ApiModelProperty(name = "月",notes = "month")
private String month;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** 审核状态;0待审核 1 已经审核 2已处理 */
@Excel(name = "审核状态;0待审核 1 已经审核 2已处理")
@ApiModelProperty(name = "审核状态;0待审核 1 已经审核 2已处理",notes = "checkStatus")
private String checkStatus;
/** 审核类型;1人工2自动 */
@Excel(name = "审核类型;1人工2自动")
@ApiModelProperty(name = "审核类型;1人工2自动",notes = "checkType")
private String checkType;
}

111
lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiTargetInputSub.java

@ -0,0 +1,111 @@
package com.lzbi.bill.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 指标录入单子对象 dc_busi_target_input_sub
*
* @author lienbo
* @date 2024-01-19
*/
@Data
@Accessors(chain = true)
public class DcBusiTargetInputSub extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** 主键 */
private Long id;
/** 主单据编号 */
@Excel(name = "主单据编号")
@ApiModelProperty(name = "主单据编号",notes = "billNoMaster")
private String billNoMaster;
/** 指标编码 */
@Excel(name = "指标编码")
@ApiModelProperty(name = "指标编码",notes = "targetCode")
private String targetCode;
/** 指标名称 */
@Excel(name = "指标名称")
@ApiModelProperty(name = "指标名称",notes = "targetName")
private String targetName;
/** 指标单位 */
@Excel(name = "指标单位")
@ApiModelProperty(name = "指标单位",notes = "tagetUnit")
private String tagetUnit;
/** 日 */
@Excel(name = "日")
@ApiModelProperty(name = "日",notes = "day")
private String day;
/** 结果值 */
@Excel(name = "结果值")
@ApiModelProperty(name = "结果值",notes = "valResult")
private BigDecimal valResult;
/** 公司ID */
@Excel(name = "公司ID")
@ApiModelProperty(name = "公司ID",notes = "companyId")
private Long companyId;
/** 公司名称 */
@Excel(name = "公司名称")
@ApiModelProperty(name = "公司名称",notes = "companyName")
private String companyName;
/** 组织机构名称 */
@Excel(name = "组织机构名称")
@ApiModelProperty(name = "组织机构名称",notes = "organizeName")
private String organizeName;
/** 组织机构ID */
@Excel(name = "组织机构ID")
@ApiModelProperty(name = "组织机构ID",notes = "oragnizeId")
private Long oragnizeId;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
@ApiModelProperty(name = "统计单元编码",notes = "assetCode")
private String assetCode;
/** 统计单元名称 */
@Excel(name = "统计单元名称")
@ApiModelProperty(name = "统计单元名称",notes = "assetName")
private String assetName;
/** 统计专业代码 */
@Excel(name = "统计专业代码")
@ApiModelProperty(name = "统计专业代码",notes = "fieldCode")
private String fieldCode;
/** 统计专业名称 */
@Excel(name = "统计专业名称")
@ApiModelProperty(name = "统计专业名称",notes = "fieldName")
private String fieldName;
}

63
lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputMasterMapper.java

@ -0,0 +1,63 @@
package com.lzbi.bill.mapper;
import java.util.List;
import com.lzbi.bill.domain.DcBusiTargetInputMaster;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 指标录入单Mapper接口
*
* @author lienbo
* @date 2024-01-19
*/
public interface DcBusiTargetInputMasterMapper extends BaseMapper<DcBusiTargetInputMaster>
{
/**
* 查询指标录入单
*
* @param id 指标录入单主键
* @return 指标录入单
*/
public DcBusiTargetInputMaster selectDcBusiTargetInputMasterById(Long id);
/**
* 查询指标录入单列表
*
* @param dcBusiTargetInputMaster 指标录入单
* @return 指标录入单集合
*/
public List<DcBusiTargetInputMaster> selectDcBusiTargetInputMasterList(DcBusiTargetInputMaster dcBusiTargetInputMaster);
/**
* 新增指标录入单
*
* @param dcBusiTargetInputMaster 指标录入单
* @return 结果
*/
public int insertDcBusiTargetInputMaster(DcBusiTargetInputMaster dcBusiTargetInputMaster);
/**
* 修改指标录入单
*
* @param dcBusiTargetInputMaster 指标录入单
* @return 结果
*/
public int updateDcBusiTargetInputMaster(DcBusiTargetInputMaster dcBusiTargetInputMaster);
/**
* 删除指标录入单
*
* @param id 指标录入单主键
* @return 结果
*/
public int deleteDcBusiTargetInputMasterById(Long id);
/**
* 批量删除指标录入单
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetInputMasterByIds(Long[] ids);
}

63
lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiTargetInputSubMapper.java

@ -0,0 +1,63 @@
package com.lzbi.bill.mapper;
import java.util.List;
import com.lzbi.bill.domain.DcBusiTargetInputSub;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 指标录入单子Mapper接口
*
* @author lienbo
* @date 2024-01-19
*/
public interface DcBusiTargetInputSubMapper extends BaseMapper<DcBusiTargetInputSub>
{
/**
* 查询指标录入单子
*
* @param id 指标录入单子主键
* @return 指标录入单子
*/
public DcBusiTargetInputSub selectDcBusiTargetInputSubById(Long id);
/**
* 查询指标录入单子列表
*
* @param dcBusiTargetInputSub 指标录入单子
* @return 指标录入单子集合
*/
public List<DcBusiTargetInputSub> selectDcBusiTargetInputSubList(DcBusiTargetInputSub dcBusiTargetInputSub);
/**
* 新增指标录入单子
*
* @param dcBusiTargetInputSub 指标录入单子
* @return 结果
*/
public int insertDcBusiTargetInputSub(DcBusiTargetInputSub dcBusiTargetInputSub);
/**
* 修改指标录入单子
*
* @param dcBusiTargetInputSub 指标录入单子
* @return 结果
*/
public int updateDcBusiTargetInputSub(DcBusiTargetInputSub dcBusiTargetInputSub);
/**
* 删除指标录入单子
*
* @param id 指标录入单子主键
* @return 结果
*/
public int deleteDcBusiTargetInputSubById(Long id);
/**
* 批量删除指标录入单子
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiTargetInputSubByIds(Long[] ids);
}

255
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiTargetInputMasterService.java

@ -0,0 +1,255 @@
package com.lzbi.bill.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzbi.asset.domain.DcBaseAssetInfo;
import com.lzbi.asset.mapper.DcBaseAssetInfoMapper;
import com.lzbi.bill.domain.DcBusiTargetInputMaster;
import com.lzbi.bill.domain.DcBusiTargetInputSub;
import com.lzbi.bill.mapper.DcBusiTargetInputMasterMapper;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.draft.domain.req.ConfirmReq;
import com.lzbi.draft.domain.req.ProductionDailySheetReq;
import com.lzbi.draft.domain.vo.ProductionDailySheetVO;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.collections4.IteratorUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 指标录入单Service业务层处理
*
* @author lienbo
* @date 2024-01-19
*/
@Service
public class DcBusiTargetInputMasterService extends ServiceImpl<DcBusiTargetInputMasterMapper, DcBusiTargetInputMaster> implements IService<DcBusiTargetInputMaster>
{
@Resource
private DcBaseAssetInfoMapper dcBaseAssetInfoMapper;
@Resource
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
/**
* 查询指标录入单
*
* @param id 指标录入单主键
* @return 指标录入单
*/
public DcBusiTargetInputMaster selectDcBusiTargetInputMasterById(Long id)
{
return baseMapper.selectDcBusiTargetInputMasterById(id);
}
/**
* 查询指标录入单列表
*
* @param dcBusiTargetInputMaster 指标录入单
* @return 指标录入单
*/
public List<DcBusiTargetInputMaster> selectDcBusiTargetInputMasterList(DcBusiTargetInputMaster dcBusiTargetInputMaster)
{
return baseMapper.selectDcBusiTargetInputMasterList(dcBusiTargetInputMaster);
}
/**
* 新增指标录入单
*
* @param dcBusiTargetInputMaster 指标录入单
* @return 结果
*/
public int insertDcBusiTargetInputMaster(DcBusiTargetInputMaster dcBusiTargetInputMaster)
{
dcBusiTargetInputMaster.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetInputMaster(dcBusiTargetInputMaster);
}
/**
* 修改指标录入单
*
* @param dcBusiTargetInputMaster 指标录入单
* @return 结果
*/
public int updateDcBusiTargetInputMaster(DcBusiTargetInputMaster dcBusiTargetInputMaster)
{
dcBusiTargetInputMaster.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiTargetInputMaster(dcBusiTargetInputMaster);
}
/**
* 批量删除指标录入单
*
* @param ids 需要删除的指标录入单主键
* @return 结果
*/
public int deleteDcBusiTargetInputMasterByIds(Long[] ids)
{
return baseMapper.deleteDcBusiTargetInputMasterByIds(ids);
}
/**
* 删除指标录入单信息
*
* @param id 指标录入单主键
* @return 结果
*/
public int deleteDcBusiTargetInputMasterById(Long id)
{
return baseMapper.deleteDcBusiTargetInputMasterById(id);
}
public AjaxResult uploadProductionDaily(MultipartFile file) {
List<ProductionDailySheetVO> list = new ArrayList<>();
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
XSSFWorkbook hssfWorkbook = new XSSFWorkbook(inputStream);
int numberOfSheets = hssfWorkbook.getNumberOfSheets();
DataFormatter formatter = new DataFormatter();
for (int j = 0; j < numberOfSheets; j++) {
XSSFSheet sheetAt = hssfWorkbook.getSheetAt(j);
String sheetName = sheetAt.getSheetName();
//获取数据总行数
int rows = sheetAt.getPhysicalNumberOfRows();
List<List<String>> data = new ArrayList<>();
//每行数据处理
for (int i = 0; i < rows; i++) {
//获取一行数据
XSSFRow row = sheetAt.getRow(i);
if (null != row) {
List<Cell> cells = IteratorUtils.toList(row.cellIterator());
List<String> cellList = new ArrayList<>();
for (int i1 = 0, len1 = cells.size(); i1 < len1; i1++) {
cellList.add(formatter.formatCellValue(cells.get(i1)));
}
data.add(cellList);
}
}
list.add(new ProductionDailySheetVO(j, sheetName, data));
}
return AjaxResult.success(list);
} catch (Exception e) {
log.error("文件解析异常", e);
return AjaxResult.error();
} finally {
try {
if (null != inputStream) {
inputStream.close();
}
} catch (IOException e) {
log.error("文件解析异常", e);
}
}
}
public AjaxResult confirm(ConfirmReq confirmReq) {
List<DcBusiTargetInputSub> result = new ArrayList<>();
List<ProductionDailySheetReq> list = confirmReq.getList();
if (CollectionUtils.isEmpty(list)) {
return AjaxResult.error("请选择需要保存的热源数据");
}
Map<String, DcBaseAssetInfo> assetMap = new HashMap<>();
Map<String, Map<String, DcBaseAssetTarget>> targetMap = new HashMap<>();
for (ProductionDailySheetReq productionDailySheetReq : list) {
String name = productionDailySheetReq.getName();
DcBaseAssetInfo dcBaseAssetInfo = dcBaseAssetInfoMapper.selectDcBaseAssetInfoByAliasName(name);
if (ObjectUtils.isEmpty(dcBaseAssetInfo)) {
return AjaxResult.error(name + "sheet页没有对应的统计单元");
}
DcBaseAssetTarget params = new DcBaseAssetTarget();
params.setAssetCode(dcBaseAssetInfo.getAssetCode());
List<DcBaseAssetTarget> dcBaseAssetTargets = dcBaseAssetTargetMapper.selectDcBaseAssetTargetList(params);
if (CollectionUtils.isEmpty(dcBaseAssetTargets)) {
return AjaxResult.error(name + "sheet页没有对应的指标");
}
Map<String, DcBaseAssetTarget> targetMap1 = new HashMap<>();
dcBaseAssetTargets.forEach(dcBaseAssetTarget -> targetMap1.put(dcBaseAssetTarget.getTargetName(), dcBaseAssetTarget));
targetMap.put(name, targetMap1);
assetMap.put(name, dcBaseAssetInfo);
}
for (ProductionDailySheetReq productionDailySheetReq : list) {
String name = productionDailySheetReq.getName();
DcBaseAssetInfo dcBaseAssetInfo = assetMap.get(name);
Map<String, DcBaseAssetTarget> dcBaseAssetTargetMap = targetMap.get(name);
List<List<String>> data = productionDailySheetReq.getData();
if (!CollectionUtils.isEmpty(data)) {
Map<Integer, Integer> dayMap = new HashMap<>();
boolean sign = false;
for (int i = 0, leni = data.size(); i < leni; i++) {
List<String> row = data.get(i);
if ("日期".equals(row.get(0))) {
Map<String, Integer> columnMap = new HashMap<>();
int lenj = row.size();
for (int j = 1; j < lenj; j++) {
if (!columnMap.containsKey(row.get(j))) {
columnMap.put(row.get(j), j);
}
}
for (int j = 1; j <= 31 && j < lenj; j++) {
String key = j + "日";
if (columnMap.containsKey(key) && !dayMap.containsKey(key)) {
dayMap.put(j, columnMap.get(key));
}
}
sign = true;
continue;
}
if (sign) {
String column = row.get(0);
if (StringUtils.isBlank(column)) {
break;
}
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMap.get(column);
if (!ObjectUtils.isEmpty(dcBaseAssetTarget)) {
dayMap.forEach((day, index) -> {
String v = row.get(index);
if (StringUtils.isNotBlank(v)) {
DcBusiTargetInputSub dcBusiTargetInputSub = new DcBusiTargetInputSub();
BeanUtils.copyProperties(dcBaseAssetTarget, dcBusiTargetInputSub);
dcBusiTargetInputSub.setAssetCode(dcBaseAssetInfo.getAssetCode());
dcBusiTargetInputSub.setAssetName(dcBaseAssetInfo.getAssetName());
dcBusiTargetInputSub.setCompanyId(dcBaseAssetInfo.getComanyId());
dcBusiTargetInputSub.setOragnizeId(dcBaseAssetInfo.getOrgId());
// dcBusiTargetInputSub.setCompanyName();
// dcBusiTargetInputSub.setOrganizeName();
dcBusiTargetInputSub.setTagetUnit(dcBaseAssetTarget.getFieldUnit());
dcBusiTargetInputSub.setDay(String.valueOf(day));
dcBusiTargetInputSub.setValResult(new BigDecimal(v));
result.add(dcBusiTargetInputSub);
}
});
}
}
}
}
}
return AjaxResult.success(result);
}
}

91
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiTargetInputSubService.java

@ -0,0 +1,91 @@
package com.lzbi.bill.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.lzbi.bill.domain.DcBusiTargetInputSub;
import com.lzbi.bill.mapper.DcBusiTargetInputSubMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 指标录入单子Service业务层处理
*
* @author lienbo
* @date 2024-01-19
*/
@Service
public class DcBusiTargetInputSubService extends ServiceImpl<DcBusiTargetInputSubMapper, DcBusiTargetInputSub> implements IService<DcBusiTargetInputSub>
{
/**
* 查询指标录入单子
*
* @param id 指标录入单子主键
* @return 指标录入单子
*/
public DcBusiTargetInputSub selectDcBusiTargetInputSubById(Long id)
{
return baseMapper.selectDcBusiTargetInputSubById(id);
}
/**
* 查询指标录入单子列表
*
* @param dcBusiTargetInputSub 指标录入单子
* @return 指标录入单子
*/
public List<DcBusiTargetInputSub> selectDcBusiTargetInputSubList(DcBusiTargetInputSub dcBusiTargetInputSub)
{
return baseMapper.selectDcBusiTargetInputSubList(dcBusiTargetInputSub);
}
/**
* 新增指标录入单子
*
* @param dcBusiTargetInputSub 指标录入单子
* @return 结果
*/
public int insertDcBusiTargetInputSub(DcBusiTargetInputSub dcBusiTargetInputSub)
{
dcBusiTargetInputSub.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetInputSub(dcBusiTargetInputSub);
}
/**
* 修改指标录入单子
*
* @param dcBusiTargetInputSub 指标录入单子
* @return 结果
*/
public int updateDcBusiTargetInputSub(DcBusiTargetInputSub dcBusiTargetInputSub)
{
dcBusiTargetInputSub.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiTargetInputSub(dcBusiTargetInputSub);
}
/**
* 批量删除指标录入单子
*
* @param ids 需要删除的指标录入单子主键
* @return 结果
*/
public int deleteDcBusiTargetInputSubByIds(Long[] ids)
{
return baseMapper.deleteDcBusiTargetInputSubByIds(ids);
}
/**
* 删除指标录入单子信息
*
* @param id 指标录入单子主键
* @return 结果
*/
public int deleteDcBusiTargetInputSubById(Long id)
{
return baseMapper.deleteDcBusiTargetInputSubById(id);
}
}

10
lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java

@ -146,4 +146,14 @@ public class SelectOptionsControl extends BaseController {
dcBusiParamSource.setFieldCode(fcode);
return AjaxResult.success(dcBusiParamSourceService.selectByVo(dcBusiParamSource));
}
/**
* 查询采集参数树形结构
* @param paramsName 参数名称
* @return
*/
@GetMapping("/selectParamSourceTree")
public AjaxResult selectParamSourceTree(@RequestParam(value = "paramsName", required = false) String paramsName) {
return AjaxResult.success(dcBusiParamSourceService.selectParamSourceTree(paramsName));
}
}

10
lzbi-module/src/main/java/com/lzbi/draft/controller/ReportController.java

@ -197,14 +197,4 @@ public class ReportController extends BaseController {
public List<ThourWeatherVO> getThourWeather(@Validated ReadQueryReq readQueryReq) {
return workParamReadService.getThourWeather(readQueryReq);
}
@PostMapping("/upload/production/daily")
public AjaxResult uploadProductionDaily(MultipartFile file) {
return reportService.uploadProductionDaily(file);
}
@PostMapping("/save/production/daily")
public AjaxResult saveProductionDaily(@RequestBody List<ProductionDailySheetReq> list) {
return reportService.saveProductionDaily(list);
}
}

11
lzbi-module/src/main/java/com/lzbi/draft/domain/req/ConfirmReq.java

@ -0,0 +1,11 @@
package com.lzbi.draft.domain.req;
import lombok.Data;
import java.util.List;
@Data
public class ConfirmReq {
private List<ProductionDailySheetReq> list;
}

44
lzbi-module/src/main/java/com/lzbi/draft/service/ReportService.java

@ -79,49 +79,7 @@ public class ReportService {
return list;
}
public AjaxResult uploadProductionDaily(MultipartFile file) {
List<ProductionDailySheetVO> list = new ArrayList<>();
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
XSSFWorkbook hssfWorkbook = new XSSFWorkbook(inputStream);
int numberOfSheets = hssfWorkbook.getNumberOfSheets();
DataFormatter formatter = new DataFormatter();
for (int j = 0; j < numberOfSheets; j++) {
XSSFSheet sheetAt = hssfWorkbook.getSheetAt(j);
String sheetName = sheetAt.getSheetName();
//获取数据总行数
int rows = sheetAt.getPhysicalNumberOfRows();
List<List<String>> data = new ArrayList<>();
//每行数据处理
for (int i = 0; i < rows; i++) {
//获取一行数据
XSSFRow row = sheetAt.getRow(i);
if (null != row) {
List<Cell> cells = IteratorUtils.toList(row.cellIterator());
List<String> cellList = new ArrayList<>();
for (int i1 = 0, len1 = cells.size(); i1 < len1; i1++) {
cellList.add(formatter.formatCellValue(cells.get(i1)));
}
data.add(cellList);
}
}
list.add(new ProductionDailySheetVO(j, sheetName, data));
}
return AjaxResult.success(list);
} catch (Exception e) {
log.error("文件解析异常", e);
return AjaxResult.error();
} finally {
try {
if (null != inputStream) {
inputStream.close();
}
} catch (IOException e) {
log.error("文件解析异常", e);
}
}
}
public AjaxResult saveProductionDaily(List<ProductionDailySheetReq> list) {
if (CollectionUtils.isEmpty(list)) {

97
lzbi-module/src/main/java/com/lzbi/wechat/controller/BizController.java

@ -0,0 +1,97 @@
package com.lzbi.wechat.controller;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.wechat.service.DeptService;
import com.lzbi.wechat.service.TargetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/wechat/biz")
public class BizController {
@Autowired
@Qualifier("wechatDeptService")
private DeptService deptService;
@Autowired
private TargetService targetService;
/**
* 获取自己所在部门
* @return
*/
@GetMapping("/dept/self/list")
public AjaxResult getSelfDeptList() {
return AjaxResult.success(deptService.getSelfDeptList());
}
/**
* 获取供热面积
* @return
*/
@GetMapping("/heatRadiatingArea")
public AjaxResult getHeatRadiatingArea(@RequestParam("deptId") Long deptId) {
return AjaxResult.success(targetService.getHeatRadiatingArea(deptId));
}
/**
* 获取公司指标值
* @return
*/
@GetMapping("/comany/target")
public AjaxResult getComanyTarget(@RequestParam("deptId") Long deptId) {
return AjaxResult.success(targetService.getComanyTarget(deptId));
}
/**
* 获取热源指标值
* @param type 1单日指标2累计指标
* @return
*/
@GetMapping("/heatSource/target")
public AjaxResult getHeatSourceTarget(@RequestParam("deptId") Long deptId, @RequestParam("type") String type) {
return AjaxResult.success(targetService.getHeatSourceTarget(deptId, type));
}
/**
* 获取换热站参数
* @return
*/
@GetMapping("/heatExchangeStation/params")
public AjaxResult getHeatExchangeStationParams(@RequestParam("deptId") Long deptId) {
return AjaxResult.success(targetService.getHeatExchangeStationParams(deptId));
}
/**
* 获取完成率
* @return
*/
@GetMapping("/finishingRate")
public AjaxResult getFinishingRate(@RequestParam("deptId") Long deptId) {
return AjaxResult.success(targetService.getFinishingRate(deptId));
}
/**
* 获取完成率
* @return
*/
@GetMapping("/finishingRateLine")
public AjaxResult getFinishingRateLine(@RequestParam("deptId") Long deptId) {
return AjaxResult.success(targetService.finishingRateLine(deptId));
}
/**
* 获取下属部门列表
* @return
*/
@GetMapping("/dept/children")
public AjaxResult getDeptChildren(@RequestParam("deptId") Long deptId) {
return AjaxResult.success(deptService.getDeptChildren(deptId));
}
}

36
lzbi-module/src/main/java/com/lzbi/wechat/controller/LoginController.java

@ -0,0 +1,36 @@
package com.lzbi.wechat.controller;
import com.lzbi.common.constant.Constants;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.core.domain.model.LoginBody;
import com.lzbi.framework.web.service.SysLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/wechat/biz/login")
public class LoginController {
@Autowired
private SysLoginService loginService;
/**
* 登录方法
*
* @param loginBody 登录信息
* @return 结果
*/
@PostMapping("/username")
public AjaxResult login(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
ajax.put(Constants.TOKEN, token);
return ajax;
}
}

54
lzbi-module/src/main/java/com/lzbi/wechat/controller/WechatController.java

@ -0,0 +1,54 @@
package com.lzbi.wechat.controller;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.wechat.domain.req.CodeLoginReq;
import com.lzbi.wechat.domain.req.PhoneNumberLoginReq;
import com.lzbi.wechat.domain.req.PhoneNumberReq;
import com.lzbi.wechat.service.WechatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 微信服务相关接口控制器
*/
@RestController
@RequestMapping("/wechat/server")
public class WechatController {
@Autowired
private WechatService wechatService;
/**
* 登录凭证登录
* @param codeLoginReq
* @return
*/
@PostMapping("/codeLogin")
public AjaxResult codeLogin(@Validated @RequestBody CodeLoginReq codeLoginReq) {
return AjaxResult.success("操作成功", wechatService.codeLogin(codeLoginReq));
}
/**
* 获取手机号
* @param phoneNumberReq
* @return
*/
@PostMapping("/phoneNumber")
public AjaxResult getPhoneNumber(@Validated @RequestBody PhoneNumberReq phoneNumberReq) {
return AjaxResult.success("操作成功", wechatService.getPhoneNumber(phoneNumberReq));
}
/**
* 手机号登录
* @param phoneNumberLoginReq
* @return
*/
@PostMapping("/phoneNumberLogin")
public AjaxResult phoneNumberLogin(@Validated @RequestBody PhoneNumberLoginReq phoneNumberLoginReq) {
return AjaxResult.success("操作成功", wechatService.phoneNumberLogin(phoneNumberLoginReq));
}
}

30
lzbi-module/src/main/java/com/lzbi/wechat/domain/SysWechat.java

@ -0,0 +1,30 @@
package com.lzbi.wechat.domain;
import lombok.Data;
/**
* 微信用户关系实体类
*/
@Data
public class SysWechat {
/**
* id
*/
private Long id;
/**
* 微信用户唯一标识
*/
private String openId;
/**
* 手机号
*/
private String phone;
public SysWechat() {}
public SysWechat(String openId, String phone) {
this.openId = openId;
this.phone = phone;
}
}

14
lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatAccessTokenRep.java

@ -0,0 +1,14 @@
package com.lzbi.wechat.domain.rep;
import lombok.Data;
/**
* 获取接口调用凭据
*/
@Data
public class WechatAccessTokenRep extends WechatBaseRep{
private String access_token;
private Long expires_in;
}

19
lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatBaseRep.java

@ -0,0 +1,19 @@
package com.lzbi.wechat.domain.rep;
import lombok.Data;
/**
* 微信接口返回值
*/
@Data
public class WechatBaseRep {
/**
* 错误码
*/
private Integer errcode;
/**
* 错误信息
*/
private String errmsg;
}

23
lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatCodeLoginRep.java

@ -0,0 +1,23 @@
package com.lzbi.wechat.domain.rep;
import lombok.Data;
/**
* 微信登录凭证登录返回值
*/
@Data
public class WechatCodeLoginRep extends WechatBaseRep {
/**
* 会话密钥
*/
private String session_key;
/**
* 用户在开放平台的唯一标识符若当前小程序已绑定到微信开放平台账号下会返回
*/
private String unionid;
/**
* 用户唯一标识
*/
private String openid;
}

28
lzbi-module/src/main/java/com/lzbi/wechat/domain/rep/WechatPhoneNumberRep.java

@ -0,0 +1,28 @@
package com.lzbi.wechat.domain.rep;
import lombok.Data;
/**
* 获取手机号返回值
*/
@Data
public class WechatPhoneNumberRep extends WechatBaseRep {
/**
* 手机号信息
*/
private PhoneInfo phone_info;
/**
* 手机号信息
*/
@Data
public static class PhoneInfo {
private String phoneNumber;
private String purePhoneNumber;
private String countryCode;
}
}

18
lzbi-module/src/main/java/com/lzbi/wechat/domain/req/CodeLoginReq.java

@ -0,0 +1,18 @@
package com.lzbi.wechat.domain.req;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 微信授权登录请求参数
*/
@Data
public class CodeLoginReq {
/**
* 登录时获取的 code可通过wx.login获取
*/
@NotBlank(message = "登录凭证不能为空")
private String code;
}

19
lzbi-module/src/main/java/com/lzbi/wechat/domain/req/PhoneNumberLoginReq.java

@ -0,0 +1,19 @@
package com.lzbi.wechat.domain.req;
import lombok.Data;
/**
* 手机号登录请求参数
*/
@Data
public class PhoneNumberLoginReq {
/**
* 手机号
*/
private String phone;
/**
* 微信用户唯一标识
*/
private String openId;
}

18
lzbi-module/src/main/java/com/lzbi/wechat/domain/req/PhoneNumberReq.java

@ -0,0 +1,18 @@
package com.lzbi.wechat.domain.req;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 获取手机号请求参数
*/
@Data
public class PhoneNumberReq {
/**
* 手机号获取凭证
*/
@NotBlank(message = "手机号获取凭证不能为空")
private String code;
}

28
lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/ChildDeptVO.java

@ -0,0 +1,28 @@
package com.lzbi.wechat.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ChildDeptVO {
/**
* 部门id
*/
private Object deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 一次网供温
*/
private Double temperatureSupply;
/**
* 一次网回温
*/
private Double temperatureComeBack;
}

14
lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/CodeLoginVO.java

@ -0,0 +1,14 @@
package com.lzbi.wechat.domain.vo;
import lombok.Data;
/**
* 登录凭证登录返回值
*/
@Data
public class CodeLoginVO {
private String token;
private String openId;
}

19
lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/DeptVO.java

@ -0,0 +1,19 @@
package com.lzbi.wechat.domain.vo;
import lombok.Data;
/**
* 部门返回值
*/
@Data
public class DeptVO {
/**
* 部门id
*/
private Long value;
/**
* 部门名称
*/
private String label;
}

22
lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/FinishingRateVO.java

@ -0,0 +1,22 @@
package com.lzbi.wechat.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FinishingRateVO {
/**
* 指标怕名称列表
*/
private List<String> names;
/**
* 指标值列表
*/
private List<Double> values;
}

31
lzbi-module/src/main/java/com/lzbi/wechat/domain/vo/TargetVO.java

@ -0,0 +1,31 @@
package com.lzbi.wechat.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 指标返回值
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TargetVO {
/**
* 指标编码
*/
private String targetCode;
/**
* 指标名称
*/
private String targetName;
/**
* 指标单位
*/
private String targetUnit;
/**
*
*/
private Double value;
}

45
lzbi-module/src/main/java/com/lzbi/wechat/mapper/SysWechatMapper.java

@ -0,0 +1,45 @@
package com.lzbi.wechat.mapper;
import com.lzbi.wechat.domain.SysWechat;
import org.apache.ibatis.annotations.Param;
/**
* 微信用户关系数据访问层
*/
public interface SysWechatMapper {
/**
* 查询微信用户关系
* @param id
* @return
*/
SysWechat selectSysWechatById(@Param("id") Long id);
/**
* 查询微信用户关系
* @param openId
* @return
*/
SysWechat selectWechatByOpenId(@Param("openId") String openId);
/**
* 增加微信用户关系
* @param sysWechat
* @return
*/
int insertSysWechat(SysWechat sysWechat);
/**
* 修改微信用户关系
* @param sysWechat
* @return
*/
int updateSysWechat(SysWechat sysWechat);
/**
* 删除微信用户关系
* @param id
* @return
*/
int deleteSysWechat(@Param("id") Long id);
}

92
lzbi-module/src/main/java/com/lzbi/wechat/service/DeptService.java

@ -0,0 +1,92 @@
package com.lzbi.wechat.service;
import com.lzbi.common.constant.BizConstants;
import com.lzbi.common.core.domain.entity.SysDept;
import com.lzbi.common.core.domain.entity.SysRole;
import com.lzbi.common.core.domain.entity.SysUser;
import com.lzbi.common.core.domain.model.LoginUser;
import com.lzbi.common.utils.SecurityUtils;
import com.lzbi.system.service.ISysDeptService;
import com.lzbi.wechat.domain.vo.ChildDeptVO;
import com.lzbi.wechat.domain.vo.DeptVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service("wechatDeptService")
public class DeptService {
@Autowired
private ISysDeptService sysDeptService;
public List<DeptVO> getSelfDeptList() {
List<DeptVO> list = new ArrayList<>();
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getUser();
List<SysRole> roles = sysUser.getRoles();
List<Long> roleIds = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList());
List<SysDept> sysDepts = sysDeptService.selectDeptListByRoleIds(roleIds);
if (!CollectionUtils.isEmpty(sysDepts)) {
list = sysDepts.stream().filter(sysDept -> {
if (BizConstants.DcDeptAttr.COMANY.equals(sysDept.getOrgType())) {
return true;
} else {
return false;
}
}).map(sysDept -> {
DeptVO deptVO = new DeptVO();
deptVO.setValue(sysDept.getDeptId());
deptVO.setLabel(sysDept.getDeptName());
return deptVO;
}).collect(Collectors.toList());
}
return list;
}
public List<ChildDeptVO> getDeptChildren(Long deptId) {
List<ChildDeptVO> list = new ArrayList<>();
SysDept selfDept = sysDeptService.selectDeptById(deptId);
String orgType = selfDept.getOrgType();
if (BizConstants.DcDeptAttr.COMANY.equals(orgType)) {
// SysDept query = new SysDept();
// query.setParentId(deptId);
// query.setOrgType(BizConstants.DcDeptAttr.HEAT_SOURCE);
// List<SysDept> sysDeptList = sysDeptService.selectDeptList(query);
// if (!CollectionUtils.isEmpty(sysDeptList)) {
// list = sysDeptList.stream().map(item -> {
// ChildDeptVO childDeptVO = new ChildDeptVO();
// childDeptVO.setDeptId(item.getDeptId());
// childDeptVO.setDeptName(item.getDeptName());
// childDeptVO.setTemperatureSupply(80D);
// childDeptVO.setTemperatureComeBack(53D);
// return childDeptVO;
// }).collect(Collectors.toList());
// }
list.add(new ChildDeptVO(103L, "1#热源", 80D, 53D));
list.add(new ChildDeptVO(104L, "2#热源", 76D, 42D));
} else {
// QueryWrapper<DcBaseAssetInfo> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("orgCode", deptId);
// queryWrapper.eq("assetType", BizConstants.DcAssetAttr.HEAT_EXCHANGE_STATION);
// List<DcBaseAssetInfo> assetInfoList = dcBaseAssetInfoService.list(queryWrapper);
// if (!CollectionUtils.isEmpty(assetInfoList)) {
// list = assetInfoList.stream().map(item -> {
// ChildDeptVO childDeptVO = new ChildDeptVO();
// childDeptVO.setDeptId(item.getAssetCode());
// childDeptVO.setDeptName(item.getAssetName());
// childDeptVO.setTemperatureSupply(80D);
// childDeptVO.setTemperatureComeBack(53D);
// return childDeptVO;
// }).collect(Collectors.toList());
// }
list.add(new ChildDeptVO(1L, "大唐管井", 90D, 105D));
list.add(new ChildDeptVO(2L, "汪家分局", 80D, 105D));
list.add(new ChildDeptVO(3L, "万盈大厦", 90D, 89D));
}
return list;
}
}

62
lzbi-module/src/main/java/com/lzbi/wechat/service/SysWechatService.java

@ -0,0 +1,62 @@
package com.lzbi.wechat.service;
import com.lzbi.wechat.domain.SysWechat;
import com.lzbi.wechat.mapper.SysWechatMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 微信用户关系业务访问层
*/
@Service
public class SysWechatService {
@Resource
private SysWechatMapper sysWechatMapper;
/**
* 查询微信用户关系
* @param id
* @return
*/
public SysWechat selectWechatById(Long id) {
return sysWechatMapper.selectSysWechatById(id);
}
/**
* 查询微信用户关系
* @param openId
* @return
*/
public SysWechat selectWechatByOpenId(String openId) {
return sysWechatMapper.selectWechatByOpenId(openId);
}
/**
* 增加微信用户关系
* @param sysWechat
* @return
*/
public int insertWechat(SysWechat sysWechat) {
return sysWechatMapper.insertSysWechat(sysWechat);
}
/**
* 修改微信用户关系
* @param sysWechat
* @return
*/
public int updateWechat(SysWechat sysWechat) {
return sysWechatMapper.updateSysWechat(sysWechat);
}
/**
* 删除微信用户关系
* @param id
* @return
*/
public int deleteWechat(Long id) {
return sysWechatMapper.deleteSysWechat(id);
}
}

157
lzbi-module/src/main/java/com/lzbi/wechat/service/TargetService.java

@ -0,0 +1,157 @@
package com.lzbi.wechat.service;
import com.lzbi.common.constant.BizConstants;
import com.lzbi.common.core.domain.entity.SysDept;
import com.lzbi.system.service.ISysDeptService;
import com.lzbi.wechat.domain.vo.TargetVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class TargetService {
@Autowired
private ISysDeptService sysDeptService;
public Double getHeatRadiatingArea(Long deptId) {
Double result = 314251101D;
return result;
}
public Map<String, TargetVO> getComanyTarget(Long deptId) {
Map<String, TargetVO> map = new HashMap<>();
SysDept selfDept = sysDeptService.selectDeptById(deptId);
map.put("00023210", new TargetVO("00023210", "总产热量", "GJ", 14123123D));
map.put("00023211", new TargetVO("00023211", "水总耗", "GJ", 2697D));
map.put("00023212", new TargetVO("00023212", "电总耗", "GJ", 16791D));
map.put("00023213", new TargetVO("00023213", "煤总耗", "GJ", 11679D));
map.put("00023214", new TargetVO("00023214", "平均单耗", "GJ", 8971D));
return map;
}
public Map<String, TargetVO> getHeatSourceTarget(Long deptId, String type) {
Map<String, TargetVO> map = new HashMap<>();
SysDept selfDept = sysDeptService.selectDeptById(deptId);
if (BizConstants.TargetType.DAY.equals(type)) {
map.put("ycwsh", new TargetVO("ycwsh", "一次网水耗", "GJ", 14123123D));
map.put("ycwdh", new TargetVO("ycwdh", "一次网电耗", "GJ", 2697D));
map.put("ycwmh", new TargetVO("ycwmh", "一次网煤耗", "GJ", 16791D));
map.put("zcrl", new TargetVO("zcrl", "总产热量", "GJ", 11679D));
map.put("zcql", new TargetVO("zcql", "总产汽量", "GJ", 8971D));
map.put("zfdl", new TargetVO("zfdl", "总发电量", "GJ", 14123123D));
map.put("ecwsh", new TargetVO("ecwsh", "二次网水耗", "GJ", 2697D));
map.put("ecwdh", new TargetVO("ecwdh", "二次网电耗", "GJ", 16791D));
map.put("xhll", new TargetVO("xhll", "循环流量", "GJ", 11679D));
map.put("ycwgw", new TargetVO("ycwgw", "一次网供温", "GJ", 8971D));
map.put("ycwhw", new TargetVO("ycwhw", "一次网回温", "GJ", 8971D));
map.put("ycwsdh", new TargetVO("ycwsdh", "一次网水单耗", "GJ", 14123123D));
map.put("ycwddh", new TargetVO("ycwddh", "一次网电单耗", "GJ", 2697D));
map.put("ycwmdh", new TargetVO("ycwmdh", "一次网煤单耗", "GJ", 16791D));
map.put("dcrl", new TargetVO("dcrl", "单产热量", "GJ", 11679D));
map.put("dcql", new TargetVO("dcql", "单产汽量", "GJ", 8971D));
map.put("dfdl", new TargetVO("dfdl", "单发电量", "GJ", 14123123D));
map.put("ecwsdh", new TargetVO("ecwsdh", "二次网水单耗", "GJ", 2697D));
map.put("ecwddh", new TargetVO("ecwddh", "二次网电单耗", "GJ", 16791D));
} else {
map.put("ycwshlj", new TargetVO("ycwshlj", "一次网水耗", "GJ", 14123123D));
map.put("ycwdhlj", new TargetVO("ycwdhlj", "一次网电耗", "GJ", 2697D));
map.put("ycwmhlj", new TargetVO("ycwmhlj", "一次网煤耗", "GJ", 16791D));
map.put("zcrllj", new TargetVO("zcrllj", "总产热量", "GJ", 11679D));
map.put("zcqllj", new TargetVO("zcqllj", "总产汽量", "GJ", 8971D));
map.put("zfdllj", new TargetVO("zfdllj", "总发电量", "GJ", 14123123D));
map.put("ecwshlj", new TargetVO("ecwshlj", "二次网水耗", "GJ", 2697D));
map.put("ecwdhlj", new TargetVO("ecwdhlj", "二次网电耗", "GJ", 16791D));
map.put("xhlllj", new TargetVO("xhllj", "循环流量", "GJ", 11679D));
map.put("ycwgwlj", new TargetVO("ycwgwlj", "一次网供温", "GJ", 8971D));
map.put("ycwhwlj", new TargetVO("ycwhwlj", "一次网回温", "GJ", 8971D));
map.put("ycwsdhlj", new TargetVO("ycwsdhlj", "一次网水单耗", "GJ", 14123123D));
map.put("ycwddhlj", new TargetVO("ycwddhlj", "一次网电单耗", "GJ", 2697D));
map.put("ycwmdhlj", new TargetVO("ycwmdhlj", "一次网煤单耗", "GJ", 16791D));
map.put("dcrllj", new TargetVO("dcrllj", "单产热量", "GJ", 11679D));
map.put("dcqllj", new TargetVO("dcqllj", "单产汽量", "GJ", 8971D));
map.put("dfdllj", new TargetVO("dfdllj", "单发电量", "GJ", 14123123D));
map.put("ecwsdhlj", new TargetVO("ecwsdhlj", "二次网水单耗", "GJ", 2697D));
map.put("ecwddhlj", new TargetVO("ecwddhlj", "二次网电单耗", "GJ", 16791D));
}
return map;
}
public Map<String, TargetVO> getHeatExchangeStationParams(Long deptId) {
Map<String, TargetVO> map = new HashMap<>();
map.put("014", new TargetVO("014", "一次网回压", "Mpa", 14123123D));
map.put("013", new TargetVO("013", "一次网供压", "Mpa", 2697D));
map.put("011", new TargetVO("011", "一次网供温", "°C", 16791D));
map.put("012", new TargetVO("012", "一次网回温", "°C", 11679D));
map.put("007", new TargetVO("007", "瞬时流量", "m³/h", 8971D));
map.put("008", new TargetVO("008", "瞬时热量", "kcal", 14123123D));
map.put("009", new TargetVO("009", "累计热量", "kcal", 2697D));
map.put("047", new TargetVO("047", "二次网供水压力", "Mpa", 16791D));
map.put("048", new TargetVO("048", "二次网回水压力", "Mpa", 11679D));
map.put("045", new TargetVO("045", "二次网供水温", "°C", 8971D));
map.put("046", new TargetVO("046", "二次网回水温", "°C", 8971D));
map.put("001", new TargetVO("001", "电调阀开度给定", "%", 14123123D));
map.put("002", new TargetVO("002", "电调阀开度反馈", "%", 2697D));
map.put("015", new TargetVO("015", "水箱水位计", "GJ", 16791D));
map.put("004", new TargetVO("004", "电调阀控制模式选择", "GJ", 11679D));
map.put("003", new TargetVO("003", "电调阀远控/就地", "°C", 8971D));
map.put("044", new TargetVO("044", "二次网压差设定", "%", 14123123D));
map.put("019", new TargetVO("019", "一次网管道泵上电", "", 2697D));
map.put("020", new TargetVO("020", "一次网管道泵下电", "", 16791D));
map.put("005", new TargetVO("005", "二次网供温设定", "", 16791D));
map.put("018", new TargetVO("018", "一次网管道泵远控/就地", "", 16791D));
map.put("021", new TargetVO("021", "一次网管道泵启动", "", 16791D));
map.put("010", new TargetVO("010", "热量累计清零", "kwh", 16791D));
map.put("017", new TargetVO("017", "总电表", "°C", 16791D));
map.put("006", new TargetVO("006", "二次网供回水平均温设定", "m³", 16791D));
map.put("031", new TargetVO("031", "水表(累计补水量)", "%", 16791D));
map.put("023", new TargetVO("023", "一次网管道泵频率给定", "%", 16791D));
map.put("028", new TargetVO("028", "一次网混水电调阀开度给定", "%", 16791D));
map.put("029", new TargetVO("029", "一次网混水电调阀开度反馈", "", 16791D));
map.put("035", new TargetVO("035", "补水泵1#故障状态", "m³", 16791D));
map.put("032", new TargetVO("032", "水表(累计补水量清零)", "", 16791D));
map.put("036", new TargetVO("036", "补水泵2#故障状态", "", 16791D));
map.put("037", new TargetVO("037", "循环泵远控/就地选择", "", 16791D));
map.put("038", new TargetVO("038", "循环泵1#/2#泵选择", "", 16791D));
map.put("039", new TargetVO("039", "循环泵控制模式选择", "", 16791D));
map.put("025", new TargetVO("025", "一次网管道泵运行/停止状态", "", 16791D));
map.put("026", new TargetVO("026", "一次网管道泵故障状态", "", 16791D));
map.put("027", new TargetVO("027", "一次网混水电调阀远控/就地", "", 16791D));
map.put("033", new TargetVO("033", "补水泵1#运行/停止状态", "", 16791D));
map.put("034", new TargetVO("034", "补水泵2#运行/停止状态", "", 16791D));
map.put("040", new TargetVO("040", "循环泵变频上电", "", 16791D));
map.put("041", new TargetVO("041", "循环泵变频下电", "", 16791D));
map.put("042", new TargetVO("042", "循环泵变频启动", "", 16791D));
map.put("043", new TargetVO("043", "循环泵变频停止", "", 16791D));
map.put("022", new TargetVO("022", "一次网管道泵停止", "", 16791D));
map.put("030", new TargetVO("030", "水表(瞬时补水量)", "m³", 16791D));
map.put("066", new TargetVO("066", "一次网管道泵启/停", "", 16791D));
map.put("024", new TargetVO("024", "一次网管道泵频率反馈", "", 16791D));
return map;
}
public List<List<Object>> getFinishingRate(Long deptId) {
List<List<Object>> list = new ArrayList<>();
List<Object> names = Arrays.asList("name", "水耗", "电耗", "煤耗");
List<Object> values = Arrays.asList("总完成率", 90D, 80D, 95D);
list.add(names);
list.add(values);
return list;
}
public List<List<Object>> finishingRateLine(Long deptId) {
List<List<Object>> list = new ArrayList<>();
List<Object> list1 = Arrays.asList("product", "2012", "2013", "2014", "2015", "2016", "2017");
List<Object> list2 = Arrays.asList("Milk Tea", 56.5, 82.1, 88.7, 70.1, 53.4, 85.1);
List<Object> list3 = Arrays.asList("Matcha Latte", 51.1, 51.4, 55.1, 53.3, 73.8, 68.7);
List<Object> list4 = Arrays.asList("Cheese Cocoa", 40.1, 62.2, 69.5, 36.4, 45.2, 32.5);
List<Object> list5 = Arrays.asList("Walnut Brownie", 25.2, 37.1, 41.2, 18, 33.9, 49.1);
list.add(list1);
list.add(list2);
list.add(list3);
list.add(list4);
list.add(list5);
return list;
}
}

163
lzbi-module/src/main/java/com/lzbi/wechat/service/WechatService.java

@ -0,0 +1,163 @@
package com.lzbi.wechat.service;
import com.alibaba.fastjson2.JSONObject;
import com.lzbi.common.config.WechatConfig;
import com.lzbi.common.core.domain.entity.SysUser;
import com.lzbi.common.core.domain.model.LoginUser;
import com.lzbi.common.core.redis.RedisCache;
import com.lzbi.common.exception.ServiceException;
import com.lzbi.framework.web.service.SysLoginService;
import com.lzbi.framework.web.service.SysPermissionService;
import com.lzbi.framework.web.service.TokenService;
import com.lzbi.system.service.ISysUserService;
import com.lzbi.wechat.domain.SysWechat;
import com.lzbi.wechat.domain.rep.WechatAccessTokenRep;
import com.lzbi.wechat.domain.rep.WechatCodeLoginRep;
import com.lzbi.wechat.domain.rep.WechatPhoneNumberRep;
import com.lzbi.wechat.domain.req.CodeLoginReq;
import com.lzbi.wechat.domain.req.PhoneNumberLoginReq;
import com.lzbi.wechat.domain.req.PhoneNumberReq;
import com.lzbi.wechat.domain.vo.CodeLoginVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
/**
* 微信服务业务逻辑层
*/
@Slf4j
@Service
public class WechatService {
@Autowired
private WechatConfig wechatConfig;
@Autowired
private RestTemplate restTemplate;
@Autowired
private SysWechatService sysWechatService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private SysLoginService sysLoginService;
@Autowired
private TokenService tokenService;
@Autowired
private SysPermissionService permissionService;
/**
* 登录凭证登录
*
* @param codeLoginReq
* @return
*/
public CodeLoginVO codeLogin(CodeLoginReq codeLoginReq) {
CodeLoginVO codeLoginVO = new CodeLoginVO();
// 微信登录凭证登录请求,获取到open_id
Map<String, Object> params = new HashMap<>();
params.put("appid", wechatConfig.getAppId());
params.put("secret", wechatConfig.getAppSecret());
params.put("js_code", codeLoginReq.getCode());
params.put("grant_type", "authorization_code");
WechatCodeLoginRep resp = restTemplate.getForObject(wechatConfig.getCode2Session(), WechatCodeLoginRep.class, params);
if (ObjectUtils.isNotEmpty(resp) && 0L == resp.getErrcode()) {
String openid = resp.getOpenid();
codeLoginVO.setOpenId(openid);
// 根据open_id到数据库中查询sysWechat信息
SysWechat sysWechat = sysWechatService.selectWechatByOpenId(openid);
// 查询到了的话,执行登录操作,返回token
if (ObjectUtils.isNotEmpty(sysWechat)) {
SysUser sysUser = sysUserService.selectUserByPhonenumber(sysWechat.getPhone());
if (ObjectUtils.isNotEmpty(sysUser)) {
String token = this.getToken(sysUser);
codeLoginVO.setToken(token);
}
}
} else {
log.error("调用微信服务小程序登录接口时失败,{}, {}", resp.getErrcode(), resp.getErrmsg());
throw new ServiceException(resp.getErrmsg(), resp.getErrcode());
}
return codeLoginVO;
}
@Transactional(rollbackFor = Exception.class)
public String phoneNumberLogin(PhoneNumberLoginReq phoneNumberLoginReq) {
// 微信和用户信息绑定
SysWechat sysWechat = new SysWechat(phoneNumberLoginReq.getOpenId(), phoneNumberLoginReq.getPhone());
int i = sysWechatService.insertWechat(sysWechat);
if (i > 0) {
// 获取token
SysUser sysUser = sysUserService.selectUserByPhonenumber(sysWechat.getPhone());
if (ObjectUtils.isNotEmpty(sysUser)) {
return this.getToken(sysUser);
}
}
return null;
}
/**
* 获取手机号
* @param phoneNumberReq
* @return
*/
public String getPhoneNumber(PhoneNumberReq phoneNumberReq) {
// 获取接口调用凭据
Map<String, Object> getAccessTokenParams = new HashMap<>();
getAccessTokenParams.put("appid", wechatConfig.getAppId());
getAccessTokenParams.put("secret", wechatConfig.getAppSecret());
getAccessTokenParams.put("grant_type", "client_credential");
WechatAccessTokenRep wechatAccessTokenRep = restTemplate.getForObject(wechatConfig.getAccessToken(), WechatAccessTokenRep.class, getAccessTokenParams);
if (ObjectUtils.isNotEmpty(wechatAccessTokenRep) && null == wechatAccessTokenRep.getErrcode()) {
// 获取手机号
String accessToken = wechatAccessTokenRep.getAccess_token();
Map<String, Object> getPhoneNumberParams = new HashMap<>();
getPhoneNumberParams.put("access_token", accessToken);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
Map<String, Object> getPhoneNumberBody = new HashMap<>();
getPhoneNumberBody.put("code", phoneNumberReq.getCode());
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(getPhoneNumberBody), headers);
WechatPhoneNumberRep resp = restTemplate.postForObject(wechatConfig.getPhoneNumber(), entity, WechatPhoneNumberRep.class, getPhoneNumberParams);
if (ObjectUtils.isNotEmpty(resp) && 0L == resp.getErrcode()) {
if (null != resp.getPhone_info()) {
return resp.getPhone_info().getPurePhoneNumber();
}
} else {
log.error("调用微信服务获取手机号接口时失败,{}, {}", resp.getErrcode(), resp.getErrmsg());
throw new ServiceException(resp.getErrmsg(), resp.getErrcode());
}
} else {
log.error("调用微信服务获取access_token接口时失败,{}, {}", wechatAccessTokenRep.getErrcode(), wechatAccessTokenRep.getErrmsg());
throw new ServiceException(wechatAccessTokenRep.getErrmsg(), wechatAccessTokenRep.getErrcode());
}
return null;
}
/**
* 获取token
* @param sysUser
* @return
*/
private String getToken(SysUser sysUser) {
LoginUser loginUser = new LoginUser(sysUser.getUserId(), sysUser.getDeptId(), sysUser, permissionService.getMenuPermission(sysUser));
sysLoginService.recordLoginInfo(loginUser.getUserId());
// 生成token
return tokenService.createToken(loginUser);
}
}

26
lzbi-module/src/main/resources/mapper/SysWechatMapper.xml

@ -0,0 +1,26 @@
<?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.lzbi.wechat.mapper.SysWechatMapper">
<select id="selectSysWechatById" resultType="com.lzbi.wechat.domain.SysWechat">
select id, phone, app_id from sys_wechat where id = #{id}
</select>
<select id="selectWechatByOpenId" resultType="com.lzbi.wechat.domain.SysWechat">
select id, phone, app_id from sys_wechat where open_id = #{openId}
</select>
<insert id="insertSysWechat" parameterType="com.lzbi.wechat.domain.SysWechat">
insert into sys_wechat (open_id, phone) values (#{openId}, #{phone})
</insert>
<update id="updateSysWechat">
update sys_wechat set open_id = #{openId}, phone = #{phone} where id = #{id}
</update>
<delete id="deleteSysWechat">
delete from sys_wechat where id = #{id}
</delete>
</mapper>

6
lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml

@ -15,6 +15,7 @@
<result property="deleteTime" column="DELETE_TIME"/>
<result property="id" column="id"/>
<result property="assetName" column="asset_name"/>
<result property="assetNameAlias" column="asset_name_alias"/>
<result property="assetCode" column="asset_code"/>
<result property="assetClass" column="asset_class"/>
<result property="flagValidateDept" column="flag_validate_dept"/>
@ -36,6 +37,7 @@
DELETE_TIME,
id,
asset_name,
asset_name_alias,
asset_code,
asset_class,
flag_validate_dept,
@ -71,6 +73,10 @@
<include refid="selectDcBaseAssetInfoVo"/>
where id = #{id}
</select>
<select id="selectDcBaseAssetInfoByAliasName" parameterType="java.lang.String" resultMap="DcBaseAssetInfoResult">
<include refid="selectDcBaseAssetInfoVo"/>
where asset_name_alias = #{assetNameAlias}
</select>
<select id="selectDcBaseAssetInfoByCode" parameterType="String" resultMap="DcBaseAssetInfoResult">
<include refid="selectDcBaseAssetInfoVo"/>

80
lzbi-module/src/main/resources/mapper/asset/DcBusiParamSourceMapper.xml

@ -5,64 +5,30 @@
<mapper namespace="com.lzbi.asset.mapper.DcBusiParamSourceMapper">
<resultMap type="com.lzbi.asset.domain.DcBusiParamSource" id="rmDcBusiParamSource">
<!-- 租户号 -->
<result property="tenantId" column="tenant_id"/>
<!-- 乐观锁 -->
<result property="revision" column="revision"/>
<!-- 创建人 -->
<result property="createdBy" column="created_by"/>
<!-- 创建时间 -->
<result property="createdTime" column="created_time"/>
<!-- 更新人 -->
<result property="updatedBy" column="updated_by"/>
<!-- 更新时间 -->
<result property="updatedTime" column="updated_time"/>
<!-- 删除人 -->
<result property="deleteBy" column="delete_by"/>
<!-- 删除时间 -->
<result property="deleteTime" column="delete_time"/>
<!-- 参数编码 -->
<result property="paramCode" column="param_code"/>
<!-- 参数名称 -->
<result property="paramName" column="param_name"/>
<!-- 分组名称 -->
<result property="groupName" column="group_name"/>
<!-- 分组编码 -->
<result property="groupCode" column="group_code"/>
<!-- 扩展属性 -->
<result property="extPro" column="ext_pro"/>
<!-- 来源类型 -->
<result property="sourceType" column="source_type"/>
<!-- 是否有效 -->
<result property="enabledFlag" column="enabled_flag"/>
<!-- 主键 -->
<result property="id" column="id"/>
<!-- 所属专业 -->
<result property="fieldCode" column="field_code"/>
<!-- 所属名称 -->
<result property="fieldName" column="field_name"/>
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="paramCode" column="param_code" />
<result property="paramName" column="param_name" />
<result property="groupName" column="group_name" />
<result property="groupCode" column="group_code" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="partion" column="partion" />
<result property="extPro" column="ext_pro" />
<result property="sourceType" column="source_type" />
<result property="enabledFlag" column="enabled_flag" />
<result property="id" column="id" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
</resultMap>
<sql id="baseQuerySql">
select
tenant_id,
revision,
created_by,
created_time,
updated_by,
updated_time,
delete_by,
delete_time,
param_code,
param_name,
group_name,
group_code,
ext_pro,
source_type,
enabled_flag,
id,
field_code,
field_name
from dc_busi_param_source
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, param_code, param_name, group_name, group_code, asset_code, asset_name, partion, ext_pro, source_type, enabled_flag, id, field_code, field_name from dc_busi_param_source
</sql>
<select id="selectByVo" resultMap="rmDcBusiParamSource" parameterType="com.lzbi.asset.domain.DcBusiParamSource">
<include refid="baseQuerySql"/>
@ -76,7 +42,7 @@
<if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if>
<if test="deleteTime != null and deleteTime != ''"> and delete_time = #{deleteTime}</if>
<if test="paramCode != null and paramCode != ''"> and param_code = #{paramCode}</if>
<if test="paramName != null and paramName != ''"> and param_name = #{paramName}</if>
<if test="paramName != null and paramName != ''"> and instr(param_name, #{paramName} ) > 0</if>
<if test="groupName != null and groupName != ''"> and group_name = #{groupName}</if>
<if test="groupCode != null and groupCode != ''"> and group_code = #{groupCode}</if>
<if test="extPro != null and extPro != ''"> and ext_pro = #{extPro}</if>

153
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputMasterMapper.xml

@ -0,0 +1,153 @@
<?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.lzbi.bill.mapper.DcBusiTargetInputMasterMapper">
<resultMap type="com.lzbi.bill.domain.DcBusiTargetInputMaster" id="DcBusiTargetInputMasterResult">
<result property="billSerial" column="bill_serial" />
<result property="biilType" column="biil_type" />
<result property="companyId" column="company_id" />
<result property="companyName" column="company_name" />
<result property="organizeName" column="organize_name" />
<result property="oragnizeId" column="oragnize_id" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
<result property="id" column="id" />
<result property="year" column="year" />
<result property="month" column="month" />
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="checkStatus" column="check_status" />
<result property="checkType" column="check_type" />
</resultMap>
<sql id="selectDcBusiTargetInputMasterVo">
select bill_serial, biil_type, company_id, company_name, organize_name, oragnize_id, asset_code, asset_name, field_code, field_name, id, year, month, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, check_status, check_type from dc_busi_target_input_master
</sql>
<select id="selectDcBusiTargetInputMasterList" parameterType="DcBusiTargetInputMaster" resultMap="DcBusiTargetInputMasterResult">
<include refid="selectDcBusiTargetInputMasterVo"/>
<where>
<if test="billSerial != null and billSerial != ''"> and bill_serial = #{billSerial}</if>
<if test="biilType != null and biilType != ''"> and biil_type = #{biilType}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="organizeName != null and organizeName != ''"> and organize_name like concat('%', #{organizeName}, '%')</if>
<if test="oragnizeId != null "> and oragnize_id = #{oragnizeId}</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
<if test="assetName != null and assetName != ''"> and asset_name like concat('%', #{assetName}, '%')</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
<if test="year != null and year != ''"> and year = #{year}</if>
<if test="month != null and month != ''"> and month = #{month}</if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
</where>
</select>
<select id="selectDcBusiTargetInputMasterById" parameterType="Long" resultMap="DcBusiTargetInputMasterResult">
<include refid="selectDcBusiTargetInputMasterVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiTargetInputMaster" parameterType="DcBusiTargetInputMaster" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_input_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billSerial != null">bill_serial,</if>
<if test="biilType != null">biil_type,</if>
<if test="companyId != null">company_id,</if>
<if test="companyName != null">company_name,</if>
<if test="organizeName != null">organize_name,</if>
<if test="oragnizeId != null">oragnize_id,</if>
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="fieldCode != null">field_code,</if>
<if test="fieldName != null">field_name,</if>
<if test="year != null">year,</if>
<if test="month != null">month,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="checkStatus != null">check_status,</if>
<if test="checkType != null">check_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billSerial != null">#{billSerial},</if>
<if test="biilType != null">#{biilType},</if>
<if test="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="organizeName != null">#{organizeName},</if>
<if test="oragnizeId != null">#{oragnizeId},</if>
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="fieldName != null">#{fieldName},</if>
<if test="year != null">#{year},</if>
<if test="month != null">#{month},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="checkStatus != null">#{checkStatus},</if>
<if test="checkType != null">#{checkType},</if>
</trim>
</insert>
<update id="updateDcBusiTargetInputMaster" parameterType="DcBusiTargetInputMaster">
update dc_busi_target_input_master
<trim prefix="SET" suffixOverrides=",">
<if test="billSerial != null">bill_serial = #{billSerial},</if>
<if test="biilType != null">biil_type = #{biilType},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="organizeName != null">organize_name = #{organizeName},</if>
<if test="oragnizeId != null">oragnize_id = #{oragnizeId},</if>
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
<if test="year != null">year = #{year},</if>
<if test="month != null">month = #{month},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="checkStatus != null">check_status = #{checkStatus},</if>
<if test="checkType != null">check_type = #{checkType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiTargetInputMasterById" parameterType="Long">
delete from dc_busi_target_input_master where id = #{id}
</delete>
<delete id="deleteDcBusiTargetInputMasterByIds" parameterType="String">
delete from dc_busi_target_input_master where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

154
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetInputSubMapper.xml

@ -0,0 +1,154 @@
<?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.lzbi.bill.mapper.DcBusiTargetInputSubMapper">
<resultMap type="com.lzbi.bill.domain.DcBusiTargetInputSub" id="DcBusiTargetInputSubResult">
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="id" column="id" />
<result property="billNoMaster" column="bill_no_master" />
<result property="targetCode" column="target_code" />
<result property="targetName" column="target_name" />
<result property="tagetUnit" column="taget_unit" />
<result property="day" column="day" />
<result property="valResult" column="val_result" />
<result property="companyId" column="company_id" />
<result property="companyName" column="company_name" />
<result property="organizeName" column="organize_name" />
<result property="oragnizeId" column="oragnize_id" />
<result property="assetCode" column="asset_code" />
<result property="assetName" column="asset_name" />
<result property="fieldCode" column="field_code" />
<result property="fieldName" column="field_name" />
</resultMap>
<sql id="selectDcBusiTargetInputSubVo">
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, id, bill_no_master, target_code, target_name, taget_unit, day, val_result, company_id, company_name, organize_name, oragnize_id, asset_code, asset_name, field_code, field_name from dc_busi_target_input_sub
</sql>
<select id="selectDcBusiTargetInputSubList" parameterType="DcBusiTargetInputSub" resultMap="DcBusiTargetInputSubResult">
<include refid="selectDcBusiTargetInputSubVo"/>
<where>
<if test="billNoMaster != null and billNoMaster != ''"> and bill_no_master = #{billNoMaster}</if>
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if>
<if test="tagetUnit != null and tagetUnit != ''"> and taget_unit = #{tagetUnit}</if>
<if test="day != null and day != ''"> and day = #{day}</if>
<if test="valResult != null "> and val_result = #{valResult}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="organizeName != null and organizeName != ''"> and organize_name like concat('%', #{organizeName}, '%')</if>
<if test="oragnizeId != null "> and oragnize_id = #{oragnizeId}</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
<if test="assetName != null and assetName != ''"> and asset_name like concat('%', #{assetName}, '%')</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
</where>
order by company_id, oragnize_id, asset_code, target_code
</select>
<select id="selectDcBusiTargetInputSubById" parameterType="Long" resultMap="DcBusiTargetInputSubResult">
<include refid="selectDcBusiTargetInputSubVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiTargetInputSub" parameterType="DcBusiTargetInputSub" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_input_sub
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="billNoMaster != null">bill_no_master,</if>
<if test="targetCode != null">target_code,</if>
<if test="targetName != null">target_name,</if>
<if test="tagetUnit != null">taget_unit,</if>
<if test="day != null">day,</if>
<if test="valResult != null">val_result,</if>
<if test="companyId != null">company_id,</if>
<if test="companyName != null">company_name,</if>
<if test="organizeName != null">organize_name,</if>
<if test="oragnizeId != null">oragnize_id,</if>
<if test="assetCode != null">asset_code,</if>
<if test="assetName != null">asset_name,</if>
<if test="fieldCode != null">field_code,</if>
<if test="fieldName != null">field_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="billNoMaster != null">#{billNoMaster},</if>
<if test="targetCode != null">#{targetCode},</if>
<if test="targetName != null">#{targetName},</if>
<if test="tagetUnit != null">#{tagetUnit},</if>
<if test="day != null">#{day},</if>
<if test="valResult != null">#{valResult},</if>
<if test="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="organizeName != null">#{organizeName},</if>
<if test="oragnizeId != null">#{oragnizeId},</if>
<if test="assetCode != null">#{assetCode},</if>
<if test="assetName != null">#{assetName},</if>
<if test="fieldCode != null">#{fieldCode},</if>
<if test="fieldName != null">#{fieldName},</if>
</trim>
</insert>
<update id="updateDcBusiTargetInputSub" parameterType="DcBusiTargetInputSub">
update dc_busi_target_input_sub
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="billNoMaster != null">bill_no_master = #{billNoMaster},</if>
<if test="targetCode != null">target_code = #{targetCode},</if>
<if test="targetName != null">target_name = #{targetName},</if>
<if test="tagetUnit != null">taget_unit = #{tagetUnit},</if>
<if test="day != null">day = #{day},</if>
<if test="valResult != null">val_result = #{valResult},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="organizeName != null">organize_name = #{organizeName},</if>
<if test="oragnizeId != null">oragnize_id = #{oragnizeId},</if>
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetName != null">asset_name = #{assetName},</if>
<if test="fieldCode != null">field_code = #{fieldCode},</if>
<if test="fieldName != null">field_name = #{fieldName},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiTargetInputSubById" parameterType="Long">
delete from dc_busi_target_input_sub where id = #{id}
</delete>
<delete id="deleteDcBusiTargetInputSubByIds" parameterType="String">
delete from dc_busi_target_input_sub where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

1
lzbi-system/src/main/java/com/lzbi/system/mapper/SysDeptMapper.java

@ -121,4 +121,5 @@ public interface SysDeptMapper
public List<SysDept> selectCompany(Long parentId);
public HashMap<Long,String> selectDeptMap();
List<SysDept> selectDeptListByRoleIds(List<Long> ids);
}

8
lzbi-system/src/main/java/com/lzbi/system/mapper/SysUserMapper.java

@ -43,6 +43,14 @@ public interface SysUserMapper
*/
public SysUser selectUserByUserName(String userName);
/**
* 根据手机号查询用户
*
* @param phonenumber
* @return
*/
SysUser selectUserByPhonenumber(@Param("phonenumber") String phonenumber);
/**
* 通过用户ID查询用户
*

7
lzbi-system/src/main/java/com/lzbi/system/service/ISysDeptService.java

@ -28,6 +28,13 @@ public interface ISysDeptService
*/
public List<TreeSelect> selectDeptTreeList(SysDept dept);
/**
* 根据角色id列表查询
* @param ids
* @return
*/
List<SysDept> selectDeptListByRoleIds(List<Long> ids);
/**
* 构建前端所需要树结构
*

2
lzbi-system/src/main/java/com/lzbi/system/service/ISysUserService.java

@ -203,4 +203,6 @@ public interface ISysUserService
* @return 结果
*/
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
SysUser selectUserByPhonenumber(String phone);
}

5
lzbi-system/src/main/java/com/lzbi/system/service/impl/SysDeptServiceImpl.java

@ -60,6 +60,11 @@ public class SysDeptServiceImpl implements ISysDeptService {
return buildDeptTreeSelect(depts);
}
@Override
public List<SysDept> selectDeptListByRoleIds(List<Long> ids) {
return deptMapper.selectDeptListByRoleIds(ids);
}
/**
* 构建前端所需要树结构
*

5
lzbi-system/src/main/java/com/lzbi/system/service/impl/SysUserServiceImpl.java

@ -541,4 +541,9 @@ public class SysUserServiceImpl implements ISysUserService
}
return successMsg.toString();
}
@Override
public SysUser selectUserByPhonenumber(String phone) {
return userMapper.selectUserByPhonenumber(phone);
}
}

12
lzbi-system/src/main/resources/mapper/system/SysDeptMapper.xml

@ -112,7 +112,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<select id="selectDeptListByRoleIds" parameterType="List" resultMap="SysDeptResult">
select DISTINCT d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time,d.short_name,d.all_name,d.org_type from sys_dept d left join sys_role_dept rd on d.dept_id = rd.dept_id
where d.del_flag = '0'
and rd.role_id in
<foreach collection="list" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
order by d.parent_id, d.order_num
</select>
<insert id="insertDept" parameterType="SysDept">
insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>

11
lzbi-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -124,7 +124,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectUserVo"/>
where u.user_name = #{userName} and u.del_flag = '0'
</select>
<select id="selectUserByPhonenumber" resultType="com.lzbi.common.core.domain.entity.SysUser">
<include refid="selectUserVo"/>
where u.phonenumber = #{phonenumber} and u.del_flag = '0'
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_id = #{userId}
@ -141,8 +146,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>

Loading…
Cancel
Save