Commit 085003ee by yyq1988

Merge remote-tracking branch 'origin/master'

parents fd6b8037 35491488
......@@ -21,5 +21,6 @@ public interface LedgerInfoMapper extends BaseMapper<LedgerInfo> {
public List<CountLedgerInfo> findCliList(LedgerInfo ledgerInfo);
void deleteByLedgerInfo(@Param("id") String id);
public List<LedgerInfo> findListByQrIdAndCode(LedgerInfo ledgerInfo);
void updateByLedgerInfo(@Param("id") String id);
}
\ No newline at end of file
......@@ -252,4 +252,29 @@
</where>
GROUP BY a.ledger_id,a.batch_num,a.shelves_id
</select>
<select id="findListByQrIdAndCode" resultType="LedgerInfo" >
SELECT
<include refid="ledgerInfoColumns"/>
FROM t_wh_ledger_info a
<include refid="ledgerInfoJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
<if test="code != null and code != ''">
AND a.code = #{code}
</if>
<if test="qr != null and qr.id != null and qr.id != ''">
AND a.qr_id = #{qr.id}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.create_date ASC
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
......@@ -66,28 +66,31 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
List<CountLedgerInfo> list = entry.getValue();
CountLedgerInfo cli = new CountLedgerInfo();
Set<String> wNameSet = new HashSet<>();
Set<String> sNameSet = new HashSet<>();
String shelvesNames = "";
int num = 0;
BigDecimal sum = new BigDecimal(0);
for (int i = 0; i < list.size(); i ++) {
CountLedgerInfo c = list.get(0);
CountLedgerInfo c = list.get(i);
if (i == 0) {
cli.setBatchNum(c.getBatchNum());
cli.setModel(c.getModel());
cli.setName(c.getName());
cli.setType(c.getType());
}
if (i != list.size() - 1) {
sNameSet.add(c.getShelves().getName());
/*if (i != list.size() - 1) {
shelvesNames = shelvesNames + c.getShelves().getName() + ",";
} else {
shelvesNames = shelvesNames + c.getShelves().getName();
}
}*/
wNameSet.add(c.getShelves().getWarehouse().getName());
num += c.getNum();
sum = sum.add(c.getSum());
}
String wNames = ShelvesUtil.mergerWarehouseName(wNameSet);
cli.setShelvesNames(shelvesNames);
String sNames = ShelvesUtil.mergerWarehouseName(sNameSet);
cli.setShelvesNames(sNames);
cli.setWarehouseNames(wNames);
cli.setNum(num);
cli.setSum(sum);
......@@ -205,7 +208,7 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
}
@Transactional(readOnly = false)
public LedgerInfo findByQrOrCode(LedgerInfo ledgerInfo) {
List<LedgerInfo> ledgerInfoList = ledgerInfoMapper.findList(ledgerInfo);
List<LedgerInfo> ledgerInfoList = ledgerInfoMapper.findListByQrIdAndCode(ledgerInfo);
if (null != ledgerInfoList && ledgerInfoList.size() > 0) {
return ledgerInfoList.get(0);
} else {
......
......@@ -35,14 +35,14 @@ public class MaterialTypeService extends TreeService<MaterialTypeMapper, Materia
@Transactional(readOnly = false)
public void save(MaterialType materialType) {
String [] parentIdsArr = materialType.getParentIds().split(",");
if (parentIdsArr.length >= 2) {
materialType.setLast(1);
} else {
materialType.setLast(0);
if (null != materialType.getParentIds()) {
String [] parentIdsArr = materialType.getParentIds().split(",");
if (parentIdsArr.length >= 2) {
materialType.setLast(1);
} else {
materialType.setLast(0);
}
}
super.save(materialType);
}
......
......@@ -28,10 +28,12 @@ public class ShelvesUtil {
StringBuffer sb = new StringBuffer();
for (int i =0; i < wList.size(); i ++) {
if (0 != wList.size()) {
sb.append(wList.get(0));
sb.append(",");
sb.append(wList.get(i));
if (i != wList.size() - 1) {
sb.append(",");
}
} else {
sb.append(wList.get(0));
sb.append(wList.get(i));
}
}
return sb.toString();
......
......@@ -26,7 +26,8 @@
s.name AS "shelves.name",
warehouse.name AS "warehouse.name",
qr.code AS "qrCode.code"
qr.code AS "qrCode.code",
qr.state AS "qrCode.state"
</sql>
<sql id="storageInfoJoins">
......@@ -56,6 +57,9 @@
<if test="storage != null and storage.id != null and storage.id != ''">
AND a.storage_id = #{storage.id}
</if>
<if test="goodsInfo != null and goodsInfo.id != null and goodsInfo.id != ''">
AND a.goods_info_id = #{goodsInfo.id}
</if>
<if test="name != null and name != ''">
AND a.name LIKE
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
......@@ -65,12 +69,12 @@
<if test="type != null and type.id != null and type.id != ''">
AND a.type_id = #{type.id}
</if>
<if test="shelves != null and shelves.id != null and shelves.id != ''">
AND a.shelves_id = #{shelves.id}
</if>
<if test="goodsInfo != null and goodsInfo.id != null and goodsInfo.id != ''">
AND a.goods_info_id = #{goodsInfo.id}
</if>
<if test="model != null and model != ''">
AND a.model LIKE
<if test="dbName == 'oracle'">'%'||#{model}||'%'</if>
......
......@@ -79,11 +79,12 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
List<CountStorageInfo> list = entry.getValue();
CountStorageInfo csi = new CountStorageInfo();
Set<String> wNameSet = new HashSet<>();
Set<String> sNameSet = new HashSet<>();
String shelvesNames = "";
int num = 0;
BigDecimal sum = new BigDecimal(0);
for (int i = 0; i < list.size(); i ++) {
CountStorageInfo c = list.get(0);
CountStorageInfo c = list.get(i);
if (i == 0) {
csi.setGoodsInfo(c.getGoodsInfo());
csi.setModel(c.getModel());
......@@ -92,17 +93,19 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
csi.setState(c.getState());
csi.setAmount(c.getAmount());
}
if (i != list.size() - 1) {
sNameSet.add(c.getShelves().getName());
/*if (i != list.size() - 1) {
shelvesNames = shelvesNames + c.getShelves().getName() + ",";
} else {
shelvesNames = shelvesNames + c.getShelves().getName();
}
}*/
wNameSet.add(c.getWarehouse().getName());
num += c.getNum();
sum = sum.add(c.getSum());
}
String wNames = ShelvesUtil.mergerWarehouseName(wNameSet);
csi.setShelvesNames(shelvesNames);
String sNames = ShelvesUtil.mergerWarehouseName(sNameSet);
csi.setShelvesNames(sNames);
csi.setWarehouseNames(wNames);
csi.setNum(num);
csi.setSum(sum);
......@@ -120,6 +123,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
*/
public List<StorageInfo> findInfoBycountStorage(CountStorageInfo countStorageInfo) {
StorageInfo storageInfo = new StorageInfo();
storageInfo.setStorage(countStorageInfo.getStorage());
storageInfo.setShelves(countStorageInfo.getShelves());
storageInfo.setGoodsInfo(countStorageInfo.getGoodsInfo());
storageInfo.setPage(countStorageInfo.getPage());
......@@ -144,6 +148,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
continue;
}
GoodsInfo goodsInfo = storageInfo.getGoodsInfo();
goodsInfo = goodsInfoMapper.get(goodsInfo.getId());
if (StorageInfo.DEL_FLAG_NORMAL.equals(storageInfo.getDelFlag())){
if (StringUtils.isBlank(storageInfo.getId())){
storageInfo.setStorage(storage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment