杨世强 2 years ago
commit 2cd661207d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

@ -25,6 +25,12 @@
<artifactId>guava</artifactId>
<version>23.4-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20220924</version>
</dependency>
<dependency>

@ -0,0 +1,200 @@
package jnpf.inventoryOrd.controller;
import io.swagger.annotations.Api;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.exception.DataException;
import jnpf.inventoryOrd.entity.InventoryOrgEntity;
import jnpf.inventoryOrd.model.inventoryorg.*;
import jnpf.inventoryOrd.service.InventoryOrgService;
import jnpf.util.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Slf4j
@RestController
@Api(tags = "库存组织" , value = "example")
@RequestMapping("/api/example/InventoryOrg")
public class InventoryOrgController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private InventoryOrgService inventoryOrgService;
/**
*
*
* @param inventoryOrgPagination
* @return
*/
@PostMapping("/getList")
public ActionResult list(@RequestBody InventoryOrgPagination inventoryOrgPagination)throws IOException{
List<InventoryOrgEntity> list= inventoryOrgService.getList(inventoryOrgPagination);
//处理id字段转名称若无需转或者为空可删除
for(InventoryOrgEntity entity:list){
entity.setCompanyId(generaterSwapUtil.getDynName("394016341591396805" ,"F_FullName" ,"F_Id","" ,entity.getCompanyId()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
}
List<InventoryOrgListVO> listVO=JsonUtil.getJsonToList(list,InventoryOrgListVO.class);
for(InventoryOrgListVO inventoryOrgVO:listVO){
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(inventoryOrgPagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param inventoryOrgCrForm
* @return
*/
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid InventoryOrgCrForm inventoryOrgCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
inventoryOrgCrForm.setCreatorUserName(userInfo.getUserId());
inventoryOrgCrForm.setCreatorTime(DateUtil.getNow());
InventoryOrgEntity entity = JsonUtil.getJsonToBean(inventoryOrgCrForm, InventoryOrgEntity.class);
entity.setId(mainId);
inventoryOrgService.save(entity);
return ActionResult.success("创建成功");
}
/**
*
*
* @param id
* @return
*/
@GetMapping("/{id}")
public ActionResult<InventoryOrgInfoVO> info(@PathVariable("id") String id){
InventoryOrgEntity entity= inventoryOrgService.getInfo(id);
InventoryOrgInfoVO vo=JsonUtil.getJsonToBean(entity, InventoryOrgInfoVO.class);
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
//子表
//副表
return ActionResult.success(vo);
}
/**
* ()
*
* @param id
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<InventoryOrgInfoVO> detailInfo(@PathVariable("id") String id){
InventoryOrgEntity entity= inventoryOrgService.getInfo(id);
InventoryOrgInfoVO vo=JsonUtil.getJsonToBean(entity, InventoryOrgInfoVO.class);
//子表数据转换
//附表数据转换
//添加到详情表单对象中
vo.setCompanyId(generaterSwapUtil.getDynName("394016341591396805" ,"F_FullName" ,"F_Id","" ,vo.getCompanyId()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
return ActionResult.success(vo);
}
/**
*
*
* @param id
* @return
*/
@PutMapping("/{id}")
@Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid InventoryOrgUpForm inventoryOrgUpForm) throws DataException {
UserInfo userInfo=userProvider.get();
InventoryOrgEntity entity= inventoryOrgService.getInfo(id);
if(entity!=null){
inventoryOrgUpForm.setLastModifyUserName(userInfo.getUserId());
inventoryOrgUpForm.setLastModifyTime(DateUtil.getNow());
InventoryOrgEntity subentity=JsonUtil.getJsonToBean(inventoryOrgUpForm, InventoryOrgEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime());
inventoryOrgService.update(id, subentity);
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
InventoryOrgEntity entity= inventoryOrgService.getInfo(id);
if(entity!=null){
inventoryOrgService.delete(entity);
}
return ActionResult.success("删除成功");
}
}

@ -1,4 +1,4 @@
package jnpf.monitormanage.entity;
package jnpf.inventoryOrd.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
@ -12,48 +12,54 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-11
*/
@Data
@TableName("jg_monitoring_item0")
public class MonitormanageEntity {
@TableName("jg_inventory_org")
public class InventoryOrgEntity {
@TableId("ID")
private String id;
@TableField("INVENTORY_ORG_NAME")
private String inventoryOrgName;
@TableField("INVENTORY_ORG_CODE")
private String inventoryOrgCode;
@TableField("CREATOR_USER_ID")
private String creatoruserid;
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorusername;
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatortime;
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid;
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername;
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastmodifytime;
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteuserid;
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteusername;
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deletetime;
private Date deleteTime;
@TableField("DELETE_MARK")
private String deletemark;
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@ -61,25 +67,7 @@ public class MonitormanageEntity {
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("MONITORING_ID")
private String monitoringId;
@TableField("M_NAME")
private String mName;
@TableField("SERIALNUMBER")
private String serialnumber;
@TableField("IP")
private String ip;
@TableField("PORT")
private Integer port;
@TableField("ACCOUNT")
private String account;
@TableField("PASSWORD")
private String password;
@TableField("COMPANY_ID")
private String companyId;
}

@ -0,0 +1,17 @@
package jnpf.inventoryOrd.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.inventoryOrd.entity.InventoryOrgEntity;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-11
*/
public interface InventoryOrgMapper extends BaseMapper<InventoryOrgEntity> {
}

@ -0,0 +1,52 @@
package jnpf.inventoryOrd.model.inventoryorg;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgCrForm {
/** 编码 **/
@JsonProperty("inventoryOrgCode")
private String inventoryOrgCode;
/** 名称 **/
@JsonProperty("inventoryOrgName")
private String inventoryOrgName;
/** 所属组织 **/
@JsonProperty("companyId")
private String companyId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
}

@ -0,0 +1,56 @@
package jnpf.inventoryOrd.model.inventoryorg;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;
/** 编码 **/
@JsonProperty("inventoryOrgCode")
private String inventoryOrgCode;
/** 名称 **/
@JsonProperty("inventoryOrgName")
private String inventoryOrgName;
/** 所属组织 **/
@JsonProperty("companyId")
private String companyId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
}

@ -1,4 +1,4 @@
package jnpf.monitormanage.model.monitormanage;
package jnpf.inventoryOrd.model.inventoryorg;
import lombok.Data;
import java.util.Date;
@ -10,13 +10,16 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-11
*/
@Data
public class MonitormanageListQuery extends Pagination {
public class InventoryOrgListQuery extends Pagination {
/** 设备名称 */
private String mName;
/** 编码 */
private String inventoryOrgCode;
/** 名称 */
private String inventoryOrgName;
/**
* id
*/

@ -0,0 +1,64 @@
package jnpf.inventoryOrd.model.inventoryorg;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgListVO{
/** 主键 */
private String id;
/** 编码 **/
@JsonProperty("inventoryOrgCode")
private String inventoryOrgCode;
/** 名称 **/
@JsonProperty("inventoryOrgName")
private String inventoryOrgName;
/** 所属组织 **/
@JsonProperty("companyId")
private String companyId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
}

@ -0,0 +1,28 @@
package jnpf.inventoryOrd.model.inventoryorg;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgPagination extends Pagination {
/** 编码 */
private String inventoryOrgCode;
/** 名称 */
private String inventoryOrgName;
/**
* id
*/
private String menuId;
}

@ -1,4 +1,4 @@
package jnpf.monitorItem.model.monitoring_item;
package jnpf.inventoryOrd.model.inventoryorg;
import lombok.Data;
import jnpf.base.Pagination;
@ -9,10 +9,10 @@ import java.util.*;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-11
*/
@Data
public class Monitoring_itemPaginationExportModel extends Pagination {
public class InventoryOrgPaginationExportModel extends Pagination {
private String selectKey;
@ -21,6 +21,9 @@ public class Monitoring_itemPaginationExportModel extends Pagination {
private String dataType;
/** 设备名称 */
private String mName;
/** 编码 */
private String inventoryOrgCode;
/** 名称 */
private String inventoryOrgName;
}

@ -0,0 +1,61 @@
package jnpf.inventoryOrd.model.inventoryorg;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgUpForm{
/** 主键 */
private String id;
/** 编码 **/
@JsonProperty("inventoryOrgCode")
private String inventoryOrgCode;
/** 名称 **/
@JsonProperty("inventoryOrgName")
private String inventoryOrgName;
/** 所属组织 **/
@JsonProperty("companyId")
private String companyId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
}

@ -0,0 +1,35 @@
package jnpf.inventoryOrd.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.inventoryOrd.entity.InventoryOrgEntity;
import jnpf.inventoryOrd.model.inventoryorg.InventoryOrgPagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-11
*/
public interface InventoryOrgService extends IService<InventoryOrgEntity> {
List<InventoryOrgEntity> getList(InventoryOrgPagination inventoryOrgPagination);
List<InventoryOrgEntity> getTypeList(InventoryOrgPagination inventoryOrgPagination,String dataType);
InventoryOrgEntity getInfo(String id);
void delete(InventoryOrgEntity entity);
void create(InventoryOrgEntity entity);
boolean update( String id, InventoryOrgEntity entity);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,222 @@
package jnpf.inventoryOrd.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.inventoryOrd.entity.InventoryOrgEntity;
import jnpf.inventoryOrd.mapper.InventoryOrgMapper;
import jnpf.inventoryOrd.model.inventoryorg.InventoryOrgPagination;
import jnpf.inventoryOrd.service.InventoryOrgService;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-11
*/
@Service
public class InventoryOrgServiceImpl extends ServiceImpl<InventoryOrgMapper, InventoryOrgEntity> implements InventoryOrgService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<InventoryOrgEntity> getList(InventoryOrgPagination inventoryOrgPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int inventoryOrgNum =0;
QueryWrapper<InventoryOrgEntity> inventoryOrgQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgQueryWrapper,inventoryOrgPagination.getMenuId(),"inventoryOrg"));
if (ObjectUtil.isEmpty(inventoryOrgObj)){
return new ArrayList<>();
} else {
inventoryOrgQueryWrapper = (QueryWrapper<InventoryOrgEntity>)inventoryOrgObj;
inventoryOrgNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgQueryWrapper,inventoryOrgPagination.getMenuId(),"inventoryOrg"));
if (ObjectUtil.isEmpty(inventoryOrgObj)){
return new ArrayList<>();
} else {
inventoryOrgQueryWrapper = (QueryWrapper<InventoryOrgEntity>)inventoryOrgObj;
inventoryOrgNum++;
}
}
}
if(StringUtil.isNotEmpty(inventoryOrgPagination.getInventoryOrgCode())){
inventoryOrgNum++;
inventoryOrgQueryWrapper.lambda().like(InventoryOrgEntity::getInventoryOrgCode,inventoryOrgPagination.getInventoryOrgCode());
}
if(StringUtil.isNotEmpty(inventoryOrgPagination.getInventoryOrgName())){
inventoryOrgNum++;
inventoryOrgQueryWrapper.lambda().like(InventoryOrgEntity::getInventoryOrgName,inventoryOrgPagination.getInventoryOrgName());
}
if(AllIdList.size()>0){
inventoryOrgQueryWrapper.lambda().in(InventoryOrgEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(inventoryOrgPagination.getSidx())){
inventoryOrgQueryWrapper.lambda().orderByDesc(InventoryOrgEntity::getCreatorTime);
}else{
try {
String sidx = inventoryOrgPagination.getSidx();
InventoryOrgEntity inventoryOrgEntity = new InventoryOrgEntity();
Field declaredField = inventoryOrgEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
inventoryOrgQueryWrapper="asc".equals(inventoryOrgPagination.getSort().toLowerCase())?inventoryOrgQueryWrapper.orderByAsc(value):inventoryOrgQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<InventoryOrgEntity> page=new Page<>(inventoryOrgPagination.getCurrentPage(), inventoryOrgPagination.getPageSize());
IPage<InventoryOrgEntity> userIPage=this.page(page, inventoryOrgQueryWrapper);
return inventoryOrgPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<InventoryOrgEntity> list = new ArrayList();
return inventoryOrgPagination.setData(list, list.size());
}
}
@Override
public List<InventoryOrgEntity> getTypeList(InventoryOrgPagination inventoryOrgPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int inventoryOrgNum =0;
QueryWrapper<InventoryOrgEntity> inventoryOrgQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgQueryWrapper,inventoryOrgPagination.getMenuId(),"inventoryOrg"));
if (ObjectUtil.isEmpty(inventoryOrgObj)){
return new ArrayList<>();
} else {
inventoryOrgQueryWrapper = (QueryWrapper<InventoryOrgEntity>)inventoryOrgObj;
inventoryOrgNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgQueryWrapper,inventoryOrgPagination.getMenuId(),"inventoryOrg"));
if (ObjectUtil.isEmpty(inventoryOrgObj)){
return new ArrayList<>();
} else {
inventoryOrgQueryWrapper = (QueryWrapper<InventoryOrgEntity>)inventoryOrgObj;
inventoryOrgNum++;
}
}
}
if(StringUtil.isNotEmpty(inventoryOrgPagination.getInventoryOrgCode())){
inventoryOrgNum++;
inventoryOrgQueryWrapper.lambda().like(InventoryOrgEntity::getInventoryOrgCode,inventoryOrgPagination.getInventoryOrgCode());
}
if(StringUtil.isNotEmpty(inventoryOrgPagination.getInventoryOrgName())){
inventoryOrgNum++;
inventoryOrgQueryWrapper.lambda().like(InventoryOrgEntity::getInventoryOrgName,inventoryOrgPagination.getInventoryOrgName());
}
if(AllIdList.size()>0){
inventoryOrgQueryWrapper.lambda().in(InventoryOrgEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(inventoryOrgPagination.getSidx())){
inventoryOrgQueryWrapper.lambda().orderByDesc(InventoryOrgEntity::getCreatorTime);
}else{
try {
String sidx = inventoryOrgPagination.getSidx();
InventoryOrgEntity inventoryOrgEntity = new InventoryOrgEntity();
Field declaredField = inventoryOrgEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
inventoryOrgQueryWrapper="asc".equals(inventoryOrgPagination.getSort().toLowerCase())?inventoryOrgQueryWrapper.orderByAsc(value):inventoryOrgQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<InventoryOrgEntity> page=new Page<>(inventoryOrgPagination.getCurrentPage(), inventoryOrgPagination.getPageSize());
IPage<InventoryOrgEntity> userIPage=this.page(page, inventoryOrgQueryWrapper);
return inventoryOrgPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<InventoryOrgEntity> list = new ArrayList();
return inventoryOrgPagination.setData(list, list.size());
}
}else{
return this.list(inventoryOrgQueryWrapper);
}
}
@Override
public InventoryOrgEntity getInfo(String id){
QueryWrapper<InventoryOrgEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(InventoryOrgEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(InventoryOrgEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, InventoryOrgEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(InventoryOrgEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,64 +1,55 @@
package jnpf.monitormanage.controller;
package jnpf.inventoryOrdDetail.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.monitormanage.model.monitormanage.*;
import jnpf.monitormanage.model.monitormanage.MonitormanagePagination;
import jnpf.monitormanage.entity.*;
import jnpf.inventoryOrdDetail.entity.InventoryOrgDetailEntity;
import jnpf.inventoryOrdDetail.model.inventoryorgdetail.*;
import jnpf.inventoryOrdDetail.service.InventoryOrgDetailService;
import jnpf.util.*;
import jnpf.base.util.*;
import jnpf.base.vo.ListVO;
import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.monitormanage.entity.MonitormanageEntity;
import jnpf.monitormanage.service.MonitormanageService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import jnpf.util.GeneraterSwapUtil;
import java.util.*;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* monitormanage
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-11
*/
@Slf4j
@RestController
@Api(tags = "monitormanage" , value = "monitormanage")
@RequestMapping("/api/monitormanage/Monitormanage")
public class MonitormanageController {
@Api(tags = "库存组织详细" , value = "example")
@RequestMapping("/api/example/InventoryOrgDetail")
public class InventoryOrgDetailController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -70,7 +61,7 @@ public class MonitormanageController {
private UserProvider userProvider;
@Autowired
private MonitormanageService monitormanageService;
private InventoryOrgDetailService inventoryOrgDetailService;
@ -78,23 +69,27 @@ public class MonitormanageController {
/**
*
*
* @param monitormanagePagination
* @param inventoryOrgDetailPagination
* @return
*/
@PostMapping("/getList")
public ActionResult list(@RequestBody MonitormanagePagination monitormanagePagination)throws IOException{
List<MonitormanageEntity> list= monitormanageService.getList(monitormanagePagination);
public ActionResult list(@RequestBody InventoryOrgDetailPagination inventoryOrgDetailPagination)throws IOException{
List<InventoryOrgDetailEntity> list= inventoryOrgDetailService.getList(inventoryOrgDetailPagination);
//处理id字段转名称若无需转或者为空可删除
for(MonitormanageEntity entity:list){
for(InventoryOrgDetailEntity entity:list){
Map<String,Object> inventoryIdMap = new HashMap<>();
entity.setInventoryId(generaterSwapUtil.getPopupSelectValue("394085757268070853","id","inventory_org_name",entity.getInventoryId(),inventoryIdMap));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
}
List<MonitormanageListVO> listVO=JsonUtil.getJsonToList(list,MonitormanageListVO.class);
for(MonitormanageListVO monitormanageVO:listVO){
List<InventoryOrgDetailListVO> listVO=JsonUtil.getJsonToList(list,InventoryOrgDetailListVO.class);
for(InventoryOrgDetailListVO inventoryOrgDetailVO:listVO){
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(monitormanagePagination,PaginationVO.class);
PaginationVO page=JsonUtil.getJsonToBean(inventoryOrgDetailPagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
@ -103,17 +98,19 @@ public class MonitormanageController {
/**
*
*
* @param monitormanageCrForm
* @param inventoryOrgDetailCrForm
* @return
*/
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid MonitormanageCrForm monitormanageCrForm) throws DataException {
public ActionResult create(@RequestBody @Valid InventoryOrgDetailCrForm inventoryOrgDetailCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
MonitormanageEntity entity = JsonUtil.getJsonToBean(monitormanageCrForm, MonitormanageEntity.class);
inventoryOrgDetailCrForm.setCreatorUserName(userInfo.getUserId());
inventoryOrgDetailCrForm.setCreatorTime(DateUtil.getNow());
InventoryOrgDetailEntity entity = JsonUtil.getJsonToBean(inventoryOrgDetailCrForm, InventoryOrgDetailEntity.class);
entity.setId(mainId);
monitormanageService.save(entity);
inventoryOrgDetailService.save(entity);
return ActionResult.success("创建成功");
@ -146,22 +143,26 @@ public class MonitormanageController {
*/
@ApiOperation("导出Excel")
@GetMapping("/Actions/Export")
public ActionResult Export(MonitormanagePaginationExportModel monitormanagePaginationExportModel) throws IOException {
if (StringUtil.isEmpty(monitormanagePaginationExportModel.getSelectKey())){
public ActionResult Export(InventoryOrgDetailPaginationExportModel inventoryOrgDetailPaginationExportModel) throws IOException {
if (StringUtil.isEmpty(inventoryOrgDetailPaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
MonitormanagePagination monitormanagePagination=JsonUtil.getJsonToBean(monitormanagePaginationExportModel, MonitormanagePagination.class);
List<MonitormanageEntity> list= monitormanageService.getTypeList(monitormanagePagination,monitormanagePaginationExportModel.getDataType());
InventoryOrgDetailPagination inventoryOrgDetailPagination=JsonUtil.getJsonToBean(inventoryOrgDetailPaginationExportModel, InventoryOrgDetailPagination.class);
List<InventoryOrgDetailEntity> list= inventoryOrgDetailService.getTypeList(inventoryOrgDetailPagination,inventoryOrgDetailPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(MonitormanageEntity entity:list){
for(InventoryOrgDetailEntity entity:list){
Map<String,Object> inventoryIdMap = new HashMap<>();
entity.setInventoryId(generaterSwapUtil.getPopupSelectValue("394085757268070853","id","inventory_org_name",entity.getInventoryId(),inventoryIdMap));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
}
List<MonitormanageListVO> listVO=JsonUtil.getJsonToList(list,MonitormanageListVO.class);
for(MonitormanageListVO monitormanageVO:listVO){
List<InventoryOrgDetailListVO> listVO=JsonUtil.getJsonToList(list,InventoryOrgDetailListVO.class);
for(InventoryOrgDetailListVO inventoryOrgDetailVO:listVO){
}
//转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
String[]keys=!StringUtil.isEmpty(monitormanagePaginationExportModel.getSelectKey())?monitormanagePaginationExportModel.getSelectKey().split(","):new String[0];
String[]keys=!StringUtil.isEmpty(inventoryOrgDetailPaginationExportModel.getSelectKey())?inventoryOrgDetailPaginationExportModel.getSelectKey().split(","):new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,keys,userInfo);
return ActionResult.success(vo);
@ -173,35 +174,26 @@ public class MonitormanageController {
if(keys.length>0){
for(String key:keys){
switch(key){
case "mName" :
entitys.add(new ExcelExportEntity("设备名称" ,"mName"));
break;
case "serialnumber" :
entitys.add(new ExcelExportEntity("设备序列号" ,"serialnumber"));
break;
case "ip" :
entitys.add(new ExcelExportEntity("ip地址" ,"ip"));
case "inventoryOrgDetailCode" :
entitys.add(new ExcelExportEntity("编码" ,"inventoryOrgDetailCode"));
break;
case "port" :
entitys.add(new ExcelExportEntity("端口号" ,"port"));
case "inventoryOrgDetailName" :
entitys.add(new ExcelExportEntity("名称" ,"inventoryOrgDetailName"));
break;
case "account" :
entitys.add(new ExcelExportEntity("账号" ,"account"));
case "inventoryId" :
entitys.add(new ExcelExportEntity("库存组织" ,"inventoryId"));
break;
case "password" :
entitys.add(new ExcelExportEntity("密码" ,"password"));
case "lastModifyUserName" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastModifyUserName"));
break;
case "creatorusername" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorusername"));
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
case "creatortime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatortime"));
case "creatorUserName" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorUserName"));
break;
case "lastmodifyusername" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastmodifyusername"));
break;
case "lastmodifytime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastmodifytime"));
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
default:
break;
@ -234,28 +226,6 @@ public class MonitormanageController {
}
/**
*
*
* @param ids
* @return
*/
@DeleteMapping("/batchRemove/{ids}")
@Transactional
public ActionResult batchRemove(@PathVariable("ids") String ids){
String[] idList = ids.split(",");
int i =0;
for (String allId : idList){
this.delete(allId);
i++;
}
if (i == 0 ){
return ActionResult.fail("删除失败");
}
return ActionResult.success("删除成功");
}
/**
*
*
@ -263,9 +233,17 @@ public class MonitormanageController {
* @return
*/
@GetMapping("/{id}")
public ActionResult<MonitormanageInfoVO> info(@PathVariable("id") String id){
MonitormanageEntity entity= monitormanageService.getInfo(id);
MonitormanageInfoVO vo=JsonUtil.getJsonToBean(entity, MonitormanageInfoVO.class);
public ActionResult<InventoryOrgDetailInfoVO> info(@PathVariable("id") String id){
InventoryOrgDetailEntity entity= inventoryOrgDetailService.getInfo(id);
InventoryOrgDetailInfoVO vo=JsonUtil.getJsonToBean(entity, InventoryOrgDetailInfoVO.class);
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
//子表
//副表
@ -279,15 +257,19 @@ public class MonitormanageController {
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<MonitormanageInfoVO> detailInfo(@PathVariable("id") String id){
MonitormanageEntity entity= monitormanageService.getInfo(id);
MonitormanageInfoVO vo=JsonUtil.getJsonToBean(entity, MonitormanageInfoVO.class);
public ActionResult<InventoryOrgDetailInfoVO> detailInfo(@PathVariable("id") String id){
InventoryOrgDetailEntity entity= inventoryOrgDetailService.getInfo(id);
InventoryOrgDetailInfoVO vo=JsonUtil.getJsonToBean(entity, InventoryOrgDetailInfoVO.class);
//子表数据转换
//附表数据转换
//添加到详情表单对象中
Map<String,Object> inventoryIdMap = new HashMap<>();
vo.setInventoryId(generaterSwapUtil.getPopupSelectValue("394085757268070853","id","inventory_org_name",vo.getInventoryId(),inventoryIdMap));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
return ActionResult.success(vo);
}
@ -303,12 +285,16 @@ public class MonitormanageController {
*/
@PutMapping("/{id}")
@Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid MonitormanageUpForm monitormanageUpForm) throws DataException {
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid InventoryOrgDetailUpForm inventoryOrgDetailUpForm) throws DataException {
UserInfo userInfo=userProvider.get();
MonitormanageEntity entity= monitormanageService.getInfo(id);
InventoryOrgDetailEntity entity= inventoryOrgDetailService.getInfo(id);
if(entity!=null){
MonitormanageEntity subentity=JsonUtil.getJsonToBean(monitormanageUpForm, MonitormanageEntity.class);
monitormanageService.update(id, subentity);
inventoryOrgDetailUpForm.setLastModifyUserName(userInfo.getUserId());
inventoryOrgDetailUpForm.setLastModifyTime(DateUtil.getNow());
InventoryOrgDetailEntity subentity=JsonUtil.getJsonToBean(inventoryOrgDetailUpForm, InventoryOrgDetailEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime());
inventoryOrgDetailService.update(id, subentity);
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
@ -326,9 +312,9 @@ public class MonitormanageController {
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
MonitormanageEntity entity= monitormanageService.getInfo(id);
InventoryOrgDetailEntity entity= inventoryOrgDetailService.getInfo(id);
if(entity!=null){
monitormanageService.delete(entity);
inventoryOrgDetailService.delete(entity);
}
return ActionResult.success("删除成功");

@ -0,0 +1,71 @@
package jnpf.inventoryOrdDetail.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
@TableName("jg_inventory_org_detail")
public class InventoryOrgDetailEntity {
@TableId("ID")
private String id;
@TableField("INVENTORY_ID")
private String inventoryId;
@TableField("INVENTORY_ORG_DETAIL_NAME")
private String inventoryOrgDetailName;
@TableField("INVENTORY_ORG_DETAIL_CODE")
private String inventoryOrgDetailCode;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -0,0 +1,17 @@
package jnpf.inventoryOrdDetail.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.inventoryOrdDetail.entity.InventoryOrgDetailEntity;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-11
*/
public interface InventoryOrgDetailMapper extends BaseMapper<InventoryOrgDetailEntity> {
}

@ -0,0 +1,52 @@
package jnpf.inventoryOrdDetail.model.inventoryorgdetail;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgDetailCrForm {
/** 编码 **/
@JsonProperty("inventoryOrgDetailCode")
private String inventoryOrgDetailCode;
/** 名称 **/
@JsonProperty("inventoryOrgDetailName")
private String inventoryOrgDetailName;
/** 库存组织 **/
@JsonProperty("inventoryId")
private String inventoryId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
}

@ -0,0 +1,56 @@
package jnpf.inventoryOrdDetail.model.inventoryorgdetail;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgDetailInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;
/** 编码 **/
@JsonProperty("inventoryOrgDetailCode")
private String inventoryOrgDetailCode;
/** 名称 **/
@JsonProperty("inventoryOrgDetailName")
private String inventoryOrgDetailName;
/** 库存组织 **/
@JsonProperty("inventoryId")
private String inventoryId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
}

@ -0,0 +1,27 @@
package jnpf.inventoryOrdDetail.model.inventoryorgdetail;
import lombok.Data;
import java.util.Date;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgDetailListQuery extends Pagination {
/** 编码 */
private String inventoryOrgDetailCode;
/** 名称 */
private String inventoryOrgDetailName;
/**
* id
*/
private String menuId;
}

@ -0,0 +1,64 @@
package jnpf.inventoryOrdDetail.model.inventoryorgdetail;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgDetailListVO{
/** 主键 */
private String id;
/** 编码 **/
@JsonProperty("inventoryOrgDetailCode")
private String inventoryOrgDetailCode;
/** 名称 **/
@JsonProperty("inventoryOrgDetailName")
private String inventoryOrgDetailName;
/** 库存组织 **/
@JsonProperty("inventoryId")
private String inventoryId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
}

@ -0,0 +1,28 @@
package jnpf.inventoryOrdDetail.model.inventoryorgdetail;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgDetailPagination extends Pagination {
/** 编码 */
private String inventoryOrgDetailCode;
/** 名称 */
private String inventoryOrgDetailName;
/**
* id
*/
private String menuId;
}

@ -0,0 +1,29 @@
package jnpf.inventoryOrdDetail.model.inventoryorgdetail;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.*;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgDetailPaginationExportModel extends Pagination {
private String selectKey;
private String json;
private String dataType;
/** 编码 */
private String inventoryOrgDetailCode;
/** 名称 */
private String inventoryOrgDetailName;
}

@ -0,0 +1,61 @@
package jnpf.inventoryOrdDetail.model.inventoryorgdetail;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-11
*/
@Data
public class InventoryOrgDetailUpForm{
/** 主键 */
private String id;
/** 编码 **/
@JsonProperty("inventoryOrgDetailCode")
private String inventoryOrgDetailCode;
/** 名称 **/
@JsonProperty("inventoryOrgDetailName")
private String inventoryOrgDetailName;
/** 库存组织 **/
@JsonProperty("inventoryId")
private String inventoryId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 创建人名称 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
}

@ -0,0 +1,35 @@
package jnpf.inventoryOrdDetail.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.inventoryOrdDetail.entity.InventoryOrgDetailEntity;
import jnpf.inventoryOrdDetail.model.inventoryorgdetail.InventoryOrgDetailPagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-11
*/
public interface InventoryOrgDetailService extends IService<InventoryOrgDetailEntity> {
List<InventoryOrgDetailEntity> getList(InventoryOrgDetailPagination inventoryOrgDetailPagination);
List<InventoryOrgDetailEntity> getTypeList(InventoryOrgDetailPagination inventoryOrgDetailPagination,String dataType);
InventoryOrgDetailEntity getInfo(String id);
void delete(InventoryOrgDetailEntity entity);
void create(InventoryOrgDetailEntity entity);
boolean update( String id, InventoryOrgDetailEntity entity);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,222 @@
package jnpf.inventoryOrdDetail.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.inventoryOrdDetail.entity.InventoryOrgDetailEntity;
import jnpf.inventoryOrdDetail.mapper.InventoryOrgDetailMapper;
import jnpf.inventoryOrdDetail.model.inventoryorgdetail.InventoryOrgDetailPagination;
import jnpf.inventoryOrdDetail.service.InventoryOrgDetailService;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-11
*/
@Service
public class InventoryOrgDetailServiceImpl extends ServiceImpl<InventoryOrgDetailMapper, InventoryOrgDetailEntity> implements InventoryOrgDetailService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<InventoryOrgDetailEntity> getList(InventoryOrgDetailPagination inventoryOrgDetailPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int inventoryOrgDetailNum =0;
QueryWrapper<InventoryOrgDetailEntity> inventoryOrgDetailQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgDetailObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgDetailQueryWrapper,inventoryOrgDetailPagination.getMenuId(),"inventoryOrgDetail"));
if (ObjectUtil.isEmpty(inventoryOrgDetailObj)){
return new ArrayList<>();
} else {
inventoryOrgDetailQueryWrapper = (QueryWrapper<InventoryOrgDetailEntity>)inventoryOrgDetailObj;
inventoryOrgDetailNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgDetailObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgDetailQueryWrapper,inventoryOrgDetailPagination.getMenuId(),"inventoryOrgDetail"));
if (ObjectUtil.isEmpty(inventoryOrgDetailObj)){
return new ArrayList<>();
} else {
inventoryOrgDetailQueryWrapper = (QueryWrapper<InventoryOrgDetailEntity>)inventoryOrgDetailObj;
inventoryOrgDetailNum++;
}
}
}
if(StringUtil.isNotEmpty(inventoryOrgDetailPagination.getInventoryOrgDetailCode())){
inventoryOrgDetailNum++;
inventoryOrgDetailQueryWrapper.lambda().like(InventoryOrgDetailEntity::getInventoryOrgDetailCode,inventoryOrgDetailPagination.getInventoryOrgDetailCode());
}
if(StringUtil.isNotEmpty(inventoryOrgDetailPagination.getInventoryOrgDetailName())){
inventoryOrgDetailNum++;
inventoryOrgDetailQueryWrapper.lambda().like(InventoryOrgDetailEntity::getInventoryOrgDetailName,inventoryOrgDetailPagination.getInventoryOrgDetailName());
}
if(AllIdList.size()>0){
inventoryOrgDetailQueryWrapper.lambda().in(InventoryOrgDetailEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(inventoryOrgDetailPagination.getSidx())){
inventoryOrgDetailQueryWrapper.lambda().orderByDesc(InventoryOrgDetailEntity::getCreatorTime);
}else{
try {
String sidx = inventoryOrgDetailPagination.getSidx();
InventoryOrgDetailEntity inventoryOrgDetailEntity = new InventoryOrgDetailEntity();
Field declaredField = inventoryOrgDetailEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
inventoryOrgDetailQueryWrapper="asc".equals(inventoryOrgDetailPagination.getSort().toLowerCase())?inventoryOrgDetailQueryWrapper.orderByAsc(value):inventoryOrgDetailQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<InventoryOrgDetailEntity> page=new Page<>(inventoryOrgDetailPagination.getCurrentPage(), inventoryOrgDetailPagination.getPageSize());
IPage<InventoryOrgDetailEntity> userIPage=this.page(page, inventoryOrgDetailQueryWrapper);
return inventoryOrgDetailPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<InventoryOrgDetailEntity> list = new ArrayList();
return inventoryOrgDetailPagination.setData(list, list.size());
}
}
@Override
public List<InventoryOrgDetailEntity> getTypeList(InventoryOrgDetailPagination inventoryOrgDetailPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int inventoryOrgDetailNum =0;
QueryWrapper<InventoryOrgDetailEntity> inventoryOrgDetailQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgDetailObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgDetailQueryWrapper,inventoryOrgDetailPagination.getMenuId(),"inventoryOrgDetail"));
if (ObjectUtil.isEmpty(inventoryOrgDetailObj)){
return new ArrayList<>();
} else {
inventoryOrgDetailQueryWrapper = (QueryWrapper<InventoryOrgDetailEntity>)inventoryOrgDetailObj;
inventoryOrgDetailNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object inventoryOrgDetailObj=authorizeService.getCondition(new AuthorizeConditionModel(inventoryOrgDetailQueryWrapper,inventoryOrgDetailPagination.getMenuId(),"inventoryOrgDetail"));
if (ObjectUtil.isEmpty(inventoryOrgDetailObj)){
return new ArrayList<>();
} else {
inventoryOrgDetailQueryWrapper = (QueryWrapper<InventoryOrgDetailEntity>)inventoryOrgDetailObj;
inventoryOrgDetailNum++;
}
}
}
if(StringUtil.isNotEmpty(inventoryOrgDetailPagination.getInventoryOrgDetailCode())){
inventoryOrgDetailNum++;
inventoryOrgDetailQueryWrapper.lambda().like(InventoryOrgDetailEntity::getInventoryOrgDetailCode,inventoryOrgDetailPagination.getInventoryOrgDetailCode());
}
if(StringUtil.isNotEmpty(inventoryOrgDetailPagination.getInventoryOrgDetailName())){
inventoryOrgDetailNum++;
inventoryOrgDetailQueryWrapper.lambda().like(InventoryOrgDetailEntity::getInventoryOrgDetailName,inventoryOrgDetailPagination.getInventoryOrgDetailName());
}
if(AllIdList.size()>0){
inventoryOrgDetailQueryWrapper.lambda().in(InventoryOrgDetailEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(inventoryOrgDetailPagination.getSidx())){
inventoryOrgDetailQueryWrapper.lambda().orderByDesc(InventoryOrgDetailEntity::getCreatorTime);
}else{
try {
String sidx = inventoryOrgDetailPagination.getSidx();
InventoryOrgDetailEntity inventoryOrgDetailEntity = new InventoryOrgDetailEntity();
Field declaredField = inventoryOrgDetailEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
inventoryOrgDetailQueryWrapper="asc".equals(inventoryOrgDetailPagination.getSort().toLowerCase())?inventoryOrgDetailQueryWrapper.orderByAsc(value):inventoryOrgDetailQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<InventoryOrgDetailEntity> page=new Page<>(inventoryOrgDetailPagination.getCurrentPage(), inventoryOrgDetailPagination.getPageSize());
IPage<InventoryOrgDetailEntity> userIPage=this.page(page, inventoryOrgDetailQueryWrapper);
return inventoryOrgDetailPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<InventoryOrgDetailEntity> list = new ArrayList();
return inventoryOrgDetailPagination.setData(list, list.size());
}
}else{
return this.list(inventoryOrgDetailQueryWrapper);
}
}
@Override
public InventoryOrgDetailEntity getInfo(String id){
QueryWrapper<InventoryOrgDetailEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(InventoryOrgDetailEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(InventoryOrgDetailEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, InventoryOrgDetailEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(InventoryOrgDetailEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,17 +0,0 @@
package jnpf.monitorItem.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.monitorItem.entity.Monitoring_itemEntity;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-07
*/
public interface Monitoring_itemMapper extends BaseMapper<Monitoring_itemEntity> {
}

@ -1,36 +0,0 @@
package jnpf.monitorItem.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.monitorItem.entity.Monitoring_itemEntity;
import jnpf.monitorItem.model.monitoring_item.Monitoring_itemPagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-07
*/
public interface Monitoring_itemService extends IService<Monitoring_itemEntity> {
List<Monitoring_itemEntity> getList(Monitoring_itemPagination monitoring_itemPagination);
List<Monitoring_itemEntity> getTypeList(Monitoring_itemPagination monitoring_itemPagination,String dataType);
Monitoring_itemEntity getInfo(String id);
void delete(Monitoring_itemEntity entity);
void create(Monitoring_itemEntity entity);
boolean update( String id, Monitoring_itemEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,212 +0,0 @@
package jnpf.monitorItem.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.monitorItem.entity.Monitoring_itemEntity;
import jnpf.monitorItem.mapper.Monitoring_itemMapper;
import jnpf.monitorItem.model.monitoring_item.Monitoring_itemPagination;
import jnpf.monitorItem.service.Monitoring_itemService;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-07
*/
@Service
public class Monitoring_itemServiceImpl extends ServiceImpl<Monitoring_itemMapper, Monitoring_itemEntity> implements Monitoring_itemService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<Monitoring_itemEntity> getList(Monitoring_itemPagination monitoring_itemPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int monitoring_itemNum =0;
QueryWrapper<Monitoring_itemEntity> monitoring_itemQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoring_itemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoring_itemQueryWrapper,monitoring_itemPagination.getMenuId(),"monitoring_item"));
if (ObjectUtil.isEmpty(monitoring_itemObj)){
return new ArrayList<>();
} else {
monitoring_itemQueryWrapper = (QueryWrapper<Monitoring_itemEntity>)monitoring_itemObj;
monitoring_itemNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoring_itemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoring_itemQueryWrapper,monitoring_itemPagination.getMenuId(),"monitoring_item"));
if (ObjectUtil.isEmpty(monitoring_itemObj)){
return new ArrayList<>();
} else {
monitoring_itemQueryWrapper = (QueryWrapper<Monitoring_itemEntity>)monitoring_itemObj;
monitoring_itemNum++;
}
}
}
if(StringUtil.isNotEmpty(monitoring_itemPagination.getMName())){
monitoring_itemNum++;
monitoring_itemQueryWrapper.lambda().like(Monitoring_itemEntity::getMName,monitoring_itemPagination.getMName());
}
if(AllIdList.size()>0){
monitoring_itemQueryWrapper.lambda().in(Monitoring_itemEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(monitoring_itemPagination.getSidx())){
monitoring_itemQueryWrapper.lambda().orderByDesc(Monitoring_itemEntity::getLastModifyTime);
}else{
try {
String sidx = monitoring_itemPagination.getSidx();
Monitoring_itemEntity monitoring_itemEntity = new Monitoring_itemEntity();
Field declaredField = monitoring_itemEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
monitoring_itemQueryWrapper="asc".equals(monitoring_itemPagination.getSort().toLowerCase())?monitoring_itemQueryWrapper.orderByAsc(value):monitoring_itemQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<Monitoring_itemEntity> page=new Page<>(monitoring_itemPagination.getCurrentPage(), monitoring_itemPagination.getPageSize());
IPage<Monitoring_itemEntity> userIPage=this.page(page, monitoring_itemQueryWrapper);
return monitoring_itemPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<Monitoring_itemEntity> list = new ArrayList();
return monitoring_itemPagination.setData(list, list.size());
}
}
@Override
public List<Monitoring_itemEntity> getTypeList(Monitoring_itemPagination monitoring_itemPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int monitoring_itemNum =0;
QueryWrapper<Monitoring_itemEntity> monitoring_itemQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoring_itemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoring_itemQueryWrapper,monitoring_itemPagination.getMenuId(),"monitoring_item"));
if (ObjectUtil.isEmpty(monitoring_itemObj)){
return new ArrayList<>();
} else {
monitoring_itemQueryWrapper = (QueryWrapper<Monitoring_itemEntity>)monitoring_itemObj;
monitoring_itemNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoring_itemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoring_itemQueryWrapper,monitoring_itemPagination.getMenuId(),"monitoring_item"));
if (ObjectUtil.isEmpty(monitoring_itemObj)){
return new ArrayList<>();
} else {
monitoring_itemQueryWrapper = (QueryWrapper<Monitoring_itemEntity>)monitoring_itemObj;
monitoring_itemNum++;
}
}
}
if(StringUtil.isNotEmpty(monitoring_itemPagination.getMName())){
monitoring_itemNum++;
monitoring_itemQueryWrapper.lambda().like(Monitoring_itemEntity::getMName,monitoring_itemPagination.getMName());
}
if(AllIdList.size()>0){
monitoring_itemQueryWrapper.lambda().in(Monitoring_itemEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(monitoring_itemPagination.getSidx())){
monitoring_itemQueryWrapper.lambda().orderByDesc(Monitoring_itemEntity::getLastModifyTime);
}else{
try {
String sidx = monitoring_itemPagination.getSidx();
Monitoring_itemEntity monitoring_itemEntity = new Monitoring_itemEntity();
Field declaredField = monitoring_itemEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
monitoring_itemQueryWrapper="asc".equals(monitoring_itemPagination.getSort().toLowerCase())?monitoring_itemQueryWrapper.orderByAsc(value):monitoring_itemQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<Monitoring_itemEntity> page=new Page<>(monitoring_itemPagination.getCurrentPage(), monitoring_itemPagination.getPageSize());
IPage<Monitoring_itemEntity> userIPage=this.page(page, monitoring_itemQueryWrapper);
return monitoring_itemPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<Monitoring_itemEntity> list = new ArrayList();
return monitoring_itemPagination.setData(list, list.size());
}
}else{
return this.list(monitoring_itemQueryWrapper);
}
}
@Override
public Monitoring_itemEntity getInfo(String id){
QueryWrapper<Monitoring_itemEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(Monitoring_itemEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(Monitoring_itemEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, Monitoring_itemEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(Monitoring_itemEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,6 +1,6 @@
package jnpf.monitorItem.controller;
package jnpf.monitoringitem.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
@ -17,10 +17,10 @@ import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import jnpf.monitorItem.entity.Monitoring_itemEntity;
import jnpf.monitorItem.model.monitoring_item.*;
import jnpf.monitorItem.service.Monitoring_itemService;
import jnpf.monitorItem.utils.ImouConfig;
import jnpf.monitoringitem.entity.MonitoringitemEntity;
import jnpf.monitoringitem.model.monitoringitem.*;
import jnpf.monitoringitem.service.MonitoringitemService;
import jnpf.monitoringitem.utils.ImouConfig;
import jnpf.util.*;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
@ -42,17 +42,17 @@ import java.util.Map;
/**
*
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Slf4j
@RestController
@Api(tags = "监控管理" , value = "example")
@RequestMapping("/api/example/Jg_monitoring_item0")
public class Monitoring_itemController {
@Api(tags = "监控清单" , value = "example")
@RequestMapping("/api/example/Monitoringitem")
public class MonitoringitemController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -64,7 +64,9 @@ public class Monitoring_itemController {
private UserProvider userProvider;
@Autowired
private Monitoring_itemService monitoring_itemService;
private MonitoringitemService monitoringitemService;
@ApiOperation("更新摄像头视频流地址")
@GetMapping("/updateMonitoring")
public ActionResult updateMonitoring() throws Exception {
@ -96,34 +98,34 @@ public class Monitoring_itemController {
String deviceId = String.valueOf(flvLive.get("deviceId"));
// 设备通道号
String channelId = String.valueOf(flvLive.get("channelId"));
Monitoring_itemEntity monitor = new Monitoring_itemEntity();
MonitoringitemEntity monitor = new MonitoringitemEntity();
// 设置区域为日照金属
monitor.setMonitoringId("1");
monitor.setMName("NVR-3FA0-"+i);
monitor.setSerialnumber(deviceId);
monitor.setMStatus("1");
monitor.setFlvAddress(flv);
monitor.setFlvHdAddress(flvHD);
monitor.setChannelNumber(channelId);
monitor.setFlvaddress(flv);
monitor.setFlvhdaddress(flvHD);
monitor.setChannelnumber(channelId);
// boolean save = monitoring_itemService.save(monitor);
// 2 查询本地表中此通道是否存在
LambdaQueryWrapper<Monitoring_itemEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Monitoring_itemEntity::getChannelNumber,channelId);
Monitoring_itemEntity one = monitoring_itemService.getOne(wrapper);
LambdaQueryWrapper<MonitoringitemEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MonitoringitemEntity::getChannelnumber,channelId);
MonitoringitemEntity one = monitoringitemService.getOne(wrapper);
if (one!=null){
// 3 存在根据返回的id进行更新
monitor.setMName(null);
monitor.setLastModifyUserId("1");
monitor.setLastModifyUserName("admin");
monitor.setLastModifyTime(new Date());
monitoring_itemService.update(monitor,wrapper);
monitoringitemService.update(monitor,wrapper);
}else{
// 4 不存在进行保存
monitor.setCreatorTime(new Date());
monitor.setCreatorUserId("1");
monitor.setCreatorUserName("admin");
monitoring_itemService.save(monitor);
monitoringitemService.save(monitor);
}
}
@ -131,28 +133,28 @@ public class Monitoring_itemController {
}
/**
*
*
* @param monitoring_itemPagination
* @param monitoringitemPagination
* @return
*/
@ApiOperation("列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody Monitoring_itemPagination monitoring_itemPagination)throws IOException{
List<Monitoring_itemEntity> list= monitoring_itemService.getList(monitoring_itemPagination);
public ActionResult list(@RequestBody MonitoringitemPagination monitoringitemPagination)throws IOException{
List<MonitoringitemEntity> list= monitoringitemService.getList(monitoringitemPagination);
//处理id字段转名称若无需转或者为空可删除
for(Monitoring_itemEntity entity:list){
for(MonitoringitemEntity entity:list){
entity.setMonitoringId(generaterSwapUtil.getDynName("370933183241262469" ,"m_name" ,"id","" ,entity.getMonitoringId()));
}
List<Monitoring_itemListVO> listVO=JsonUtil.getJsonToList(list,Monitoring_itemListVO.class);
for(Monitoring_itemListVO monitoring_itemVO:listVO){
List<MonitoringitemListVO> listVO=JsonUtil.getJsonToList(list,MonitoringitemListVO.class);
for(MonitoringitemListVO monitoringitemVO:listVO){
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(monitoring_itemPagination,PaginationVO.class);
PaginationVO page=JsonUtil.getJsonToBean(monitoringitemPagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
@ -161,17 +163,17 @@ public class Monitoring_itemController {
/**
*
*
* @param monitoring_itemCrForm
* @param monitoringitemCrForm
* @return
*/
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid Monitoring_itemCrForm monitoring_itemCrForm) throws DataException {
public ActionResult create(@RequestBody @Valid MonitoringitemCrForm monitoringitemCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
Monitoring_itemEntity entity = JsonUtil.getJsonToBean(monitoring_itemCrForm, Monitoring_itemEntity.class);
MonitoringitemEntity entity = JsonUtil.getJsonToBean(monitoringitemCrForm, MonitoringitemEntity.class);
entity.setId(mainId);
monitoring_itemService.save(entity);
monitoringitemService.save(entity);
return ActionResult.success("创建成功");
@ -204,23 +206,23 @@ public class Monitoring_itemController {
*/
@ApiOperation("导出Excel")
@GetMapping("/Actions/Export")
public ActionResult Export(Monitoring_itemPaginationExportModel monitoring_itemPaginationExportModel) throws IOException {
if (StringUtil.isEmpty(monitoring_itemPaginationExportModel.getSelectKey())){
public ActionResult Export(MonitoringitemPaginationExportModel monitoringitemPaginationExportModel) throws IOException {
if (StringUtil.isEmpty(monitoringitemPaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
Monitoring_itemPagination monitoring_itemPagination=JsonUtil.getJsonToBean(monitoring_itemPaginationExportModel, Monitoring_itemPagination.class);
List<Monitoring_itemEntity> list= monitoring_itemService.getTypeList(monitoring_itemPagination,monitoring_itemPaginationExportModel.getDataType());
MonitoringitemPagination monitoringitemPagination=JsonUtil.getJsonToBean(monitoringitemPaginationExportModel, MonitoringitemPagination.class);
List<MonitoringitemEntity> list= monitoringitemService.getTypeList(monitoringitemPagination,monitoringitemPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(Monitoring_itemEntity entity:list){
for(MonitoringitemEntity entity:list){
entity.setMonitoringId(generaterSwapUtil.getDynName("370933183241262469" ,"m_name" ,"id","" ,entity.getMonitoringId()));
}
List<Monitoring_itemListVO> listVO=JsonUtil.getJsonToList(list,Monitoring_itemListVO.class);
for(Monitoring_itemListVO monitoring_itemVO:listVO){
List<MonitoringitemListVO> listVO=JsonUtil.getJsonToList(list,MonitoringitemListVO.class);
for(MonitoringitemListVO monitoringitemVO:listVO){
}
//转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
String[]keys=!StringUtil.isEmpty(monitoring_itemPaginationExportModel.getSelectKey())?monitoring_itemPaginationExportModel.getSelectKey().split(","):new String[0];
String[]keys=!StringUtil.isEmpty(monitoringitemPaginationExportModel.getSelectKey())?monitoringitemPaginationExportModel.getSelectKey().split(","):new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,keys,userInfo);
return ActionResult.success(vo);
@ -328,9 +330,9 @@ public class Monitoring_itemController {
* @return
*/
@GetMapping("/{id}")
public ActionResult<Monitoring_itemInfoVO> info(@PathVariable("id") String id){
Monitoring_itemEntity entity= monitoring_itemService.getInfo(id);
Monitoring_itemInfoVO vo=JsonUtil.getJsonToBean(entity, Monitoring_itemInfoVO.class);
public ActionResult<MonitoringitemInfoVO> info(@PathVariable("id") String id){
MonitoringitemEntity entity= monitoringitemService.getInfo(id);
MonitoringitemInfoVO vo=JsonUtil.getJsonToBean(entity, MonitoringitemInfoVO.class);
//子表
//副表
@ -344,9 +346,9 @@ public class Monitoring_itemController {
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<Monitoring_itemInfoVO> detailInfo(@PathVariable("id") String id){
Monitoring_itemEntity entity= monitoring_itemService.getInfo(id);
Monitoring_itemInfoVO vo=JsonUtil.getJsonToBean(entity, Monitoring_itemInfoVO.class);
public ActionResult<MonitoringitemInfoVO> detailInfo(@PathVariable("id") String id){
MonitoringitemEntity entity= monitoringitemService.getInfo(id);
MonitoringitemInfoVO vo=JsonUtil.getJsonToBean(entity, MonitoringitemInfoVO.class);
//子表数据转换
@ -369,12 +371,12 @@ public class Monitoring_itemController {
*/
@PutMapping("/{id}")
@Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid Monitoring_itemUpForm monitoring_itemUpForm) throws DataException {
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid MonitoringitemUpForm monitoringitemUpForm) throws DataException {
UserInfo userInfo=userProvider.get();
Monitoring_itemEntity entity= monitoring_itemService.getInfo(id);
MonitoringitemEntity entity= monitoringitemService.getInfo(id);
if(entity!=null){
Monitoring_itemEntity subentity=JsonUtil.getJsonToBean(monitoring_itemUpForm, Monitoring_itemEntity.class);
monitoring_itemService.update(id, subentity);
MonitoringitemEntity subentity=JsonUtil.getJsonToBean(monitoringitemUpForm, MonitoringitemEntity.class);
monitoringitemService.update(id, subentity);
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
@ -392,9 +394,9 @@ public class Monitoring_itemController {
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
Monitoring_itemEntity entity= monitoring_itemService.getInfo(id);
MonitoringitemEntity entity= monitoringitemService.getInfo(id);
if(entity!=null){
monitoring_itemService.delete(entity);
monitoringitemService.delete(entity);
}
return ActionResult.success("删除成功");

@ -1,12 +1,13 @@
package jnpf.monitorItem.entity;
package jnpf.monitoringitem.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
@ -15,11 +16,11 @@ import java.util.Date;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Data
@TableName("jg_monitoring_item0")
public class Monitoring_itemEntity {
public class MonitoringitemEntity {
@TableId("ID")
private String id;
@ -52,7 +53,6 @@ public class Monitoring_itemEntity {
private Date deleteTime;
@TableField("DELETE_MARK")
@TableLogic
private String deleteMark;
@TableField("ORGNIZE_ID")
@ -70,19 +70,19 @@ public class Monitoring_itemEntity {
@TableField("SERIALNUMBER")
private String serialnumber;
@TableField("M_STATUS")
private String mStatus;
@TableField("FLVADDRESS")
private String flvaddress;
@TableField("flvAddress")
private String flvAddress;
@TableField("FLVHDADDRESS")
private String flvhdaddress;
@TableField("flvHdAddress")
private String flvHdAddress;
@TableField("CHANNELNUMBER")
private String channelnumber;
@TableField("channelNumber")
private String channelNumber;
@TableField("ISENABLE")
private String isenable;
@TableField("isEnable")
private String isEnable;
@TableField("M_STATUS")
private String mStatus;
}

@ -0,0 +1,17 @@
package jnpf.monitoringitem.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.monitoringitem.entity.MonitoringitemEntity;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface MonitoringitemMapper extends BaseMapper<MonitoringitemEntity> {
}

@ -1,6 +1,6 @@
package jnpf.monitorItem.model.monitoring_item;
package jnpf.monitoringitem.model.monitoringitem;
import lombok.Data;
import java.util.List;
@ -14,10 +14,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Data
public class Monitoring_itemCrForm {
public class MonitoringitemCrForm {
/** 设备名称 **/
@JsonProperty("mName")

@ -1,7 +1,7 @@
package jnpf.monitorItem.model.monitoring_item;
package jnpf.monitoringitem.model.monitoringitem;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -15,10 +15,10 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Data
public class Monitoring_itemInfoVO{
public class MonitoringitemInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;

@ -1,4 +1,4 @@
package jnpf.monitorItem.model.monitoring_item;
package jnpf.monitoringitem.model.monitoringitem;
import lombok.Data;
import java.util.Date;
@ -10,13 +10,16 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Data
public class Monitoring_itemListQuery extends Pagination {
public class MonitoringitemListQuery extends Pagination {
/** 设备名称 */
private String mName;
/** 区域 */
private String monitoringId;
/**
* id
*/

@ -1,6 +1,6 @@
package jnpf.monitorItem.model.monitoring_item;
package jnpf.monitoringitem.model.monitoringitem;
import lombok.Data;
@ -15,10 +15,10 @@ import java.math.BigDecimal;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Data
public class Monitoring_itemListVO{
public class MonitoringitemListVO{
/** 主键 */
private String id;

@ -1,4 +1,4 @@
package jnpf.monitorItem.model.monitoring_item;
package jnpf.monitoringitem.model.monitoringitem;
import lombok.Data;
@ -11,13 +11,16 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Data
public class Monitoring_itemPagination extends Pagination {
public class MonitoringitemPagination extends Pagination {
/** 设备名称 */
private String mName;
/** 区域 */
private String monitoringId;
/**
* id
*/

@ -1,4 +1,4 @@
package jnpf.monitormanage.model.monitormanage;
package jnpf.monitoringitem.model.monitoringitem;
import lombok.Data;
import jnpf.base.Pagination;
@ -9,10 +9,10 @@ import java.util.*;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class MonitormanagePaginationExportModel extends Pagination {
public class MonitoringitemPaginationExportModel extends Pagination {
private String selectKey;
@ -23,4 +23,7 @@ public class MonitormanagePaginationExportModel extends Pagination {
/** 设备名称 */
private String mName;
/** 区域 */
private String monitoringId;
}

@ -1,6 +1,6 @@
package jnpf.monitorItem.model.monitoring_item;
package jnpf.monitoringitem.model.monitoringitem;
import lombok.Data;
import java.util.List;
@ -15,10 +15,10 @@ import lombok.Data;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-07
* @ 2023-02-13
*/
@Data
public class Monitoring_itemUpForm{
public class MonitoringitemUpForm{
/** 主键 */
private String id;

@ -0,0 +1,36 @@
package jnpf.monitoringitem.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.monitoringitem.entity.MonitoringitemEntity;
import jnpf.monitoringitem.model.monitoringitem.MonitoringitemPagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface MonitoringitemService extends IService<MonitoringitemEntity> {
List<MonitoringitemEntity> getList(MonitoringitemPagination monitoringitemPagination);
List<MonitoringitemEntity> getTypeList(MonitoringitemPagination monitoringitemPagination,String dataType);
MonitoringitemEntity getInfo(String id);
void delete(MonitoringitemEntity entity);
void create(MonitoringitemEntity entity);
boolean update( String id, MonitoringitemEntity entity);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,222 @@
package jnpf.monitoringitem.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.monitoringitem.entity.MonitoringitemEntity;
import jnpf.monitoringitem.mapper.MonitoringitemMapper;
import jnpf.monitoringitem.model.monitoringitem.MonitoringitemPagination;
import jnpf.monitoringitem.service.MonitoringitemService;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
@Service
public class MonitoringitemServiceImpl extends ServiceImpl<MonitoringitemMapper, MonitoringitemEntity> implements MonitoringitemService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<MonitoringitemEntity> getList(MonitoringitemPagination monitoringitemPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int monitoringitemNum =0;
QueryWrapper<MonitoringitemEntity> monitoringitemQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoringitemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoringitemQueryWrapper,monitoringitemPagination.getMenuId(),"monitoringitem"));
if (ObjectUtil.isEmpty(monitoringitemObj)){
return new ArrayList<>();
} else {
monitoringitemQueryWrapper = (QueryWrapper<MonitoringitemEntity>)monitoringitemObj;
monitoringitemNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoringitemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoringitemQueryWrapper,monitoringitemPagination.getMenuId(),"monitoringitem"));
if (ObjectUtil.isEmpty(monitoringitemObj)){
return new ArrayList<>();
} else {
monitoringitemQueryWrapper = (QueryWrapper<MonitoringitemEntity>)monitoringitemObj;
monitoringitemNum++;
}
}
}
if(StringUtil.isNotEmpty(monitoringitemPagination.getMName())){
monitoringitemNum++;
monitoringitemQueryWrapper.lambda().like(MonitoringitemEntity::getMName,monitoringitemPagination.getMName());
}
if(StringUtil.isNotEmpty(monitoringitemPagination.getMonitoringId())){
monitoringitemNum++;
monitoringitemQueryWrapper.lambda().eq(MonitoringitemEntity::getMonitoringId,monitoringitemPagination.getMonitoringId());
}
if(AllIdList.size()>0){
monitoringitemQueryWrapper.lambda().in(MonitoringitemEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(monitoringitemPagination.getSidx())){
monitoringitemQueryWrapper.lambda().orderByDesc(MonitoringitemEntity::getCreatorTime);
}else{
try {
String sidx = monitoringitemPagination.getSidx();
MonitoringitemEntity monitoringitemEntity = new MonitoringitemEntity();
Field declaredField = monitoringitemEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
monitoringitemQueryWrapper="asc".equals(monitoringitemPagination.getSort().toLowerCase())?monitoringitemQueryWrapper.orderByAsc(value):monitoringitemQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<MonitoringitemEntity> page=new Page<>(monitoringitemPagination.getCurrentPage(), monitoringitemPagination.getPageSize());
IPage<MonitoringitemEntity> userIPage=this.page(page, monitoringitemQueryWrapper);
return monitoringitemPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MonitoringitemEntity> list = new ArrayList();
return monitoringitemPagination.setData(list, list.size());
}
}
@Override
public List<MonitoringitemEntity> getTypeList(MonitoringitemPagination monitoringitemPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int monitoringitemNum =0;
QueryWrapper<MonitoringitemEntity> monitoringitemQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoringitemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoringitemQueryWrapper,monitoringitemPagination.getMenuId(),"monitoringitem"));
if (ObjectUtil.isEmpty(monitoringitemObj)){
return new ArrayList<>();
} else {
monitoringitemQueryWrapper = (QueryWrapper<MonitoringitemEntity>)monitoringitemObj;
monitoringitemNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitoringitemObj=authorizeService.getCondition(new AuthorizeConditionModel(monitoringitemQueryWrapper,monitoringitemPagination.getMenuId(),"monitoringitem"));
if (ObjectUtil.isEmpty(monitoringitemObj)){
return new ArrayList<>();
} else {
monitoringitemQueryWrapper = (QueryWrapper<MonitoringitemEntity>)monitoringitemObj;
monitoringitemNum++;
}
}
}
if(StringUtil.isNotEmpty(monitoringitemPagination.getMName())){
monitoringitemNum++;
monitoringitemQueryWrapper.lambda().like(MonitoringitemEntity::getMName,monitoringitemPagination.getMName());
}
if(StringUtil.isNotEmpty(monitoringitemPagination.getMonitoringId())){
monitoringitemNum++;
monitoringitemQueryWrapper.lambda().eq(MonitoringitemEntity::getMonitoringId,monitoringitemPagination.getMonitoringId());
}
if(AllIdList.size()>0){
monitoringitemQueryWrapper.lambda().in(MonitoringitemEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(monitoringitemPagination.getSidx())){
monitoringitemQueryWrapper.lambda().orderByDesc(MonitoringitemEntity::getCreatorTime);
}else{
try {
String sidx = monitoringitemPagination.getSidx();
MonitoringitemEntity monitoringitemEntity = new MonitoringitemEntity();
Field declaredField = monitoringitemEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
monitoringitemQueryWrapper="asc".equals(monitoringitemPagination.getSort().toLowerCase())?monitoringitemQueryWrapper.orderByAsc(value):monitoringitemQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<MonitoringitemEntity> page=new Page<>(monitoringitemPagination.getCurrentPage(), monitoringitemPagination.getPageSize());
IPage<MonitoringitemEntity> userIPage=this.page(page, monitoringitemQueryWrapper);
return monitoringitemPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MonitoringitemEntity> list = new ArrayList();
return monitoringitemPagination.setData(list, list.size());
}
}else{
return this.list(monitoringitemQueryWrapper);
}
}
@Override
public MonitoringitemEntity getInfo(String id){
QueryWrapper<MonitoringitemEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(MonitoringitemEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(MonitoringitemEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, MonitoringitemEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(MonitoringitemEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,10 +1,10 @@
package jnpf.monitorItem.utils;
package jnpf.monitoringitem.utils;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jnpf.monitorItem.entity.Monitoring_itemEntity;
import jnpf.monitorItem.service.Monitoring_itemService;
import jnpf.monitoringitem.entity.MonitoringitemEntity;
import jnpf.monitoringitem.service.MonitoringitemService;
import jnpf.util.Md5Util;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
@ -37,7 +37,7 @@ public class ImouConfig {
private String id="98a7a257-c4e4-4db3-a2d3-d97a3836b87c";
@Autowired
private Monitoring_itemService monitoring_itemService;
private MonitoringitemService monitoring_itemService;
// 设备序列号
private String deviceId="5K0A36BPAZ73FA0";
@ -72,21 +72,21 @@ public class ImouConfig {
String deviceId = String.valueOf(flvLive.get("deviceId"));
// 设备通道号
String channelId = String.valueOf(flvLive.get("channelId"));
Monitoring_itemEntity monitor = new Monitoring_itemEntity();
MonitoringitemEntity monitor = new MonitoringitemEntity();
// 设置区域为日照金属
monitor.setMonitoringId("1");
monitor.setMName("NVR-3FA0-"+i);
monitor.setSerialnumber(deviceId);
monitor.setMStatus("0");
monitor.setFlvAddress(flv);
monitor.setFlvHdAddress(flvHD);
monitor.setChannelNumber(channelId);
monitor.setFlvaddress(flv);
monitor.setFlvhdaddress(flvHD);
monitor.setChannelnumber(channelId);
// boolean save = monitoring_itemService.save(monitor);
// 2 查询本地表中此通道是否存在
LambdaQueryWrapper<Monitoring_itemEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Monitoring_itemEntity::getChannelNumber,channelId);
Monitoring_itemEntity one = monitoring_itemService.getOne(wrapper);
LambdaQueryWrapper<MonitoringitemEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MonitoringitemEntity::getChannelnumber,channelId);
MonitoringitemEntity one = monitoring_itemService.getOne(wrapper);
if (one!=null){
// 3 存在根据返回的id进行更新
monitor.setMName(null);

@ -1,17 +0,0 @@
package jnpf.monitormanage.mapper;
import jnpf.monitormanage.entity.MonitormanageEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* monitormanage
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface MonitormanageMapper extends BaseMapper<MonitormanageEntity> {
}

@ -1,64 +0,0 @@
package jnpf.monitormanage.model.monitormanage;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class MonitormanageCrForm {
/** 设备名称 **/
@JsonProperty("mName")
private String mName;
/** 设备序列号 **/
@JsonProperty("serialnumber")
private String serialnumber;
/** ip地址 **/
@JsonProperty("ip")
private String ip;
/** 端口号 **/
@JsonProperty("port")
private String port;
/** 账号 **/
@JsonProperty("account")
private String account;
/** 密码 **/
@JsonProperty("password")
private String password;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
}

@ -1,66 +0,0 @@
package jnpf.monitormanage.model.monitormanage;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class MonitormanageInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;
/** 设备名称 **/
@JsonProperty("mName")
private String mName;
/** 设备序列号 **/
@JsonProperty("serialnumber")
private String serialnumber;
/** ip地址 **/
@JsonProperty("ip")
private String ip;
/** 端口号 **/
@JsonProperty("port")
private String port;
/** 账号 **/
@JsonProperty("account")
private String account;
/** 密码 **/
@JsonProperty("password")
private String password;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
}

@ -1,79 +0,0 @@
package jnpf.monitormanage.model.monitormanage;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class MonitormanageListVO{
/** 主键 */
private String id;
/** 设备名称 **/
@JsonProperty("mName")
private String mName;
/** 设备序列号 **/
@JsonProperty("serialnumber")
private String serialnumber;
/** ip地址 **/
@JsonProperty("ip")
private String ip;
/** 端口号 **/
@JsonProperty("port")
private String port;
/** 账号 **/
@JsonProperty("account")
private String account;
/** 密码 **/
@JsonProperty("password")
private String password;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatortime")
private Date creatortime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastmodifytime")
private Date lastmodifytime;
}

@ -1,25 +0,0 @@
package jnpf.monitormanage.model.monitormanage;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class MonitormanagePagination extends Pagination {
/** 设备名称 */
private String mName;
/**
* id
*/
private String menuId;
}

@ -1,76 +0,0 @@
package jnpf.monitormanage.model.monitormanage;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class MonitormanageUpForm{
/** 主键 */
private String id;
/** 设备名称 **/
@JsonProperty("mName")
private String mName;
/** 设备序列号 **/
@JsonProperty("serialnumber")
private String serialnumber;
/** ip地址 **/
@JsonProperty("ip")
private String ip;
/** 端口号 **/
@JsonProperty("port")
private String port;
/** 账号 **/
@JsonProperty("account")
private String account;
/** 密码 **/
@JsonProperty("password")
private String password;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
}

@ -1,34 +0,0 @@
package jnpf.monitormanage.service;
import jnpf.monitormanage.entity.MonitormanageEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.monitormanage.model.monitormanage.MonitormanagePagination;
import java.util.*;
/**
*
* monitormanage
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface MonitormanageService extends IService<MonitormanageEntity> {
List<MonitormanageEntity> getList(MonitormanagePagination monitormanagePagination);
List<MonitormanageEntity> getTypeList(MonitormanagePagination monitormanagePagination,String dataType);
MonitormanageEntity getInfo(String id);
void delete(MonitormanageEntity entity);
void create(MonitormanageEntity entity);
boolean update( String id, MonitormanageEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,222 +0,0 @@
package jnpf.monitormanage.service.impl;
import jnpf.monitormanage.entity.*;
import jnpf.monitormanage.mapper.MonitormanageMapper;
import jnpf.monitormanage.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.monitormanage.model.monitormanage.MonitormanagePagination;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
/**
*
* monitormanage
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
@Service
public class MonitormanageServiceImpl extends ServiceImpl<MonitormanageMapper, MonitormanageEntity> implements MonitormanageService{
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<MonitormanageEntity> getList(MonitormanagePagination monitormanagePagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int monitormanageNum =0;
QueryWrapper<MonitormanageEntity> monitormanageQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitormanageObj=authorizeService.getCondition(new AuthorizeConditionModel(monitormanageQueryWrapper,monitormanagePagination.getMenuId(),"monitormanage"));
if (ObjectUtil.isEmpty(monitormanageObj)){
return new ArrayList<>();
} else {
monitormanageQueryWrapper = (QueryWrapper<MonitormanageEntity>)monitormanageObj;
monitormanageNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitormanageObj=authorizeService.getCondition(new AuthorizeConditionModel(monitormanageQueryWrapper,monitormanagePagination.getMenuId(),"monitormanage"));
if (ObjectUtil.isEmpty(monitormanageObj)){
return new ArrayList<>();
} else {
monitormanageQueryWrapper = (QueryWrapper<MonitormanageEntity>)monitormanageObj;
monitormanageNum++;
}
}
}
if(StringUtil.isNotEmpty(monitormanagePagination.getMName())){
monitormanageNum++;
monitormanageQueryWrapper.lambda().like(MonitormanageEntity::getMName,monitormanagePagination.getMName());
}
if(AllIdList.size()>0){
monitormanageQueryWrapper.lambda().in(MonitormanageEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(monitormanagePagination.getSidx())){
monitormanageQueryWrapper.lambda().orderByDesc(MonitormanageEntity::getId);
}else{
try {
String sidx = monitormanagePagination.getSidx();
MonitormanageEntity monitormanageEntity = new MonitormanageEntity();
Field declaredField = monitormanageEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
monitormanageQueryWrapper="asc".equals(monitormanagePagination.getSort().toLowerCase())?monitormanageQueryWrapper.orderByAsc(value):monitormanageQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<MonitormanageEntity> page=new Page<>(monitormanagePagination.getCurrentPage(), monitormanagePagination.getPageSize());
IPage<MonitormanageEntity> userIPage=this.page(page, monitormanageQueryWrapper);
return monitormanagePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MonitormanageEntity> list = new ArrayList();
return monitormanagePagination.setData(list, list.size());
}
}
@Override
public List<MonitormanageEntity> getTypeList(MonitormanagePagination monitormanagePagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int monitormanageNum =0;
QueryWrapper<MonitormanageEntity> monitormanageQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitormanageObj=authorizeService.getCondition(new AuthorizeConditionModel(monitormanageQueryWrapper,monitormanagePagination.getMenuId(),"monitormanage"));
if (ObjectUtil.isEmpty(monitormanageObj)){
return new ArrayList<>();
} else {
monitormanageQueryWrapper = (QueryWrapper<MonitormanageEntity>)monitormanageObj;
monitormanageNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object monitormanageObj=authorizeService.getCondition(new AuthorizeConditionModel(monitormanageQueryWrapper,monitormanagePagination.getMenuId(),"monitormanage"));
if (ObjectUtil.isEmpty(monitormanageObj)){
return new ArrayList<>();
} else {
monitormanageQueryWrapper = (QueryWrapper<MonitormanageEntity>)monitormanageObj;
monitormanageNum++;
}
}
}
if(StringUtil.isNotEmpty(monitormanagePagination.getMName())){
monitormanageNum++;
monitormanageQueryWrapper.lambda().like(MonitormanageEntity::getMName,monitormanagePagination.getMName());
}
if(AllIdList.size()>0){
monitormanageQueryWrapper.lambda().in(MonitormanageEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(monitormanagePagination.getSidx())){
monitormanageQueryWrapper.lambda().orderByDesc(MonitormanageEntity::getId);
}else{
try {
String sidx = monitormanagePagination.getSidx();
MonitormanageEntity monitormanageEntity = new MonitormanageEntity();
Field declaredField = monitormanageEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
monitormanageQueryWrapper="asc".equals(monitormanagePagination.getSort().toLowerCase())?monitormanageQueryWrapper.orderByAsc(value):monitormanageQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<MonitormanageEntity> page=new Page<>(monitormanagePagination.getCurrentPage(), monitormanagePagination.getPageSize());
IPage<MonitormanageEntity> userIPage=this.page(page, monitormanageQueryWrapper);
return monitormanagePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MonitormanageEntity> list = new ArrayList();
return monitormanagePagination.setData(list, list.size());
}
}else{
return this.list(monitormanageQueryWrapper);
}
}
@Override
public MonitormanageEntity getInfo(String id){
QueryWrapper<MonitormanageEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(MonitormanageEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(MonitormanageEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, MonitormanageEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(MonitormanageEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -4,6 +4,7 @@ import ai.djl.ModelException;
import ai.djl.inference.Predictor;
import ai.djl.modality.cv.Image;
import ai.djl.modality.cv.ImageFactory;
import ai.djl.ndarray.NDArray;
import ai.djl.ndarray.NDList;
import ai.djl.opencv.OpenCVImageFactory;
import ai.djl.repository.zoo.ModelZoo;
@ -19,9 +20,10 @@ import org.slf4j.LoggerFactory;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.*;
/**
* OCR V3 .
@ -37,6 +39,212 @@ public final class OcrV3RecognitionExample {
private OcrV3RecognitionExample() {
}
public static ArrayList<String> getExample(List<RotatedBox> rotatedBoxes,ArrayList<String> columnNames,HashMap<String, Integer> columnMap){
String info="";
ArrayList<String> list = new ArrayList<>();
//格子的识别的内容
ArrayList<HashMap<String,Object>> boxInfo = new ArrayList<>();
// 识别内容的坐标
HashMap<Integer, HashMap<String, Object>> xyInfo = new HashMap<>();
for (int i = 0; i < rotatedBoxes.size(); i++) {
RotatedBox box = rotatedBoxes.get(i);
HashMap<String, Object> map = new HashMap<>();
map.put("Text",box.getText());
int[] boxXY = OcrV3RecognitionExample.getBoxXY(box.getBox());
map.put("xy",boxXY);
map.put("index",i);
// y的坐标
HashMap<String, Object> xYMap = new HashMap<>();
xYMap.put("x1",boxXY[0]);
xYMap.put("x2",boxXY[1]);
xYMap.put("y1",boxXY[5]);
xYMap.put("y4",boxXY[8]);
xYMap.put("Text",box.getText());
boxInfo.add(map);
xyInfo.put(i,xYMap);
}
// 获取索引根据索引获取到他的y的信息根据y的信息进行匹配,匹配后存储成数组然后进行x的验证x距离最近责优先匹配
for (int i = 0; i < boxInfo.size(); i++) {
HashMap<String, Object> map = boxInfo.get(i);
String text=map.get("Text")!=null?map.get("Text").toString():"null";
for (int i1 = 0; i1 < columnNames.size(); i1++) {
String s = columnNames.get(i1);
if (text.contains(s)){
Integer integer = columnMap.get(s);
switch (integer){
case 1:
list.add(getRight(map,xyInfo,1));
break;
case 2:
list.add(getRight(map,xyInfo,-1));
break;
case -1:
list.add(getDown(map,xyInfo,1));
break;
case -2:
list.add(getDown(map,xyInfo,-1));
break;
case 0:
list.add(getRight(map,xyInfo,0));
break;
default:
break;
}
}
}
}
return list;
}
public static String getDown(HashMap<String, Object> map,HashMap<Integer, HashMap<String, Object>> xyInfo,int to){
int index =(int) map.get("index");
HashMap<String, Object> xYMap = xyInfo.get(index);
Integer x1 =(int) xYMap.get("x1");
Integer x2 = (int)xYMap.get("x2");
Integer y1 = (int)xYMap.get("y1");
// 识别的内容
HashMap<Integer, String> textMap = new HashMap<>();
// 索引数组
ArrayList<Integer> indexArrayList = new ArrayList<>();
for (Integer setMap:xyInfo.keySet()) {
HashMap<String, Object> hashMap = xyInfo.get(setMap);
Integer x11 =(int) hashMap.get("x1");
Integer x22 =(int) hashMap.get("x2");
boolean b = (x1 <= x11 && x22 >= x11) || (x1 <= x22 && x2 >= x22);
if (b){
textMap.put((int)hashMap.get("y1"),hashMap.get("Text")!=null?hashMap.get("Text").toString():null);
indexArrayList.add((int)hashMap.get("y1"));
}
}
Integer[] arr=indexArrayList.toArray(new Integer[0]);
for(int i1=0;i1<arr.length-1;i1++){
for(int j=0;j<arr.length-1-i1;j++){
if(arr[j]>arr[j+1]){
int temp=arr[j+1];
arr[j+1]=arr[j];
arr[j]=temp;
}
}
}
//从左到右后一个格子的数据
int i = Arrays.binarySearch(arr, y1) + to;
return textMap.get(arr[i]);
}
/**
*
* @author
* @date 2023/2/1 16:25
* @param map
* @param xyInfo
* @param to + 1+ -1
* @return String
*/
public static String getRight(HashMap<String, Object> map,HashMap<Integer, HashMap<String, Object>> xyInfo,int to){
int index =(int) map.get("index");
HashMap<String, Object> xYMap = xyInfo.get(index);
Integer y1 =(int) xYMap.get("y1");
Integer y4 = (int)xYMap.get("y4");
Integer x1 = (int)xYMap.get("x1");
HashMap<Integer, String> textMap = new HashMap<>();
ArrayList<Integer> indexArrayList = new ArrayList<>();
for (Integer setMap:xyInfo.keySet()) {
HashMap<String, Object> hashMap = xyInfo.get(setMap);
Integer y11 =(int) hashMap.get("y1");
Integer y44 =(int) hashMap.get("y4");
boolean b = (y1 <= y11 && y4 >= y11) || (y1 <= y44 && y4 >= y44);
if (b){
textMap.put((int)hashMap.get("x1"),hashMap.get("Text")!=null?hashMap.get("Text").toString():null);
indexArrayList.add((int)hashMap.get("x1"));
}
}
Integer[] arr=indexArrayList.toArray(new Integer[0]);
for(int i1=0;i1<arr.length-1;i1++){
for(int j=0;j<arr.length-1-i1;j++){
if(arr[j]>arr[j+1]){
int temp=arr[j+1];
arr[j+1]=arr[j];
arr[j]=temp;
}
}
}
//从左到右后一个格子的数据
int i = Arrays.binarySearch(arr, x1) + to;
return textMap.get(arr[i]);
}
/**
* box
* @author
* @date 2023/2/1 10:10
* @param box
* @return int[]
*/
public static int[] getBoxXY( NDArray box) {
float[] points = box.toFloatArray();
int[] xYPoints = new int[10];
for (int i = 0; i < 4; i++) {
xYPoints[i] = (int) points[2 * i];
xYPoints[i+5] = (int) points[2 * i + 1];
}
xYPoints[4] = xYPoints[0];
xYPoints[4+5] = xYPoints[0+5];
return xYPoints;
}
public static List<RotatedBox> ocrAI(InputStream picture) throws IOException, ModelException, TranslateException {
StringBuffer ocrStr = new StringBuffer("本次识别的内容:");
Image image = OpenCVImageFactory.getInstance().fromInputStream(picture);
;
OcrV3Detection detection = new OcrV3Detection();
OcrV3Recognition recognition = new OcrV3Recognition();
ZooModel detectionModel = ModelZoo.loadModel(detection.detectCriteria());
Predictor<Image, NDList> detector = detectionModel.newPredictor();
ZooModel recognitionModel = ModelZoo.loadModel(recognition.recognizeCriteria());
Predictor<Image, String> recognizer = recognitionModel.newPredictor() ;
long timeInferStart = System.currentTimeMillis();
List<RotatedBox> detections = recognition.predict(image, detector, recognizer);
// for (int i = 0; i < 1000; i++) {
// detections = recognition.predict(image, detector, recognizer);
// System.out.println("time: " + i);
// }
long timeInferEnd = System.currentTimeMillis();
System.out.println("time: " + (timeInferEnd - timeInferStart));
for (RotatedBox result : detections) {
System.out.println(result.getText());
ocrStr.append(result.getText());
}
// 根据关键子获取到box的信息再根据方位来匹配box,根据box的线的匹配box,获取box中识别出的内容
BufferedImage bufferedImage = OpenCVUtils.mat2Image((org.opencv.core.Mat) image.getWrappedImage());
for (RotatedBox result : detections) {
NDArray box = result.getBox();
ImageUtils.drawImageRectWithText(bufferedImage, result.getBox(), result.getText());
}
image = ImageFactory.getInstance().fromImage(OpenCVUtils.image2Mat(bufferedImage));
ImageUtils.saveImage(image, "ocr_result.png", "build/output");
logger.info("{}", detections);
logger.info(ocrStr.toString());
return detections;
}
public static void main(String[] args) throws IOException, ModelException, TranslateException {
// Path imageFile = Paths.get("src/test/resources/7.jpg");
String relativelyPath=System.getProperty("user.dir");

@ -0,0 +1,99 @@
package jnpf.ocr_sdk.baiduUtils;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import java.util.Map;
/**
* @Author: WangChuang
* @Date: 10/2/2023 9:29
* @Description //注释:
* @Version 1.0
*/
public class BaiduUtils {
// 官网获取的 API Ke
private static String clientId="adcBcYqcGzoyDjQTsWTSp8No";
// 官网获取的 Secret Key
private static String clientSecret="YMOhZfVoVYvgLcTXjoOF62ZYfvGgMpr4";
// 必须参数固定为client_credentials
private String grant="grant_type";
private String accessTokenUrl="https://aip.baidubce.com/oauth/2.0/token";
/**
* token
* @return
* {
* "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
* "expires_in": 2592000
* }
*/
public static String getAuth() {
// 官网获取的 API Key 更新为你注册的
String clientId ="adcBcYqcGzoyDjQTsWTSp8No" ;
// 官网获取的 Secret Key 更新为你注册的
String clientSecret = "YMOhZfVoVYvgLcTXjoOF62ZYfvGgMpr4";
return getAuth(clientId, clientSecret);
}
/**
* API访token
* token.
* @param ak - API Key
* @param sk - Secret Key
* @return assess_token
* "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
*/
public static String getAuth(String ak, String sk) {
// 获取token地址
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
String getAccessTokenUrl = authHost
// 1. grant_type为固定参数
+ "grant_type=client_credentials"
// 2. 官网获取的 API Key
+ "&client_id=" + ak
// 3. 官网获取的 Secret Key
+ "&client_secret=" + sk;
try {
URL realUrl = new URL(getAccessTokenUrl);
// 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
connection.setRequestMethod("GET");
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.err.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String result = "";
String line;
while ((line = in.readLine()) != null) {
result += line;
}
/**
*
*/
System.err.println("result:" + result);
JSONObject jsonObject = new JSONObject(result);
String access_token = jsonObject.getString("access_token");
return access_token;
} catch (Exception e) {
System.err.printf("获取token失败");
e.printStackTrace(System.err);
}
return null;
}
public static void main(String[] args) {
String auth = BaiduUtils.getAuth();
System.out.println(auth);
}
}

@ -0,0 +1,65 @@
package jnpf.ocr_sdk.baiduUtils;
/**
* Base64
*/
public class Base64Util {
private static final char last2byte = (char) Integer.parseInt("00000011", 2);
private static final char last4byte = (char) Integer.parseInt("00001111", 2);
private static final char last6byte = (char) Integer.parseInt("00111111", 2);
private static final char lead6byte = (char) Integer.parseInt("11111100", 2);
private static final char lead4byte = (char) Integer.parseInt("11110000", 2);
private static final char lead2byte = (char) Integer.parseInt("11000000", 2);
private static final char[] encodeTable = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
public Base64Util() {
}
public static String encode(byte[] from) {
StringBuilder to = new StringBuilder((int) ((double) from.length * 1.34D) + 3);
int num = 0;
char currentByte = 0;
int i;
for (i = 0; i < from.length; ++i) {
for (num %= 8; num < 8; num += 6) {
switch (num) {
case 0:
currentByte = (char) (from[i] & lead6byte);
currentByte = (char) (currentByte >>> 2);
case 1:
case 3:
case 5:
default:
break;
case 2:
currentByte = (char) (from[i] & last6byte);
break;
case 4:
currentByte = (char) (from[i] & last4byte);
currentByte = (char) (currentByte << 2);
if (i + 1 < from.length) {
currentByte = (char) (currentByte | (from[i + 1] & lead2byte) >>> 6);
}
break;
case 6:
currentByte = (char) (from[i] & last2byte);
currentByte = (char) (currentByte << 4);
if (i + 1 < from.length) {
currentByte = (char) (currentByte | (from[i + 1] & lead4byte) >>> 4);
}
}
to.append(encodeTable[currentByte]);
}
}
if (to.length() % 4 != 0) {
for (i = 4 - to.length() % 4; i > 0; --i) {
to.append("=");
}
}
return to.toString();
}
}

@ -0,0 +1,73 @@
package jnpf.ocr_sdk.baiduUtils;
import java.io.*;
/**
*
*/
public class FileUtil {
/**
*
*/
public static String readFileAsString(String filePath) throws IOException {
File file = new File(filePath);
if (!file.exists()) {
throw new FileNotFoundException(filePath);
}
if (file.length() > 1024 * 1024 * 1024) {
throw new IOException("File is too large");
}
StringBuilder sb = new StringBuilder((int) (file.length()));
// 创建字节输入流
FileInputStream fis = new FileInputStream(filePath);
// 创建一个长度为10240的Buffer
byte[] bbuf = new byte[10240];
// 用于保存实际读取的字节数
int hasRead = 0;
while ( (hasRead = fis.read(bbuf)) > 0 ) {
sb.append(new String(bbuf, 0, hasRead));
}
fis.close();
return sb.toString();
}
/**
* byte[]
*/
public static byte[] readFileByBytes(String filePath) throws IOException {
File file = new File(filePath);
if (!file.exists()) {
throw new FileNotFoundException(filePath);
} else {
ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
BufferedInputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(file));
short bufSize = 1024;
byte[] buffer = new byte[bufSize];
int len1;
while (-1 != (len1 = in.read(buffer, 0, bufSize))) {
bos.write(buffer, 0, len1);
}
byte[] var7 = bos.toByteArray();
return var7;
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException var14) {
var14.printStackTrace();
}
bos.close();
}
}
}
}

@ -0,0 +1,29 @@
/*
* Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
*/
package jnpf.ocr_sdk.baiduUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import java.lang.reflect.Type;
/**
* Json.
*/
public class GsonUtils {
private static Gson gson = new GsonBuilder().create();
public static String toJson(Object value) {
return gson.toJson(value);
}
public static <T> T fromJson(String json, Class<T> classOfT) throws JsonParseException {
return gson.fromJson(json, classOfT);
}
public static <T> T fromJson(String json, Type typeOfT) throws JsonParseException {
return (T) gson.fromJson(json, typeOfT);
}
}

@ -0,0 +1,77 @@
package jnpf.ocr_sdk.baiduUtils;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import java.util.Map;
/**
* http
*/
public class HttpUtil {
public static String post(String requestUrl, String accessToken, String params)
throws Exception {
String contentType = "application/x-www-form-urlencoded";
return HttpUtil.post(requestUrl, accessToken, contentType, params);
}
public static String post(String requestUrl, String accessToken, String contentType, String params)
throws Exception {
String encoding = "UTF-8";
if (requestUrl.contains("nlp")) {
encoding = "GBK";
}
return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
}
public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding)
throws Exception {
String url = requestUrl + "?access_token=" + accessToken;
return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
}
public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding)
throws Exception {
URL url = new URL(generalUrl);
// 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
// 设置通用的请求属性
connection.setRequestProperty("Content-Type", contentType);
connection.setRequestProperty("Connection", "Keep-Alive");
connection.setUseCaches(false);
connection.setDoOutput(true);
connection.setDoInput(true);
// 得到请求的输出流对象
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
out.write(params.getBytes(encoding));
out.flush();
out.close();
// 建立实际的连接
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> headers = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : headers.keySet()) {
System.err.println(key + "--->" + headers.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
BufferedReader in = null;
in = new BufferedReader(
new InputStreamReader(connection.getInputStream(), encoding));
String result = "";
String getLine;
while ((getLine = in.readLine()) != null) {
result += getLine;
}
in.close();
System.err.println("result:" + result);
return result;
}
}

@ -0,0 +1,78 @@
package jnpf.ocr_sdk.baiduUtils;
import org.springframework.web.multipart.MultipartFile;
import java.net.URLEncoder;
/**
* @Author: WangChuang
* @Date: 10/2/2023 10:12
* @Description //注释:
* @Version 1.0
*/
public class VatInvoice {
/**
*
* FileUtil,Base64Util,HttpUtil,GsonUtils
* https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
* https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
* https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
* https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
*
*/
public static String vatInvoice(MultipartFile file) {
// 请求url
String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice";
try {
// 本地文件路径
// String filePath = "[本地文件路径]";
// byte[] imgData = FileUtil.readFileByBytes(filePath);
String imgStr = Base64Util.encode(file.getBytes());
String imgParam = URLEncoder.encode(imgStr, "UTF-8");
String param = "image=" + imgParam;
// 注意这里仅为了简化编码每一次请求都去获取access_token线上环境access_token有过期时间 客户端可自行缓存,过期后重新获取。
String accessToken = BaiduUtils.getAuth();
String result = HttpUtil.post(url, accessToken, param);
System.out.println(result);
return result;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
*
*/
public static String weightNote(MultipartFile file) {
// 请求url
String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/weight_note";
try {
// 本地文件路径
// String filePath = "[本地文件路径]";
// byte[] imgData = FileUtil.readFileByBytes(filePath);
String imgStr = Base64Util.encode(file.getBytes());
String imgParam = URLEncoder.encode(imgStr, "UTF-8");
String param = "image=" + imgParam;
// 注意这里仅为了简化编码每一次请求都去获取access_token线上环境access_token有过期时间 客户端可自行缓存,过期后重新获取。
String accessToken = BaiduUtils.getAuth();
String result = HttpUtil.post(url, accessToken, param);
System.out.println(result);
return result;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
// public static void main(String[] args) {
// VatInvoice.vatInvoice();
// }
}

@ -0,0 +1,42 @@
package jnpf.ocr_sdk.controller;
import ai.djl.ModelException;
import ai.djl.translate.TranslateException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.ocr_sdk.baiduUtils.VatInvoice;
import jnpf.util.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
/**
* @Author: WangChuang
* @Date: 10/2/2023 9:20
* @Description //注释:
* @Version 1.0
*/
@Slf4j
@RestController
@Api(tags = "baiduAI识别图像API" , value = "BaiduAI识别图像API")
@RequestMapping("/api/OcrAPI/BaiduOcr")
public class BaiduOcrController {
@ApiOperation("发票识别")
@PostMapping("/uPicture")
public ActionResult UploadPicture(MultipartFile file ) throws IOException, ModelException, TranslateException {
String s = VatInvoice.vatInvoice(file);
return ActionResult.success(JsonUtil.stringToMap(s));
}
@ApiOperation("榜单识别")
@PostMapping("/weightNote")
public ActionResult weightNote(MultipartFile file ) throws IOException, ModelException, TranslateException {
String s = VatInvoice.weightNote(file);
return ActionResult.success(JsonUtil.stringToMap(s));
}
}

@ -0,0 +1,81 @@
package jnpf.ocr_sdk.controller;
import ai.djl.ModelException;
import ai.djl.translate.TranslateException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.ocr_sdk.OcrV3RecognitionExample;
import jnpf.ocr_sdk.utils.common.RotatedBox;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* @Author: WangChuang
* @Date: 10/2/2023 9:06
* @Description //注释:
* @Version 1.0
*/
@Slf4j
@RestController
@Api(tags = "AI识别图像API" , value = "AI识别图像API")
@RequestMapping("/api/OcrAPI/OcrAPI")
public class OcrController {
// @Resource
// private OcrV3RecognitionExample ocrV3RecognitionExample;
@ApiOperation("图片上传")
@PostMapping("/uPicture")
public ActionResult UploadPicture(MultipartFile file ) throws IOException, ModelException, TranslateException {
String fileName = file.getOriginalFilename();
System.out.println(fileName);
//调用工具类的方法
ArrayList<String> columnNames = new ArrayList<>();
HashMap<String, Integer> columnMap = new HashMap<>();
// 发票代码
columnNames.add("No");
// 1:从左到右+1
// 2:从左到右-1
// -1:从上到下+1
// -2:从上到下-1
// 0:本身自己
columnMap.put("No",0);
// 发票号码
columnNames.add("机器编号");
columnMap.put("机器编号",-1);
// 发票数量
columnNames.add("量");
columnMap.put("量",-1);
// 发票金额
columnNames.add("小写");
columnMap.put("小写",-2);
// 税率
columnNames.add("税率");
columnMap.put("税率",-1);
// 税额 (用税率二次)
// 不含税金额 (金额减去税额)
// 开票日期
columnNames.add("开票日期:");
columnMap.put("开票日期:",0);
// 物料名称
columnNames.add("货物或应税劳务");
columnMap.put("货物或应税劳务",-1);
List<RotatedBox> rotatedBoxes = OcrV3RecognitionExample.ocrAI(file.getInputStream());
ArrayList<String> example = OcrV3RecognitionExample.getExample(rotatedBoxes, columnNames,columnMap);
return ActionResult.success(example);
}
}

@ -34,7 +34,7 @@ public class PaymentEntity {
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
private String creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@ -43,7 +43,7 @@ public class PaymentEntity {
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
private String lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@ -52,7 +52,7 @@ public class PaymentEntity {
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
private String deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@ -76,10 +76,10 @@ public class PaymentEntity {
private BigDecimal requestedamount;
@TableField("BUSINESSDATE")
private Date businessdate;
private String businessdate;
@TableField("DUEDATE")
private Date duedate;
private String duedate;
@TableField("STATUS")
private String status;

@ -15,3 +15,4 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface PaymentMapper extends BaseMapper<PaymentEntity> {
}

@ -13,23 +13,19 @@ import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.collection.entity.CollectionEntity;
import jnpf.collection.service.CollectionService;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import jnpf.payment.entity.PaymentEntity;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.payment.mapper.PaymentMapper;
import jnpf.payment.model.payment.PaymentCrForm;
import jnpf.payment.service.PaymentService;
import jnpf.payment.service.Payment_item0Service;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.paymentdoc.model.paymentdoc.*;
import jnpf.paymentdoc.model.paymentdoc.PaymentdocPagination;
import jnpf.entity.*;
import jnpf.paymentdoc.entity.Paymentdoc_item0Entity;
import jnpf.util.*;
import jnpf.base.util.*;
import jnpf.base.vo.ListVO;
import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import lombok.Cleanup;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@ -38,13 +34,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.paymentdoc.entity.PaymentdocEntity;
import jnpf.paymentdoc.service.PaymentdocService;
import jnpf.paymentdoc.entity.Paymentdoc_item0Entity;
import jnpf.paymentdoc.service.Paymentdoc_item0Service;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import jnpf.util.GeneraterSwapUtil;
@ -83,6 +77,10 @@ public class PaymentdocController {
private Paymentdoc_item0Service paymentdoc_item0Service;
@Autowired
private PaymentService paymentService;
@Autowired
private PaymentMapper paymentMapper;
@Autowired
private Payment_item0Service payment_item0Service;
/**
*
@ -90,25 +88,62 @@ public class PaymentdocController {
* @param
* @return
*/
// @PostMapping("/paymentapplylist")
// public ActionResult paymentapplylist( @PathVariable("id") String id,@RequestBody @Valid PaymentdocCrForm paymentdocCrForm){
//
// PaymentEntity paymentEntity = new PaymentEntity();
// @GetMapping("/{id}")
@PostMapping("/paymentapplylist")
public ActionResult paymentapplylist(@RequestBody PaymentdocCrForms paymentdocCrForms) throws DataException {
PaymentEntity paymentEntity = new PaymentEntity();
PaymentCrForm paymentCrForm =new PaymentCrForm();
// String mainId =RandomUtil.uuId();
// UserInfo userInfo=userProvider.get();
//
// paymentEntity.setCreatorUserName(paymentdocCrForm.getCreatorUserName());
// paymentEntity.setCreatorUserName(paymentdocUpForms.getCreatorUserName());
// paymentEntity.setCreatorTime(new Date());
//
// PaymentEntity entity = JsonUtil.getJsonToBean(paymentEntity, PaymentEntity.class);
PaymentEntity entity = JsonUtil.getJsonToBean(paymentEntity, PaymentEntity.class);
// entity.setId(mainId);
// paymentService.save(entity);
//
//
// paymentdocCrForm.setIsPay("1");
// paymentdocService.update(paymentdocCrForm);
// return ActionResult.success("创建成功");
// }
PaymentdocEntity paymentdocEntity=paymentdocService.getById(paymentdocCrForms.getId());
//添加到付款单
// paymentEntity.setId(paymentdocUpForms.getId());
paymentEntity.setDocumentno(generaterSwapUtil.getBillNumber("payment" ,false));
paymentEntity.setPaymentno(paymentdocCrForms.getDocumentNo());
paymentEntity.setPaymentamount(paymentdocCrForms.getPaymentAmount());
paymentEntity.setRequestedamount(paymentdocCrForms.getRamount());
paymentEntity.setBusinessdate(paymentdocCrForms.getBusinessDate());
paymentEntity.setDuedate(paymentdocCrForms.getDueDate());
paymentEntity.setStatus(paymentdocCrForms.getStatus());
paymentEntity.setSuppliercode(paymentdocCrForms.getSupplierCode());
paymentEntity.setSuppliername(paymentdocCrForms.getSupplierName());
paymentEntity.setCurrency(paymentCrForm.getCurrency());
paymentEntity.setPaymenttype(paymentdocCrForms.getPaymentType());
paymentEntity.setSettlementtype(paymentdocCrForms.getSettlementType());
paymentEntity.setRemark(paymentdocCrForms.getRemark());
paymentEntity.setCollectionaccount(paymentdocCrForms.getCollectionAccount());
paymentEntity.setCollectionbank(paymentdocCrForms.getColectionBank());
paymentEntity.setCreatorUserId(paymentdocCrForms.getCreatorUserId());
paymentEntity.setCreatorUserName(paymentdocCrForms.getCreatorUserName());
paymentEntity.setCreatorTime(paymentdocCrForms.getCreatorTime());
paymentEntity.setLastModifyUserId(paymentdocCrForms.getLastModifyUserId());
paymentEntity.setLastModifyUserName(paymentdocCrForms.getLastModifyUserName());
paymentEntity.setLastModifyTime(paymentdocCrForms.getLastModifyTime());
paymentMapper.insert(paymentEntity);
//修改付款状态
paymentdocEntity.setIsPay("1");
paymentdocService.updateById(paymentdocEntity);
//子表
List<Paymentdoc_item0Entity> Paymentdoc_item0List = JsonUtil.getJsonToList(paymentdocCrForms.getPaymentdoc_item0List(),Paymentdoc_item0Entity.class);
List<Payment_item0Entity> Payment_item0List = JsonUtil.getJsonToList(paymentdocCrForms.getPayment_item0List(),Payment_item0Entity.class);
for(Payment_item0Entity entitys : Payment_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPaymentId(entity.getId());
payment_item0Service.save(entitys);
}
return ActionResult.success("修改(付款)成功");
}
@ -163,18 +198,6 @@ public class PaymentdocController {
for(Paymentdoc_item0Entity entitys : Paymentdoc_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPaymentdocId(entity.getId());
paymentdoc_item0Service.save(entitys);
}

@ -0,0 +1,121 @@
package jnpf.paymentdoc.model.paymentdoc;
import com.fasterxml.jackson.annotation.JsonProperty;
import jnpf.payment.entity.PaymentEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-09
*/
@Data
public class PaymentdocCrForms {
/** id **/
@JsonProperty("id")
private String id;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 供应商编码 **/
@JsonProperty("supplierCode")
private String supplierCode;
/** 供应商名称 **/
@JsonProperty("supplierName")
private String supplierName;
/** 付款类型 **/
@JsonProperty("paymentType")
private String paymentType;
/** 申请金额 **/
@JsonProperty("ramount")
private BigDecimal ramount;
/** 申请时间 **/
@JsonProperty("businessDate")
private String businessDate;
/** 应付日期 **/
@JsonProperty("dueDate")
private String dueDate;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 收款账户 **/
@JsonProperty("collectionAccount")
private String collectionAccount;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 结算类型 **/
@JsonProperty("settlementType")
private String settlementType;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 付款金额 **/
@JsonProperty("paymentAmount")
private BigDecimal paymentAmount;
/** 未付款金额 **/
@JsonProperty("unpaymentAmount")
private String unpaymentAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单人id **/
@JsonProperty("CreatorUserId")
private String CreatorUserId;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改人ID **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
@JsonProperty("isPay")
private String isPay;
/** 子表数据 **/
@JsonProperty("paymentdoc_item0List")
private List<Paymentdoc_item0Model> paymentdoc_item0List;
/** 子表数据付款 **/
@JsonProperty("payment_item0List")
private List<PaymentEntity> payment_item0List;
}

@ -1,63 +1,54 @@
package jnpf.reservoirarea.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.model.reservoirarea.*;
import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination;
import jnpf.reservoirarea.entity.*;
import jnpf.reservoirarea.service.ReservoirareaService;
import jnpf.util.*;
import jnpf.base.util.*;
import jnpf.base.vo.ListVO;
import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.service.ReservoirareaService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import jnpf.util.GeneraterSwapUtil;
import java.util.*;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* reservoirarea
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Slf4j
@RestController
@Api(tags = "reservoirarea" , value = "reservoirarea")
@RequestMapping("/api/reservoirarea/Reservoirarea")
@Api(tags = "库区管理" , value = "example")
@RequestMapping("/api/example/Reservoirarea")
public class ReservoirareaController {
@Autowired
@ -87,9 +78,7 @@ public class ReservoirareaController {
//处理id字段转名称若无需转或者为空可删除
for(ReservoirareaEntity entity:list){
Map<String,Object> warehouseIdMap = new HashMap<>();
entity.setWarehouseId(generaterSwapUtil.getPopupSelectValue("380988259175524165","id","name",entity.getWarehouseId(),warehouseIdMap));
entity.setOrgnizeId(generaterSwapUtil.comSelectValues(entity.getOrgnizeId()));
entity.setDepartmentId(generaterSwapUtil.comSelectValues(entity.getDepartmentId()));
entity.setWarehouseId(generaterSwapUtil.getPopupSelectValue("394860934465658373","id","NAME",entity.getWarehouseId(),warehouseIdMap));
}
List<ReservoirareaListVO> listVO=JsonUtil.getJsonToList(list,ReservoirareaListVO.class);
for(ReservoirareaListVO reservoirareaVO:listVO){
@ -115,6 +104,7 @@ public class ReservoirareaController {
public ActionResult create(@RequestBody @Valid ReservoirareaCrForm reservoirareaCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
reservoirareaCrForm.setCreatorTime(DateUtil.getNow());
ReservoirareaEntity entity = JsonUtil.getJsonToBean(reservoirareaCrForm, ReservoirareaEntity.class);
entity.setId(mainId);
reservoirareaService.save(entity);
@ -159,9 +149,7 @@ public class ReservoirareaController {
//处理id字段转名称若无需转或者为空可删除
for(ReservoirareaEntity entity:list){
Map<String,Object> warehouseIdMap = new HashMap<>();
entity.setWarehouseId(generaterSwapUtil.swapRelationFormValue("comInputField109",entity.getWarehouseId(),"294090217084722181",warehouseIdMap));
entity.setOrgnizeId(generaterSwapUtil.comSelectValues(entity.getOrgnizeId()));
entity.setDepartmentId(generaterSwapUtil.comSelectValues(entity.getDepartmentId()));
entity.setWarehouseId(generaterSwapUtil.getPopupSelectValue("394860934465658373","id","NAME",entity.getWarehouseId(),warehouseIdMap));
}
List<ReservoirareaListVO> listVO=JsonUtil.getJsonToList(list,ReservoirareaListVO.class);
for(ReservoirareaListVO reservoirareaVO:listVO){
@ -202,23 +190,11 @@ public class ReservoirareaController {
case "warehouseId" :
entitys.add(new ExcelExportEntity("仓库" ,"warehouseId"));
break;
case "orgnizeId" :
entitys.add(new ExcelExportEntity("组织" ,"orgnizeId"));
break;
case "departmentId" :
entitys.add(new ExcelExportEntity("部门" ,"departmentId"));
break;
case "creatortime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatortime"));
break;
case "creatorusername" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorusername"));
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "lastmodifytime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastmodifytime"));
break;
case "lastmodifyusername" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastmodifyusername"));
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
default:
break;
@ -283,6 +259,12 @@ public class ReservoirareaController {
public ActionResult<ReservoirareaInfoVO> info(@PathVariable("id") String id){
ReservoirareaEntity entity= reservoirareaService.getInfo(id);
ReservoirareaInfoVO vo=JsonUtil.getJsonToBean(entity, ReservoirareaInfoVO.class);
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
//子表
//副表
@ -306,9 +288,7 @@ public class ReservoirareaController {
//添加到详情表单对象中
Map<String,Object> warehouseIdMap = new HashMap<>();
vo.setWarehouseId(generaterSwapUtil.swapRelationFormValue("comInputField109",vo.getWarehouseId(),"294090217084722181",warehouseIdMap));
vo.setOrgnizeId(generaterSwapUtil.comSelectValues(vo.getOrgnizeId()));
vo.setDepartmentId(generaterSwapUtil.comSelectValues(vo.getDepartmentId()));
vo.setWarehouseId(generaterSwapUtil.getPopupSelectValue("394860934465658373","id","NAME",vo.getWarehouseId(),warehouseIdMap));
return ActionResult.success(vo);
}
@ -328,7 +308,9 @@ public class ReservoirareaController {
UserInfo userInfo=userProvider.get();
ReservoirareaEntity entity= reservoirareaService.getInfo(id);
if(entity!=null){
reservoirareaUpForm.setLastModifyTime(DateUtil.getNow());
ReservoirareaEntity subentity=JsonUtil.getJsonToBean(reservoirareaUpForm, ReservoirareaEntity.class);
subentity.setCreatorTime(entity.getCreatorTime());
reservoirareaService.update(id, subentity);
return ActionResult.success("更新成功");
}else{

@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
@TableName("jg_reservoirarea")
@ -26,34 +26,34 @@ public class ReservoirareaEntity {
private String id;
@TableField("CREATOR_USER_ID")
private String creatoruserid;
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorusername;
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatortime;
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid;
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername;
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastmodifytime;
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteuserid;
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteusername;
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deletetime;
private Date deleteTime;
@TableField("DELETE_MARK")
private String deletemark;
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@ -82,4 +82,10 @@ public class ReservoirareaEntity {
@TableField("UNIT")
private String unit;
@TableField("CLOSE_NUM")
private Integer closeNum;
@TableField("CLOSE_TIME")
private Date closeTime;
}

@ -1,16 +1,16 @@
package jnpf.reservoirarea.mapper;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
/**
*
* reservoirarea
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
* 2023-02-13
*/
public interface ReservoirareaMapper extends BaseMapper<ReservoirareaEntity> {

@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class ReservoirareaCrForm {
@ -47,29 +47,13 @@ public class ReservoirareaCrForm {
@JsonProperty("warehouseId")
private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonProperty("lastModifyTime")
private String lastModifyTime;

@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class ReservoirareaInfoVO{
@ -51,28 +51,14 @@ public class ReservoirareaInfoVO{
@JsonProperty("warehouseId")
private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
}

@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class ReservoirareaListQuery extends Pagination {

@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class ReservoirareaListVO{
@ -56,36 +56,16 @@ public class ReservoirareaListVO{
private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatortime")
private Date creatortime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonProperty("creatorTime")
private Date creatorTime;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastmodifytime")
private Date lastmodifytime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
}

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class ReservoirareaPagination extends Pagination {

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class ReservoirareaPaginationExportModel extends Pagination {

@ -15,7 +15,7 @@ import lombok.Data;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class ReservoirareaUpForm{
@ -58,34 +58,14 @@ public class ReservoirareaUpForm{
private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonProperty("lastModifyTime")
private String lastModifyTime;
}

@ -1,16 +1,17 @@
package jnpf.reservoirarea.service;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination;
import java.util.*;
import java.util.List;
/**
*
* reservoirarea
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
* 2023-02-13
*/
public interface ReservoirareaService extends IService<ReservoirareaEntity> {

@ -1,44 +1,34 @@
package jnpf.reservoirarea.service.impl;
import jnpf.reservoirarea.entity.*;
import jnpf.reservoirarea.mapper.ReservoirareaMapper;
import jnpf.reservoirarea.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.mapper.ReservoirareaMapper;
import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination;
import jnpf.reservoirarea.service.ReservoirareaService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
/**
*
* reservoirarea
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
* 2023-02-13
*/
@Service
public class ReservoirareaServiceImpl extends ServiceImpl<ReservoirareaMapper, ReservoirareaEntity> implements ReservoirareaService {
@ -103,7 +93,7 @@ public class ReservoirareaServiceImpl extends ServiceImpl<ReservoirareaMapper, R
}
//排序
if(StringUtil.isEmpty(reservoirareaPagination.getSidx())){
reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getId);
reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getCreatorTime);
}else{
try {
String sidx = reservoirareaPagination.getSidx();
@ -174,7 +164,7 @@ public class ReservoirareaServiceImpl extends ServiceImpl<ReservoirareaMapper, R
}
//排序
if(StringUtil.isEmpty(reservoirareaPagination.getSidx())){
reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getId);
reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getCreatorTime);
}else{
try {
String sidx = reservoirareaPagination.getSidx();

@ -1,64 +1,55 @@
package jnpf.warehouse.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.warehouse.model.warehouse.*;
import jnpf.warehouse.model.warehouse.WarehousePagination;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.base.util.*;
import jnpf.base.vo.ListVO;
import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
import jnpf.warehouse.entity.WareHouseEntity;
import jnpf.warehouse.model.warehouse.*;
import jnpf.warehouse.service.WareHouseService;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.warehouse.entity.WarehouseEntity;
import jnpf.warehouse.service.WarehouseService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import jnpf.util.GeneraterSwapUtil;
import java.util.*;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* warehouse
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Slf4j
@RestController
@Api(tags = "warehouse" , value = "warehouse")
@RequestMapping("/api/warehouse/Warehouse")
public class WarehouseController {
@Api(tags = "仓库管理" , value = "example")
@RequestMapping("/api/example/WareHouse")
public class WareHouseController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -70,7 +61,7 @@ public class WarehouseController {
private UserProvider userProvider;
@Autowired
private WarehouseService warehouseService;
private WareHouseService wareHouseService;
@ -78,24 +69,31 @@ public class WarehouseController {
/**
*
*
* @param warehousePagination
* @param wareHousePagination
* @return
*/
@ApiOperation("列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody WarehousePagination warehousePagination)throws IOException{
List<WarehouseEntity> list= warehouseService.getList(warehousePagination);
public ActionResult list(@RequestBody WareHousePagination wareHousePagination)throws IOException{
List<WareHouseEntity> list= wareHouseService.getList(wareHousePagination);
//处理id字段转名称若无需转或者为空可删除
for(WarehouseEntity entity:list){
for(WareHouseEntity entity:list){
Map<String,Object> companyCodeMap = new HashMap<>();
entity.setCompanyCode(generaterSwapUtil.getPopupSelectValue("394016341591396805","F_Id","F_FullName",entity.getCompanyCode(),companyCodeMap));
Map<String,Object> sublibraryMap = new HashMap<>();
entity.setSublibrary(generaterSwapUtil.getPopupSelectValue("394818245032483845","id","inventory_org_detail_name",entity.getSublibrary(),sublibraryMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
// entity.setOrgId(generaterSwapUtil.comSelectValue(entity.getOrgId(), "all"));
// entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
}
List<WarehouseListVO> listVO=JsonUtil.getJsonToList(list,WarehouseListVO.class);
for(WarehouseListVO warehouseVO:listVO){
List<WareHouseListVO> listVO=JsonUtil.getJsonToList(list,WareHouseListVO.class);
for(WareHouseListVO wareHouseVO:listVO){
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(warehousePagination,PaginationVO.class);
PaginationVO page=JsonUtil.getJsonToBean(wareHousePagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
@ -104,17 +102,23 @@ public class WarehouseController {
/**
*
*
* @param warehouseCrForm
* @param wareHouseCrForm
* @return
*/
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid WarehouseCrForm warehouseCrForm) throws DataException {
public ActionResult create(@RequestBody @Valid WareHouseCrForm wareHouseCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
WarehouseEntity entity = JsonUtil.getJsonToBean(warehouseCrForm, WarehouseEntity.class);
wareHouseCrForm.setCreatorUserName(userInfo.getUserId());
wareHouseCrForm.setCreatorTime(DateUtil.getNow());
wareHouseCrForm.setOrgId(StringUtil.isEmpty(userInfo.getDepartmentId()) ? userInfo.getOrganizeId() : userInfo.getDepartmentId());
if(userInfo.getPositionIds()!=null&&userInfo.getPositionIds().length>0){
wareHouseCrForm.setDepartmentId(userInfo.getPositionIds()[0]);
}
WareHouseEntity entity = JsonUtil.getJsonToBean(wareHouseCrForm, WareHouseEntity.class);
entity.setId(mainId);
warehouseService.save(entity);
wareHouseService.save(entity);
return ActionResult.success("创建成功");
@ -147,22 +151,30 @@ public class WarehouseController {
*/
@ApiOperation("导出Excel")
@GetMapping("/Actions/Export")
public ActionResult Export(WarehousePaginationExportModel warehousePaginationExportModel) throws IOException {
if (StringUtil.isEmpty(warehousePaginationExportModel.getSelectKey())){
public ActionResult Export(WareHousePaginationExportModel wareHousePaginationExportModel) throws IOException {
if (StringUtil.isEmpty(wareHousePaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
WarehousePagination warehousePagination=JsonUtil.getJsonToBean(warehousePaginationExportModel, WarehousePagination.class);
List<WarehouseEntity> list= warehouseService.getTypeList(warehousePagination,warehousePaginationExportModel.getDataType());
WareHousePagination wareHousePagination=JsonUtil.getJsonToBean(wareHousePaginationExportModel, WareHousePagination.class);
List<WareHouseEntity> list= wareHouseService.getTypeList(wareHousePagination,wareHousePaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(WarehouseEntity entity:list){
for(WareHouseEntity entity:list){
Map<String,Object> companyCodeMap = new HashMap<>();
entity.setCompanyCode(generaterSwapUtil.getPopupSelectValue("394016341591396805","F_Id","F_FullName",entity.getCompanyCode(),companyCodeMap));
Map<String,Object> sublibraryMap = new HashMap<>();
entity.setSublibrary(generaterSwapUtil.getPopupSelectValue("394818245032483845","id","inventory_org_detail_name",entity.getSublibrary(),sublibraryMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setOrgId(generaterSwapUtil.comSelectValue(entity.getOrgId(), "all"));
entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
}
List<WarehouseListVO> listVO=JsonUtil.getJsonToList(list,WarehouseListVO.class);
for(WarehouseListVO warehouseVO:listVO){
List<WareHouseListVO> listVO=JsonUtil.getJsonToList(list,WareHouseListVO.class);
for(WareHouseListVO wareHouseVO:listVO){
}
//转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
String[]keys=!StringUtil.isEmpty(warehousePaginationExportModel.getSelectKey())?warehousePaginationExportModel.getSelectKey().split(","):new String[0];
String[]keys=!StringUtil.isEmpty(wareHousePaginationExportModel.getSelectKey())?wareHousePaginationExportModel.getSelectKey().split(","):new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,keys,userInfo);
return ActionResult.success(vo);
@ -177,11 +189,11 @@ public class WarehouseController {
case "code" :
entitys.add(new ExcelExportEntity("仓库编码" ,"code"));
break;
case "companyCode" :
entitys.add(new ExcelExportEntity("公司代码" ,"companyCode"));
case "name" :
entitys.add(new ExcelExportEntity("仓库名称" ,"name"));
break;
case "companyName" :
entitys.add(new ExcelExportEntity("公司名称" ,"companyName"));
case "companyCode" :
entitys.add(new ExcelExportEntity("公司" ,"companyCode"));
break;
case "location" :
entitys.add(new ExcelExportEntity("仓库位置" ,"location"));
@ -189,9 +201,6 @@ public class WarehouseController {
case "type" :
entitys.add(new ExcelExportEntity("仓库类型" ,"type"));
break;
case "organization" :
entitys.add(new ExcelExportEntity("ERP库存组织" ,"organization"));
break;
case "sublibrary" :
entitys.add(new ExcelExportEntity("ERP子库" ,"sublibrary"));
break;
@ -201,17 +210,23 @@ public class WarehouseController {
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "creatorusername" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorusername"));
case "creatorUserName" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorUserName"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "creatortime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatortime"));
case "lastModifyUserName" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastModifyUserName"));
break;
case "lastmodifyusername" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastmodifyusername"));
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
case "lastmodifytime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastmodifytime"));
case "orgId" :
entitys.add(new ExcelExportEntity("组织ID" ,"orgId"));
break;
case "departmentId" :
entitys.add(new ExcelExportEntity("部门ID" ,"departmentId"));
break;
default:
break;
@ -273,9 +288,19 @@ public class WarehouseController {
* @return
*/
@GetMapping("/{id}")
public ActionResult<WarehouseInfoVO> info(@PathVariable("id") String id){
WarehouseEntity entity= warehouseService.getInfo(id);
WarehouseInfoVO vo=JsonUtil.getJsonToBean(entity, WarehouseInfoVO.class);
public ActionResult<WareHouseInfoVO> info(@PathVariable("id") String id){
WareHouseEntity entity= wareHouseService.getInfo(id);
WareHouseInfoVO vo=JsonUtil.getJsonToBean(entity, WareHouseInfoVO.class);
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
// vo.setOrgId(generaterSwapUtil.comSelectValue(vo.getOrgId(), "all"));
// vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
//子表
//副表
@ -289,15 +314,23 @@ public class WarehouseController {
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<WarehouseInfoVO> detailInfo(@PathVariable("id") String id){
WarehouseEntity entity= warehouseService.getInfo(id);
WarehouseInfoVO vo=JsonUtil.getJsonToBean(entity, WarehouseInfoVO.class);
public ActionResult<WareHouseInfoVO> detailInfo(@PathVariable("id") String id){
WareHouseEntity entity= wareHouseService.getInfo(id);
WareHouseInfoVO vo=JsonUtil.getJsonToBean(entity, WareHouseInfoVO.class);
//子表数据转换
//附表数据转换
//添加到详情表单对象中
Map<String,Object> companyCodeMap = new HashMap<>();
vo.setCompanyCode(generaterSwapUtil.getPopupSelectValue("394016341591396805","F_Id","F_FullName",vo.getCompanyCode(),companyCodeMap));
Map<String,Object> sublibraryMap = new HashMap<>();
vo.setSublibrary(generaterSwapUtil.getPopupSelectValue("394818245032483845","id","inventory_org_detail_name",vo.getSublibrary(),sublibraryMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
vo.setOrgId(generaterSwapUtil.comSelectValue(vo.getOrgId(), "all"));
vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
return ActionResult.success(vo);
}
@ -313,12 +346,18 @@ public class WarehouseController {
*/
@PutMapping("/{id}")
@Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehouseUpForm warehouseUpForm) throws DataException {
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WareHouseUpForm wareHouseUpForm) throws DataException {
UserInfo userInfo=userProvider.get();
WarehouseEntity entity= warehouseService.getInfo(id);
WareHouseEntity entity= wareHouseService.getInfo(id);
if(entity!=null){
WarehouseEntity subentity=JsonUtil.getJsonToBean(warehouseUpForm, WarehouseEntity.class);
warehouseService.update(id, subentity);
wareHouseUpForm.setLastModifyUserName(userInfo.getUserId());
wareHouseUpForm.setLastModifyTime(DateUtil.getNow());
wareHouseUpForm.setOrgId(entity.getOrgId());
wareHouseUpForm.setDepartmentId(entity.getDepartmentId());
WareHouseEntity subentity=JsonUtil.getJsonToBean(wareHouseUpForm, WareHouseEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime());
wareHouseService.update(id, subentity);
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
@ -336,9 +375,9 @@ public class WarehouseController {
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
WarehouseEntity entity= warehouseService.getInfo(id);
WareHouseEntity entity= wareHouseService.getInfo(id);
if(entity!=null){
warehouseService.delete(entity);
wareHouseService.delete(entity);
}
return ActionResult.success("删除成功");

@ -1,13 +1,11 @@
package jnpf.warehouse.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
@ -16,44 +14,44 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
@TableName("jg_warehouse")
public class WarehouseEntity {
public class WareHouseEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatoruserid;
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorusername;
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatortime;
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid;
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername;
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastmodifytime;
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteuserid;
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteusername;
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deletetime;
private Date deleteTime;
@TableField("DELETE_MARK")
private String deletemark;
private String deleteMark;
@TableField("ORG_ID")
private String orgId;
@ -70,15 +68,9 @@ public class WarehouseEntity {
@TableField("COMPANY_CODE")
private String companyCode;
@TableField("COMPANY_NAME")
private String companyName;
@TableField("TYPE")
private String type;
@TableField("ORGANIZATION")
private String organization;
@TableField("SUBLIBRARY")
private String sublibrary;

@ -1,17 +1,17 @@
package jnpf.warehouse.mapper;
import jnpf.warehouse.entity.WarehouseEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.warehouse.entity.WareHouseEntity;
/**
*
* warehouse
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
* 2023-02-13
*/
public interface WarehouseMapper extends BaseMapper<WarehouseEntity> {
public interface WareHouseMapper extends BaseMapper<WareHouseEntity> {
}

@ -14,23 +14,23 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class WarehouseCrForm {
public class WareHouseCrForm {
/** 仓库编码 **/
@JsonProperty("code")
private String code;
/** 公司代码 **/
/** 仓库名称 **/
@JsonProperty("name")
private String name;
/** 公司 **/
@JsonProperty("companyCode")
private String companyCode;
/** 公司名称 **/
@JsonProperty("companyName")
private String companyName;
/** 仓库位置 **/
@JsonProperty("location")
private String location;
@ -39,10 +39,6 @@ public class WarehouseCrForm {
@JsonProperty("type")
private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/
@JsonProperty("sublibrary")
private String sublibrary;
@ -56,20 +52,28 @@ public class WarehouseCrForm {
private String remark;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;

@ -15,10 +15,10 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class WarehouseInfoVO{
public class WareHouseInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;
@ -27,14 +27,14 @@ public class WarehouseInfoVO{
@JsonProperty("code")
private String code;
/** 公司代码 **/
/** 仓库名称 **/
@JsonProperty("name")
private String name;
/** 公司 **/
@JsonProperty("companyCode")
private String companyCode;
/** 公司名称 **/
@JsonProperty("companyName")
private String companyName;
/** 仓库位置 **/
@JsonProperty("location")
private String location;
@ -43,10 +43,6 @@ public class WarehouseInfoVO{
@JsonProperty("type")
private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/
@JsonProperty("sublibrary")
private String sublibrary;
@ -60,19 +56,29 @@ public class WarehouseInfoVO{
private String remark;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;
}

@ -10,16 +10,16 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class WarehouseListQuery extends Pagination {
/** 激活状态 */
private String activestate;
public class WareHouseListQuery extends Pagination {
/** 仓库编码 */
private String code;
/** 仓库名称 */
private String name;
/**
* id
*/

@ -3,44 +3,39 @@
package jnpf.warehouse.model.warehouse;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class WarehouseListVO{
public class WareHouseListVO{
/** 主键 */
private String id;
/*仓库名称 */
@JsonProperty("name")
private String name;
/** 仓库编码 **/
@JsonProperty("code")
private String code;
/** 公司代码 **/
@JsonProperty("companyCode")
private String companyCode;
/** 仓库名称 **/
@JsonProperty("name")
private String name;
/** 公司名称 **/
@JsonProperty("companyName")
private String companyName;
/** 公司 **/
@JsonProperty("companyCode")
private String companyCode;
/** 仓库位置 **/
@ -53,11 +48,6 @@ public class WarehouseListVO{
private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/
@JsonProperty("sublibrary")
private String sublibrary;
@ -74,25 +64,35 @@ public class WarehouseListVO{
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatortime")
private Date creatortime;
@JsonProperty("creatorTime")
private Date creatorTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastmodifytime")
private Date lastmodifytime;
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;
}

@ -11,16 +11,16 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class WarehousePagination extends Pagination {
/** 激活状态 */
private String activestate;
public class WareHousePagination extends Pagination {
/** 仓库编码 */
private String code;
/** 仓库名称 */
private String name;
/**
* id
*/

@ -9,10 +9,10 @@ import java.util.*;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class WarehousePaginationExportModel extends Pagination {
public class WareHousePaginationExportModel extends Pagination {
private String selectKey;
@ -21,9 +21,9 @@ public class WarehousePaginationExportModel extends Pagination {
private String dataType;
/** 激活状态 */
private String activestate;
/** 仓库编码 */
private String code;
/** 仓库名称 */
private String name;
}

@ -15,10 +15,10 @@ import lombok.Data;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-13
*/
@Data
public class WarehouseUpForm{
public class WareHouseUpForm{
/** 主键 */
private String id;
@ -28,14 +28,14 @@ public class WarehouseUpForm{
private String code;
/** 公司代码 **/
@JsonProperty("companyCode")
private String companyCode;
/** 仓库名称 **/
@JsonProperty("name")
private String name;
/** 公司名称 **/
@JsonProperty("companyName")
private String companyName;
/** 公司 **/
@JsonProperty("companyCode")
private String companyCode;
/** 仓库位置 **/
@ -48,11 +48,6 @@ public class WarehouseUpForm{
private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/
@JsonProperty("sublibrary")
private String sublibrary;
@ -69,23 +64,33 @@ public class WarehouseUpForm{
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;
}

@ -0,0 +1,35 @@
package jnpf.warehouse.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.warehouse.entity.WareHouseEntity;
import jnpf.warehouse.model.warehouse.WareHousePagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface WareHouseService extends IService<WareHouseEntity> {
List<WareHouseEntity> getList(WareHousePagination wareHousePagination);
List<WareHouseEntity> getTypeList(WareHousePagination wareHousePagination,String dataType);
WareHouseEntity getInfo(String id);
void delete(WareHouseEntity entity);
void create(WareHouseEntity entity);
boolean update( String id, WareHouseEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,34 +0,0 @@
package jnpf.warehouse.service;
import jnpf.warehouse.entity.WarehouseEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.warehouse.model.warehouse.WarehousePagination;
import java.util.*;
/**
*
* warehouse
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface WarehouseService extends IService<WarehouseEntity> {
List<WarehouseEntity> getList(WarehousePagination warehousePagination);
List<WarehouseEntity> getTypeList(WarehousePagination warehousePagination,String dataType);
WarehouseEntity getInfo(String id);
void delete(WarehouseEntity entity);
void create(WarehouseEntity entity);
boolean update( String id, WarehouseEntity entity);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,222 @@
package jnpf.warehouse.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import jnpf.warehouse.entity.WareHouseEntity;
import jnpf.warehouse.mapper.WareHouseMapper;
import jnpf.warehouse.model.warehouse.WareHousePagination;
import jnpf.warehouse.service.WareHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
@Service
public class WareHouseServiceImpl extends ServiceImpl<WareHouseMapper, WareHouseEntity> implements WareHouseService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<WareHouseEntity> getList(WareHousePagination wareHousePagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int wareHouseNum =0;
QueryWrapper<WareHouseEntity> wareHouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(StringUtil.isNotEmpty(wareHousePagination.getCode())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getCode,wareHousePagination.getCode());
}
if(StringUtil.isNotEmpty(wareHousePagination.getName())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getName,wareHousePagination.getName());
}
if(AllIdList.size()>0){
wareHouseQueryWrapper.lambda().in(WareHouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(wareHousePagination.getSidx())){
wareHouseQueryWrapper.lambda().orderByDesc(WareHouseEntity::getCreatorTime);
}else{
try {
String sidx = wareHousePagination.getSidx();
WareHouseEntity wareHouseEntity = new WareHouseEntity();
Field declaredField = wareHouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
wareHouseQueryWrapper="asc".equals(wareHousePagination.getSort().toLowerCase())?wareHouseQueryWrapper.orderByAsc(value):wareHouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<WareHouseEntity> page=new Page<>(wareHousePagination.getCurrentPage(), wareHousePagination.getPageSize());
IPage<WareHouseEntity> userIPage=this.page(page, wareHouseQueryWrapper);
return wareHousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WareHouseEntity> list = new ArrayList();
return wareHousePagination.setData(list, list.size());
}
}
@Override
public List<WareHouseEntity> getTypeList(WareHousePagination wareHousePagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int wareHouseNum =0;
QueryWrapper<WareHouseEntity> wareHouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(StringUtil.isNotEmpty(wareHousePagination.getCode())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getCode,wareHousePagination.getCode());
}
if(StringUtil.isNotEmpty(wareHousePagination.getName())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getName,wareHousePagination.getName());
}
if(AllIdList.size()>0){
wareHouseQueryWrapper.lambda().in(WareHouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(wareHousePagination.getSidx())){
wareHouseQueryWrapper.lambda().orderByDesc(WareHouseEntity::getCreatorTime);
}else{
try {
String sidx = wareHousePagination.getSidx();
WareHouseEntity wareHouseEntity = new WareHouseEntity();
Field declaredField = wareHouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
wareHouseQueryWrapper="asc".equals(wareHousePagination.getSort().toLowerCase())?wareHouseQueryWrapper.orderByAsc(value):wareHouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WareHouseEntity> page=new Page<>(wareHousePagination.getCurrentPage(), wareHousePagination.getPageSize());
IPage<WareHouseEntity> userIPage=this.page(page, wareHouseQueryWrapper);
return wareHousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WareHouseEntity> list = new ArrayList();
return wareHousePagination.setData(list, list.size());
}
}else{
return this.list(wareHouseQueryWrapper);
}
}
@Override
public WareHouseEntity getInfo(String id){
QueryWrapper<WareHouseEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WareHouseEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WareHouseEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WareHouseEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(WareHouseEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,232 +0,0 @@
package jnpf.warehouse.service.impl;
import jnpf.warehouse.entity.*;
import jnpf.warehouse.mapper.WarehouseMapper;
import jnpf.warehouse.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.warehouse.model.warehouse.WarehousePagination;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
/**
*
* warehouse
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
@Service
public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, WarehouseEntity> implements WarehouseService{
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<WarehouseEntity> getList(WarehousePagination warehousePagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int warehouseNum =0;
QueryWrapper<WarehouseEntity> warehouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(StringUtil.isNotEmpty(warehousePagination.getActivestate())){
warehouseNum++;
warehouseQueryWrapper.lambda().eq(WarehouseEntity::getActivestate,warehousePagination.getActivestate());
}
if(StringUtil.isNotEmpty(warehousePagination.getCode())){
warehouseNum++;
warehouseQueryWrapper.lambda().like(WarehouseEntity::getCode,warehousePagination.getCode());
}
if(AllIdList.size()>0){
warehouseQueryWrapper.lambda().in(WarehouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(warehousePagination.getSidx())){
warehouseQueryWrapper.lambda().orderByDesc(WarehouseEntity::getId);
}else{
try {
String sidx = warehousePagination.getSidx();
WarehouseEntity warehouseEntity = new WarehouseEntity();
Field declaredField = warehouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehouseQueryWrapper="asc".equals(warehousePagination.getSort().toLowerCase())?warehouseQueryWrapper.orderByAsc(value):warehouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehouseEntity> page=new Page<>(warehousePagination.getCurrentPage(), warehousePagination.getPageSize());
IPage<WarehouseEntity> userIPage=this.page(page, warehouseQueryWrapper);
return warehousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehouseEntity> list = new ArrayList();
return warehousePagination.setData(list, list.size());
}
}
@Override
public List<WarehouseEntity> getTypeList(WarehousePagination warehousePagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int warehouseNum =0;
QueryWrapper<WarehouseEntity> warehouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(StringUtil.isNotEmpty(warehousePagination.getActivestate())){
warehouseNum++;
warehouseQueryWrapper.lambda().eq(WarehouseEntity::getActivestate,warehousePagination.getActivestate());
}
if(StringUtil.isNotEmpty(warehousePagination.getCode())){
warehouseNum++;
warehouseQueryWrapper.lambda().like(WarehouseEntity::getCode,warehousePagination.getCode());
}
if(AllIdList.size()>0){
warehouseQueryWrapper.lambda().in(WarehouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(warehousePagination.getSidx())){
warehouseQueryWrapper.lambda().orderByDesc(WarehouseEntity::getId);
}else{
try {
String sidx = warehousePagination.getSidx();
WarehouseEntity warehouseEntity = new WarehouseEntity();
Field declaredField = warehouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehouseQueryWrapper="asc".equals(warehousePagination.getSort().toLowerCase())?warehouseQueryWrapper.orderByAsc(value):warehouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehouseEntity> page=new Page<>(warehousePagination.getCurrentPage(), warehousePagination.getPageSize());
IPage<WarehouseEntity> userIPage=this.page(page, warehouseQueryWrapper);
return warehousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehouseEntity> list = new ArrayList();
return warehousePagination.setData(list, list.size());
}
}else{
return this.list(warehouseQueryWrapper);
}
}
@Override
public WarehouseEntity getInfo(String id){
QueryWrapper<WarehouseEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehouseEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehouseEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehouseEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(WarehouseEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -0,0 +1,7 @@
<?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="jnpf.inventoryOrd.mapper.InventoryOrgMapper">
</mapper>

@ -0,0 +1,7 @@
<?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="jnpf.inventoryOrdDetail.mapper.InventoryOrgDetailMapper">
</mapper>

@ -1,6 +1,6 @@
<?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="jnpf.monitorItem.mapper.Monitoring_itemMapper">
<mapper namespace="jnpf.monitoringitem.mapper.MonitoringitemMapper">
</mapper>

@ -0,0 +1,7 @@
<?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="jnpf.reservoirarea.mapper.ReservoirareaMapper">
</mapper>

@ -0,0 +1,7 @@
<?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="jnpf.warehouse.mapper.WareHouseMapper">
</mapper>

@ -22463,7 +22463,8 @@
"@fullcalendar/bootstrap": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@fullcalendar/bootstrap/-/bootstrap-4.4.2.tgz",
"integrity": "sha512-zxtQvpZqr7zeBCfszo/i1e4zCvGwLh2zOp8J6Wxw5s73HsB1zuftWop7sPO+qhRrhX5MdM9i/wr8/nNY8BZSmw=="
"integrity": "sha512-zxtQvpZqr7zeBCfszo/i1e4zCvGwLh2zOp8J6Wxw5s73HsB1zuftWop7sPO+qhRrhX5MdM9i/wr8/nNY8BZSmw==",
"requires": {}
},
"@fullcalendar/core": {
"version": "4.4.2",
@ -22473,12 +22474,14 @@
"@fullcalendar/daygrid": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@fullcalendar/daygrid/-/daygrid-4.4.2.tgz",
"integrity": "sha512-axjfMhxEXHShV3r2TZjf+2niJ1C6LdAxkHKmg7mVq4jXtUQHOldU5XsjV0v2lUAt1urJBFi2zajfK8798ukL3Q=="
"integrity": "sha512-axjfMhxEXHShV3r2TZjf+2niJ1C6LdAxkHKmg7mVq4jXtUQHOldU5XsjV0v2lUAt1urJBFi2zajfK8798ukL3Q==",
"requires": {}
},
"@fullcalendar/interaction": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/@fullcalendar/interaction/-/interaction-4.4.2.tgz",
"integrity": "sha512-3ItpGFnxcYQT4NClqhq93QTQwOI8x3mlMf5M4DgK5avVaSzpv9g8p+opqeotK2yzpFeINps06cuQyB1h7vcv1Q=="
"integrity": "sha512-3ItpGFnxcYQT4NClqhq93QTQwOI8x3mlMf5M4DgK5avVaSzpv9g8p+opqeotK2yzpFeINps06cuQyB1h7vcv1Q==",
"requires": {}
},
"@fullcalendar/timegrid": {
"version": "4.4.2",
@ -22638,7 +22641,8 @@
"@tinymce/tinymce-vue": {
"version": "3.2.8",
"resolved": "https://registry.npmjs.org/@tinymce/tinymce-vue/-/tinymce-vue-3.2.8.tgz",
"integrity": "sha512-jEz+NZ0g+FZFz273OEUWz9QkwPMyjc5AJYyxOgu51O1Y5UaJ/6IUddXTX6A20mwCleEv5ebwNYdalviafx4fnA=="
"integrity": "sha512-jEz+NZ0g+FZFz273OEUWz9QkwPMyjc5AJYyxOgu51O1Y5UaJ/6IUddXTX6A20mwCleEv5ebwNYdalviafx4fnA==",
"requires": {}
},
"@types/glob": {
"version": "7.1.3",
@ -23276,7 +23280,8 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@vue/preload-webpack-plugin/-/preload-webpack-plugin-1.1.2.tgz",
"integrity": "sha512-LIZMuJk38pk9U9Ur4YzHjlIyMuxPlACdBIHH9/nGYVTsaGKOSnSuELiE8vS9wa+dJpIYspYUOqk+L1Q4pgHQHQ==",
"dev": true
"dev": true,
"requires": {}
},
"@vue/test-utils": {
"version": "1.0.0-beta.29",
@ -23588,13 +23593,15 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz",
"integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==",
"dev": true
"dev": true,
"requires": {}
},
"ajv-keywords": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true
"dev": true,
"requires": {}
},
"alphanum-sort": {
"version": "1.0.2",
@ -23960,7 +23967,8 @@
"version": "7.0.0-bridge.0",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz",
"integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==",
"dev": true
"dev": true,
"requires": {}
},
"babel-eslint": {
"version": "10.0.1",
@ -27194,7 +27202,8 @@
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
"integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
"dev": true
"dev": true,
"requires": {}
},
"ansi-regex": {
"version": "3.0.0",
@ -27471,7 +27480,8 @@
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
"integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
"dev": true
"dev": true,
"requires": {}
},
"debug": {
"version": "4.3.1",
@ -28883,7 +28893,8 @@
"highcharts-vue": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/highcharts-vue/-/highcharts-vue-1.3.5.tgz",
"integrity": "sha512-By1kc3m8XoI20pMshs/ue69j4rH6eQioDPoIrtC20RTti4QyvNAx8DisGSO3GAWe9sn50hPk8NsyxcwZIGaz3Q=="
"integrity": "sha512-By1kc3m8XoI20pMshs/ue69j4rH6eQioDPoIrtC20RTti4QyvNAx8DisGSO3GAWe9sn50hPk8NsyxcwZIGaz3Q==",
"requires": {}
},
"hmac-drbg": {
"version": "1.0.1",
@ -37288,7 +37299,8 @@
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
"integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
"dev": true,
"optional": true
"optional": true,
"requires": {}
},
"ansi-regex": {
"version": "3.0.0",

@ -12,40 +12,41 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
<!-- <el-col :span="24">-->
<!-- <el-form-item label="创建时间" prop="creatortime">-->
<!-- <el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable-->
<!-- :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"-->
<!-- value-format="timestamp">-->
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="创建人名称" prop="creatorusername">-->
<!-- <el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable-->
<!-- :style='{"width":"100%"}'>-->
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改时间" prop="lastmodifytime">
<el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="修改时间" prop="lastmodifytime">-->
<!-- <el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable-->
<!-- :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"-->
<!-- value-format="timestamp">-->
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="修改人名称" prop="lastmodifyusername">-->
<!-- <el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable-->
<!-- :style='{"width":"100%"}'>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-input>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>

@ -0,0 +1,93 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<el-form-item label="编码"
prop="inventoryOrgCode" >
<p>{{dataForm.inventoryOrgCode}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="名称"
prop="inventoryOrgName" >
<p>{{dataForm.inventoryOrgName}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="所属组织"
prop="companyId" >
<p>{{dataForm.companyId}}</p>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse'
import jnpf from '@/utils/jnpf'
export default {
components: {PrintBrowse},
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
dataForm: {
id :'',
inventoryOrgCode : '',
inventoryOrgName : '',
companyId : "",
lastModifyUserName : "",
lastModifyTime : "",
creatorUserName : "",
creatorTime : "",
},
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/InventoryOrg/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

@ -0,0 +1,68 @@
<template>
<el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
<el-form label-position="top" label-width="80px">
<el-form-item label="数据选择">
<el-radio-group v-model="type">
<el-radio :label="0">当前页面数据</el-radio>
<el-radio :label="1">全部页面数据</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="导出字段">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
<el-checkbox-group v-model="columns" @change="handleCheckedChange">
<el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop">
{{item.label}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible=false"> </el-button>
<el-button type="primary" @click="downLoad"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
btnLoading: false,
type: 0,
columns: [],
checkAll: true,
isIndeterminate: false,
columnList: []
}
},
methods: {
init(columnList) {
this.visible = true
this.checkAll = true
this.isIndeterminate = false
this.columnList = columnList
this.columns = columnList.map(o => o.prop)
},
handleCheckAllChange(val) {
this.columns = val ? this.columnList.map(o => o.prop) : [];
this.isIndeterminate = false;
},
handleCheckedChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.columnList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length;
},
downLoad() {
this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') })
}
}
}
</script>
<style lang="scss" scoped>
>>> .el-dialog__body {
padding: 20px !important;
}
</style>

@ -0,0 +1,181 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<el-form-item label="编码"
prop="inventoryOrgCode" >
<el-input v-model="dataForm.inventoryOrgCode"
placeholder="请输入库存组织编码" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="名称"
prop="inventoryOrgName" >
<el-input v-model="dataForm.inventoryOrgName"
placeholder="请输入库存组织名称" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="所属组织"
prop="companyId" >
<el-select v-model="dataForm.companyId"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in companyIdOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
visible: false,
loading: false,
isDetail: false,
dataForm: {
inventoryOrgCode : '',
inventoryOrgName : '',
companyId : "",
lastModifyUserName : "",
lastModifyTime : "",
creatorUserName : "",
creatorTime : "",
},
rules:
{
inventoryOrgCode: [
{
required: true,
message: '请输入库存组织编码',
trigger: 'blur'
},
],
},
companyIdOptions:[],
}
},
computed: {},
watch: {},
created() {
this.getcompanyIdOptions();
},
mounted() {},
methods: {
getcompanyIdOptions() {
getDataInterfaceRes('394016341591396805').then(res => {
let data = res.data.data
this.companyIdOptions = data
})
},
clearData(data){
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/InventoryOrg/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/example/InventoryOrg',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}else{
request({
url: '/api/example/InventoryOrg/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
},
}
</script>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save