Commit 6067a0b5 by 李小惠

修改OAbug

parent 854ca8d5
......@@ -4,13 +4,13 @@
<data-source source="LOCAL" name="junmp" uuid="ce8e9dd8-fc56-41f7-9a8b-6cbd906018c3">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://192.168.3.128:3306/db_jyzb?characterEncoding=UTF-8&amp;useUnicode=true&amp;useSSL=false&amp;tinyInt1isBit=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=Asia/Shanghai</jdbc-url>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://192.168.1.128:3306/db_jyzb?characterEncoding=UTF-8&amp;useUnicode=true&amp;useSSL=false&amp;tinyInt1isBit=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=Asia/Shanghai</jdbc-url>
</data-source>
<data-source source="LOCAL" name="local" uuid="134b9a70-dbff-479c-9337-8e4869b6525e">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://127.0.0.1:3306/junmp?characterEncoding=UTF-8&amp;useUnicode=true&amp;useSSL=false&amp;tinyInt1isBit=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=Asia/Shanghai</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
......
......@@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/lxh" vcs="Git" />
</component>
</project>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,12 +2,14 @@ package com.junmp.jyzb.api.bean.dto;
import lombok.Data;
import java.util.Date;
@Data
public class DetailChildDto {
private String totalPrice;
private String warrantyPeriod;
private String maintenancePeriod;
private String productionDate;
private Date productionDate;
private String num;
private String price;
}
package com.junmp.jyzb.api.bean.query;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
......@@ -44,4 +45,6 @@ public class BussinessOrderDetialReq {
//报废区数
private Integer brokenNumber;
private Integer property;
private Integer expireNumber;
}
......@@ -3,6 +3,7 @@ package com.junmp.jyzb.cache;
import com.junmp.jyzb.api.constant.JYZBConstant;
import com.junmp.jyzb.entity.Temp.HumidityAndtemperature;
import com.junmp.v2.cache.AbstractRedisCache;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
......@@ -33,21 +34,24 @@ public class TemperatureRedisCache extends AbstractRedisCache<Object> {
// String key = warehouseId;
// Long size = getRedisTemplate().opsForZSet().size(key);
getRedisTemplate().opsForZSet().add("WarehouseDev:"+warehouseId, data, timestamp);
setValueWithExpiration("WarehouseDev:"+warehouseId, data,259200);
getRedisTemplate().opsForValue().getOperations().expire("WarehouseDev:" + warehouseId, 259200, TimeUnit.SECONDS);
put(warehouseId, data);
}
public List<Object> getDataByTimestampRange(String warehouseId, long startTimestamp, long endTimestamp) {
// String key = warehouseId;
// boolean exists = getRedisTemplate().hasKey(key);
boolean exists = getRedisTemplate().hasKey("WarehouseDev:"+warehouseId);
DataType keyType = getRedisTemplate().type("WarehouseDev:"+warehouseId);
// Long size = getRedisTemplate().opsForZSet().size(key);
Set<Object> dataInRange = getRedisTemplate().opsForZSet().rangeByScore("WarehouseDev:"+warehouseId, startTimestamp, endTimestamp);
// getRedisTemplate().opsForZSet().rangeByScoreWithScores(key, startTimestamp, endTimestamp)
// Set<Object> dataInRange1= getRedisTemplate().opsForZSet ().reverseRange(key, startTimestamp, endTimestamp);
return new ArrayList<>(dataInRange);
}
public void setValueWithExpiration(String key, HumidityAndtemperature value, long expirationSeconds) {
getRedisTemplate().opsForValue().set(key, value, expirationSeconds, TimeUnit.SECONDS);
}
// public void setValueWithExpiration(String key, HumidityAndtemperature value, long expirationSeconds) {
// getRedisTemplate().opsForValue().set(key, value, expirationSeconds, TimeUnit.SECONDS);
// }
}
......@@ -57,7 +57,6 @@ public class CrudController {
@PostMapping("/UpdateES")
public Object UpdateES() {
pubOrgService.AddToEs();
equipmentTypeService.addEs();
equipmentSizeService.addEs();
busFormService.addEs();
......
......@@ -320,10 +320,6 @@ public class PoliceController {
return ApiRes.success(policemanService.alignUserInfo(req));
}
// @PostMapping(path = "/oneClickAccountCreation",name = "一键生成账号(运维,管理,审核)#logType=30")
// public ApiRes<Boolean> oneClickAccountCreation(@RequestBody PubOrg pubOrg) throws IOException {
// return ApiRes.success(policemanService.oneClickAccountCreation(pubOrg));
// }
@PostMapping(path = "/oneClickAccountCreation",name = "一键生成账号(运维,管理,审核)#logType=30")
@ApiOperation("一键生成账号")
public ApiRes<Boolean> oneClickAccountCreation(@RequestBody PubOrg pubOrg) throws IOException {
......
......@@ -102,6 +102,8 @@ public class PublicController {
@Resource
private OrderMainService orderMainService;
@Resource
private PubOrgService pubOrgService;
@Resource
private OutInRecordRedisCache outInRecordRedisCache;
......@@ -159,11 +161,6 @@ public class PublicController {
return ApiRes.success(publicService.updateMessage(req));
}
@PostMapping(path = "/setReadMessage",name = "将消息设置为已读状态#logType=30")
@ApiOperation("将消息设置为已读状态")
public ApiRes<Boolean> setReadMessage(@RequestBody MessageReq req){
return ApiRes.success(publicService.setReadMessage(req));
}
@PostMapping("/aaa")
......@@ -194,6 +191,12 @@ public class PublicController {
return ApiRes.success(true);
}
@PostMapping(path = "/findCodeToOrgId",name = "通过区域短码获取组织机构id#logType=30")
@ApiOperation("通过区域短码获取组织机构id")
public ApiRes<Long> findCodeToOrgId(@RequestBody PubOrg pubOrg){
return ApiRes.success(pubOrgService.findCodeToOrgId(pubOrg));
}
}
......@@ -41,7 +41,7 @@ public class VieDestoryGroup implements Serializable {
private String orgId;
@TableField("count_of_items")
private String countOfItems;
private Integer countOfItems;
@TableField("warehouse_id")
private String warehouseId;
......
......@@ -42,7 +42,7 @@ public class VieWarrantyGroup implements Serializable {
private String orgId;
@TableField("count_of_items")
private String countOfItems;
private Integer countOfItems;
@TableField("warehouse_id")
private String warehouseId;
......
......@@ -113,6 +113,8 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
void updateEqsInfo(@Param("list") List<InventoryReq> addInvList,@Param("updateTime") Date time);
List<Inventory> selectSum(@Param("list") List<Object[]> searchItem,@Param("epcType")Integer epcType);
// IPage<InventoryDto> GetDetailByTerms(@Param("page") Page<Object> defaultPage, @Param("req") InventoryReq req);
......
......@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.entity.VieDestoryGroup;
import com.junmp.jyzb.entity.VieWarrantyGroup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface VieDestroyGroupMapper extends BaseMapper<VieDestoryGroup> {
List<VieDestoryGroup> selectByTerms(@Param("list") List<VieWarrantyGroup> valuesList);
}
\ No newline at end of file
......@@ -22,4 +22,5 @@ import java.util.Map;
@Mapper
public interface VieWarrantyGroupMapper extends BaseMapper<VieWarrantyGroup> {
List<VieWarrantyGroup> selectByTerms(@Param("list") List<VieWarrantyGroup> valuesList);
}
\ No newline at end of file
......@@ -94,4 +94,5 @@ public interface InventoryService extends IService<Inventory> {
List<PeriodAndDateDto> GetByPeriodAndDate(InventoryReq req);
List<Inventory> selectSum(List<Object[]> searchItem,Integer epctype);
}
......@@ -44,4 +44,6 @@ public interface PubOrgService extends IService<PubOrg> {
boolean updatePubOrg(UpdateOrgReq req);
PubOrg getOneOrgInfo(UpdateOrgReq req);
Long findCodeToOrgId(PubOrg pubOrg);
}
......@@ -18,5 +18,4 @@ public interface PublicService {
boolean updateMessage(MessageReq req);
boolean setReadMessage(MessageReq req);
}
......@@ -6,8 +6,12 @@ import com.junmp.jyzb.api.bean.req.WarrantyReq;
import com.junmp.jyzb.entity.VieDestoryGroup;
import com.junmp.jyzb.entity.VieWarrantyGroup;
import com.junmp.v2.db.api.page.PageResult;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface VieDestoryGroupService extends IService<VieDestoryGroup> {
}
\ No newline at end of file
......@@ -5,8 +5,13 @@ import com.junmp.jyzb.api.bean.dto.TjDto.WarrantyDataDto;
import com.junmp.jyzb.api.bean.req.WarrantyReq;
import com.junmp.jyzb.entity.VieWarrantyGroup;
import com.junmp.v2.db.api.page.PageResult;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface VieWarrantyGroupService extends IService<VieWarrantyGroup> {
PageResult<WarrantyDataDto> WarrantyData(WarrantyReq req);
}
\ No newline at end of file
......@@ -341,8 +341,9 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
boolean flag=false;
InventoryReq inv = map.get(key);
for (InventorySummary is:inventorySummaryList) {
if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equalsIgnoreCase(inv.getPrice().toString()) &&
req.getOriginalPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) && inv.getLocationId().equals(is.getLocationId())){
if (is.getUnitPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
req.getOriginalPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
inv.getLocationId().equals(is.getLocationId())){
is.setStockNumber(is.getStockNumber()-inv.getStockNum());
is.setOutboundNumber(is.getOutboundNumber()-inv.getOutBoundNum());
......@@ -356,8 +357,9 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
break;
}
if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equalsIgnoreCase(inv.getPrice().toString()) &&
req.getPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) && inv.getLocationId().equals(is.getLocationId()))
if (is.getUnitPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
req.getPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
inv.getLocationId().equals(is.getLocationId()))
{
is.setStockNumber(is.getStockNumber()+inv.getStockNum());
is.setOutboundNumber(is.getOutboundNumber()+inv.getOutBoundNum());
......@@ -715,6 +717,10 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
inventory.setNote("equipmentImport");
inventory.setCreateTime(DateTimeUtil.getCurrentDateTime());
inventory.setEpc(epc);
inventory.setLocationState("in");
inventory.setBussinessState("normal");
inventory.setState("normal");
inventory.setLocationState("in");
addInvList.add(inventory);
WarehouseInventory warehouseInventory = new WarehouseInventory();
BeanPlusUtil.copyProperties(inv,warehouseInventory);
......@@ -723,6 +729,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
warehouseInventory.setFlag(2);
warehouseInventory.setEpc(epc);
warehouseInventory.setOrgName(inv.getOrgName());
warehouseInventory.setLocationState("in");
addWareList.add(warehouseInventory);
}
......@@ -761,5 +768,10 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return list;
}
@Override
public List<Inventory> selectSum(List<Object[]> searchItem,Integer epcType) {
return inventoryMapper.selectSum(searchItem,epcType);
}
}
\ No newline at end of file
......@@ -769,7 +769,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
Map<String,LogSummaryReq> logMap=new HashMap<>();
for (InventoryReq inv:list) {
logMap=setLogSummaryToMap(logMap,loginUser,inv.getLocationId(),inv.getBussinessType(),inv.getTypeName(),
inv.getLocationName(),orderId,orderCode,inv.getOrgId(),inv.getLocationState(),deviceType);
}
......
......@@ -244,6 +244,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List<Object[]> searchItem=new ArrayList<>();
for (UpdateOrderDetailReq listReq:req.getDetailList()) {
OrderDetail detail=new OrderDetail();
if (ObjectUtil.isEmpty(listReq.getProductionDate())|| listReq.getProductionDate().trim().isEmpty()){
listReq.setProductionDate(null);
}
BeanPlusUtil.copyProperties(listReq, detail);
detail.setOrderId(order.getId());
//设置单据类型
......@@ -1160,11 +1163,15 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
if (CollectionUtil.isNotEmpty(updateInvList)){
//更新数据库中实体类的状态
LambdaUpdateWrapper<Inventory> wp1 = Wrappers.<Inventory>lambdaUpdate();
String state="";
if (orderMain.getBussinessType().equals("destruction")){
req.setBussinessType("destory");
state="destory";
wp1.set(Inventory::getState, state)
.set(Inventory::getLocationState, req.getOrderType());
}else {
wp1.set(Inventory::getState, req.getBussinessType())
.set(Inventory::getLocationState, req.getOrderType());
}
wp1.set(Inventory::getState, req.getBussinessType())
.set(Inventory::getLocationState, req.getOrderType());
LambdaUpdateWrapper<WarehouseInventory> wp2 = Wrappers.<WarehouseInventory>lambdaUpdate();
wp2.set(WarehouseInventory::getLocationState, req.getOrderType());
for (int i = 0; i < updateInvList.size(); i++) {
......
......@@ -868,6 +868,16 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
return pubOrg;
}
@Override
public Long findCodeToOrgId(PubOrg pubOrg) {
PubOrg one = getOne(new LambdaQueryWrapper<PubOrg>()
.eq(PubOrg::getFindCode, pubOrg.getFindCode())
.or()
.eq(PubOrg::getOrgCode, pubOrg.getFindCode())
.orderByAsc(PubOrg::getLevelFlag).last("limit 1"));
return one.getOrgId();
}
}
......
......@@ -97,13 +97,12 @@ public class PublicServiceImpl implements PublicService {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateMessage(MessageReq req) {
SysMessage message = sysMessageService.getById(req.getMsgIdList().get(0));
req.setBizId(message.getBizId());
messageApi.updateMsgReadFlag(req);
//将该条消息全设置为已读并且更新再推送一条消息
List<SysMessage> list = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().eq(SysMessage::getBizId, message.getBizId()));
sysMessageService.update(new LambdaUpdateWrapper<SysMessage>()
.set(SysMessage::getReadFlag,1)
.eq(SysMessage::getBizId,req.getBizId()));
List<SysMessage> list = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().eq(SysMessage::getBizId, req.getBizId()));
List<Long> userIdList = list.stream().map(SysMessage::getReceiveUserId).collect(Collectors.toList());
MessageSendReq sendReq = new MessageSendReq();
......@@ -112,6 +111,7 @@ public class PublicServiceImpl implements PublicService {
.collect(Collectors.joining(",")));
sendReq.setMsgTitle("refresh");
sendReq.setMsgContent("消息更新");
sendReq.setBizType("");
sendReq.setPriority("1");
sendReq.setSendTime(DateTime.now());
messageApi.sendMessageNoToken(sendReq);
......@@ -119,16 +119,6 @@ public class PublicServiceImpl implements PublicService {
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean setReadMessage(MessageReq req) {
List<Long> msgIdList = req.getMsgIdList();
List<SysMessage> list = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().in(SysMessage::getMsgId, msgIdList));
List<Long> collect = list.stream().map(SysMessage::getBizId).collect(Collectors.toList());
List<SysMessage> list1 = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().in(SysMessage::getBizId, collect));
return sysMessageService.update(new LambdaUpdateWrapper<SysMessage>()
.set(SysMessage::getReadFlag, 1)
.in(SysMessage::getBizId, list1));
}
}
......@@ -871,9 +871,8 @@ public class TjServiceImpl implements TjService {
// @Override
public List<TjOrgCountDto> TjOrgCountDetail(TjOrgCountReq req) {
if ((req.getColumn().equals("createTime") && req.getOrder().equals("desc"))||(req.getColumn().equals("createTime") && req.getOrder().equals("asc"))){
if (req.getColumn().equals("createTime")){
req.setColumn(null);
req.setOrder(null);
}
if (ObjectUtil.isNotNull(req.getColumn()) && !req.getColumn().trim().isEmpty() &&
(req.getOrder().equalsIgnoreCase("asc")|| req.getOrder().equalsIgnoreCase("desc")) &&
......
......@@ -119,6 +119,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
}
Warehouse warehouse = new Warehouse();
BeanPlusUtil.copyProperties(req, warehouse);
warehouse.setOrgIdInt(req.getOrgId());
warehouse.setCreateTime(DateTimeUtil.getCurrentDateTime());
warehouse.setUpdateTime(DateTimeUtil.getCurrentDateTime());
save(warehouse);
......
......@@ -322,27 +322,48 @@
WHERE
YEAR = #{year}
and `po`.`del_flag` = 1
<if test="level ==null">and (po.org_id =#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="
levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level==1">
and (po.org_id !=#{orgId} and (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
<if test="typeIdsList!=null and typeIdsList.size() > 0">
and vecs.type_id in
<foreach collection="typeIdsList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="typeParentId != null and typeParentId !=''">
and vecs.type_parent_id=#{typeParentId}
</if>
<if test="sizeNameList!=null and sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
vecs.size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
<if test="monthList != null and monthList.size()>0">
and vecs.month in
<foreach collection="monthList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="level ==null">
and (po.org_id =#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level == 0 ">
and po.org_id =#{orgId}
</if>
</if>
<if test="level==1">
and (po.org_id !=#{orgId} and (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level == 0 ">
and po.org_id =#{orgId}
</if>
GROUP BY
`year`,MONTH,size_id,size_name,type_id,type_name
) AS t
......@@ -354,6 +375,9 @@
<if test="column != null and column != '' and order != null and order != '' ">
order by ${column} ${order}
</if>
<if test="column == null">
order by type_id
</if>
</select>
<select id="TjOrgCountTotalDetail" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto">
select t1.org_id,t1.org_code,t1.org_name,t1.d_name,t2.year,t2.use_count,t2.fix_count,t2.number
......
......@@ -780,6 +780,30 @@
</if>
)as b
</select>
<select id="selectSum" resultType="com.junmp.jyzb.entity.Inventory">
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,
wi.type_name,wi.org_name,wi.size_name,wi.location_name,i.epc_type,
wi.location_type,wi.location_id,i.id ,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
WHERE
(
<foreach collection="list" item="item" separator="or">
wi.org_id='${item[0]}'
and wi.location_id ='${item[1]}'
and wi.type_id='${item[2]}'
and wi.size_id='${item[3]}'
and i.price='${item[4]}'
and i.property='${item[5]}'
</foreach>
)
and wi.location_type=0
and i.location_state = "in"
and (DATE_ADD(i.production_date, INTERVAL i.warranty_period MONTH) &lt; NOW() or i.warranty_period != 0)
and i.epc_type=#{epcType}
</select>
<select id="EqsByState" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
select
......
......@@ -577,7 +577,7 @@
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )+
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`outbound_number` ELSE 0 END )
) AS total_number,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) AS `ck_stock_number`,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) AS `ck_outbound_number`,
......@@ -768,10 +768,10 @@
select count(*) from (
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.property,
i.production_date,i.warranty_period,i.maintenance_period,i.property,
i.area_id,
bs.name as supplier_name,
(select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
es.instructions as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo,
(case when DATE_ADD(i.production_date, INTERVAL i.warranty_period MONTH) > NOW() or i.warranty_period = 0 then 0 else 1 end)as term_state
......@@ -807,6 +807,9 @@
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
<if test="req.state !='all' and req.state !=''">
and i.state=#{req.state}
</if>
ORDER BY wi.type_id,i.size_id
) as a
</select>
......
......@@ -57,6 +57,51 @@
GROUP BY months.month, years.year
ORDER BY year, month;
</select>
<select id="RecordSumByOrderId" resultType="com.junmp.jyzb.api.bean.dto.LogSummaryDto">
SELECT
max(order_code) as order_code,
order_main_id,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( device_type, '' ))) AS device_type,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( user_name, '' ))) AS user_name,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( equipment_list, '' ))) AS equipment_list,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( location_name, '' ))) AS location_name,
bussiness_type,
out_in_state,
sum(number) as number
FROM
base_log_summary
where (order_main_id is not null and order_main_id !='') and org_id=#{req.orgId}
<if test="req.startTime != null and req.endTime != null">
and create_time>#{req.startTime} and create_time &lt; #{req.endTime}
</if>
and location_type=0
<if test="req.outInState != null and req.outInState != ''">
and out_in_state =#{req.outInState}
</if>
<if test="req.bussinessType != null and req.bussinessType != ''">
and bussiness_type =#{req.bussinessType}
</if>
<if test="req.locationName != null and req.locationName != ''">
and location_name like CONCAT('%', #{req.locationName}, '%')
</if>
<if test="req.locationId != null and req.locationId != ''">
and location_id =#{req.locationId}
</if>
<if test="req.typeName != null and req.typeName != ''">
and equipment_list like CONCAT('%', #{req.typeName}, '%')
</if>
<if test="req.userName != null and req.userName != ''">
and user_name like CONCAT('%', #{req.userName}, '%')
</if>
GROUP BY order_main_id,bussiness_type,out_in_state
<if test="req.column != 'create_time' and req.column != null and req.column != '' and req.order != null and req.order != '' ">
order by ${req.column} ${req.order}
</if>
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="ShowInOutRecords" resultType="com.junmp.jyzb.entity.LogSummary">
select ls.location_id,ls.use_time,ls.create_time,ls.location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
from base_log_summary ls
......@@ -74,6 +119,7 @@
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="ShowInOutRecordsSum" resultType="java.lang.Integer">
select count(*)
from (select ls.location_id,ls.use_time, ls.location_name, ls.bussiness_type, ls.out_in_state, ls.user_name, a.*
......@@ -128,49 +174,6 @@
</if>
) as a
</select>
<select id="RecordSumByOrderId" resultType="com.junmp.jyzb.api.bean.dto.LogSummaryDto">
SELECT
max(order_code) as order_code,
order_main_id,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( device_type, '' ))) AS device_type,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( user_name, '' ))) AS user_name,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( equipment_list, '' ))) AS equipment_list,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( location_name, '' ))) AS location_name,
bussiness_type,
out_in_state,
sum(number) as number
FROM
base_log_summary
where (order_main_id is not null and order_main_id !='') and org_id=#{req.orgId}
and create_time>#{req.startTime} and create_time &lt; #{req.endTime} and location_type=0
<if test="req.outInState != null and req.outInState != ''">
and out_in_state =#{req.outInState}
</if>
<if test="req.bussinessType != null and req.bussinessType != ''">
and bussiness_type =#{req.bussinessType}
</if>
<if test="req.locationName != null and req.locationName != ''">
and location_name like CONCAT('%', #{req.locationName}, '%')
</if>
<if test="req.locationId != null and req.locationId != ''">
and location_id =#{req.locationId}
</if>
<if test="req.typeName != null and req.typeName != ''">
and equipment_list like CONCAT('%', #{req.typeName}, '%')
</if>
<if test="req.userName != null and req.userName != ''">
and user_name like CONCAT('%', #{req.userName}, '%')
</if>
GROUP BY order_main_id,bussiness_type,out_in_state
<if test="req.column != 'create_time' and req.column != null and req.column != '' and req.order != null and req.order != '' ">
order by ${req.column} ${req.order}
</if>
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="RecordSumByOrderIdSum" resultType="com.junmp.jyzb.api.bean.dto.LogSummaryDto">
select sum(number) as number,count(*) as count FROM (
SELECT
......@@ -186,7 +189,10 @@
FROM
base_log_summary
where (order_main_id is not null and order_main_id !='') and org_id=#{req.orgId}
and create_time>#{req.startTime} and create_time &lt; #{req.endTime} and location_type=0
<if test="req.startTime != null and req.endTime != null">
and create_time>#{req.startTime} and create_time &lt; #{req.endTime}
</if>
and location_type=0
<if test="req.outInState != null and req.outInState != ''">
and out_in_state =#{req.outInState}
</if>
......
......@@ -261,7 +261,7 @@ WHERE o.org_id IN
</select>
<select id="selectUserBypoliceIds" resultType="com.junmp.jyzb.api.bean.dto.PolicemanDto">
select b.* FROM(
select a.*, GROUP_CONCAT(sr.role_name SEPARATOR ',') AS role_name FROM (
select a.*, GROUP_CONCAT(sr.role_name SEPARATOR ',') AS roles_name FROM (
select
su.user_id,su.account,su.status_flag as state,suo.org_id,max(p.id) as id,
COALESCE(max(p.name),max(su.nick_name)) as name,
......
......@@ -383,16 +383,20 @@
<select id="getTotalPriceDetail" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgPriceDto">
SELECT
t3.org_id,t3.org_code,t3.org_name,t3.d_name,
COALESCE ( t4.start_num, 0 ) AS start_num,
COALESCE ( t4.start_price, 0 ) AS start_price,
COALESCE ( t4.end_num, 0 ) AS end_num,
COALESCE ( t4.end_price, 0 ) AS end_price,
COALESCE ( t4.add_num, 0 ) AS add_num,
COALESCE ( t4.add_price, 0 ) AS add_price,
COALESCE ( t4.destory_num, 0 ) AS destory_num,
COALESCE ( t4.destory_price, 0 ) AS destory_price,
t4.type_id,t4.type_name
max(t3.org_id) as org_id,
max(t3.org_code) as org_code,
max(t3.org_name) as org_name,
max(t3.d_name) as d_name,
sum(COALESCE ( t4.start_num, 0 )) AS start_num,
sum(COALESCE ( t4.start_price, 0 )) AS start_price,
sum(COALESCE ( t4.end_num, 0 )) AS end_num,
sum(COALESCE ( t4.end_price, 0) ) AS end_price,
sum(COALESCE ( t4.add_num, 0 )) AS add_num,
sum(COALESCE ( t4.add_price, 0 )) AS add_price,
sum(COALESCE ( t4.destory_num, 0 )) AS destory_num,
sum(COALESCE ( t4.destory_price, 0 )) AS destory_price,
t4.type_id,
max(t4.type_name) as type_name
FROM
(
SELECT
......@@ -536,9 +540,13 @@
GROUP BY vpss.org_id_int, vpss.type_id, vpss.type_name
) AS t2 ON t1.org_id_int = t2.org_id_int AND t1.type_id = t2.type_id) AS t4
WHERE t3.org_id = t4.org_id_int
<if test="column != null and column != '' and order != null and order != '' ">
GROUP BY type_id
<if test="column != null ">
order by ${column} ${order}
</if>
<if test="column == null ">
order by type_id
</if>
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.VieDestroyGroupMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.VieDestoryGroup">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="sizeName" column="size_name" jdbcType="VARCHAR"/>
<result property="typeName" column="type_name" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="sizeId" column="size_id" jdbcType="VARCHAR"/>
<result property="typeId" column="type_id" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="BIGINT"/>
<result property="countOfItems" column="count_of_items" jdbcType="VARCHAR"/>
<result property="warehouseId" column="warehouse_id" jdbcType="VARCHAR"/>
<result property="warehouseName" column="warehouse_name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,size_name,type_name,
state,size_id,type_id,
org_name,org_id,count_of_items,
warehouse_id,warehouse_name
</sql>
<select id="selectByTerms" resultType="com.junmp.jyzb.entity.VieDestoryGroup">
select * from vie_destory_group where (
<foreach collection="list" item="item" separator="or">
org_id =#{item.orgId} and size_id =#{item.sizeId} and type_id=#{item.typeId} and warehouse_id= #{item.warehouseId}
</foreach>
) and state="broken"
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.VieWarrantyGroupMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.VieWarrantyGroup">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="sizeName" column="size_name" jdbcType="VARCHAR"/>
<result property="typeName" column="type_name" jdbcType="VARCHAR"/>
<result property="sizeId" column="size_id" jdbcType="VARCHAR"/>
<result property="typeId" column="type_id" jdbcType="VARCHAR"/>
<result property="days" column="days" jdbcType="INTEGER"/>
<result property="warrantyType" column="warranty_type" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="BIGINT"/>
<result property="countOfItems" column="count_of_items" jdbcType="VARCHAR"/>
<result property="warehouseId" column="warehouse_id" jdbcType="VARCHAR"/>
<result property="warehouseName" column="warehouse_name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,size_name,type_name,
size_id,type_id,days,
warranty_type,org_name,org_id,
count_of_items,warehouse_id,warehouse_name
</sql>
<select id="selectByTerms" resultType="com.junmp.jyzb.entity.VieWarrantyGroup">
select * from vie_warranty_group where (
<foreach collection="list" item="item" separator="or">
org_id =#{item.orgId} and size_id =#{item.sizeId} and type_id=#{item.typeId} and warehouse_id= #{item.warehouseId}
</foreach>
) and warranty_type=0
</select>
</mapper>
......@@ -36,7 +36,7 @@ knife4j:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.128:3306/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
url: jdbc:mysql://192.168.1.128:3306/db_jyzb_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: root
password: 123456
......
......@@ -33,7 +33,7 @@ spring:
virtual-host: /
profiles:
#@spring.active@
active: local
active: prod
servlet:
multipart:
max-request-size: 500MB
......
......@@ -83,6 +83,7 @@ import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import springfox.documentation.spring.web.json.Json;
import javax.annotation.Resource;
......@@ -117,6 +118,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
private QuickSuggestionsMapper quickSuggestionsMapper;
@Override
@Transactional
public ResponseResult agree(HandleDataDTO handleDataDTO) {
SysUser StartUser=new SysUser();
if (handleDataDTO.getCurrentUserInfo().getUserId()!=null)//优先拿接口中的信息,方便调试
......@@ -231,6 +233,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
@Override
@Transactional
public ResponseResult refuse(HandleDataDTO handleDataDTO) {
SysUser StartUser=new SysUser();
if (handleDataDTO.getCurrentUserInfo().getUserId()!=null)//优先拿接口中的信息,方便调试
......
......@@ -33,14 +33,14 @@
set om.examine_state ="refuse" where om.process_id =#{processId}
</update>
<update id="updateInventorySum">
<foreach collection="list" item="item" open="(" separator="," close=")">
update base_inventory_summary `is` set agent_broken_num={item.agentBrokenNum} where id=#{item.id}
<foreach collection="list" item="item" separator=";">
update base_inventory_summary set agent_broken_num=#{item.agentBrokenNum} where id=#{item.id}
</foreach>
</update>
<update id="updateDesNum">
<foreach collection="list" item="item" open="(" separator="," close=")">
update base_inventory_summary `is` set destruction_number={item.destructionNumber},
<foreach collection="list" item="item" separator=";" >
update base_inventory_summary set destruction_number=#{item.destructionNumber},
set number=#{item.number},set price=#{item.price}
where id=#{item.id}
</foreach>
......@@ -52,7 +52,7 @@
<select id="selectSumByItems" resultType="com.junmp.jyzb.api.bean.req.InventorySummaryReq">
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
broken_price,broken_number,near_broken_price,near_broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold
broken_price,broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold
from base_inventory_summary where
<foreach collection="list" item="item" separator="or">
(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论